{ pkgs, config, inputs, lib, ... }: let cfg = config.xyno.common; in { options.xyno.common.enable = lib.mkEnableOption "enables common settings"; config = lib.mkIf cfg.enable { boot.initrd.systemd.enable = true; hardware.keyboard.zsa.enable = true; programs.nh.enable = true; # patch in auth_keep for run0 security.polkit.debug = true; security.polkit.package = pkgs.polkit.overrideAttrs (old: { version = old.version + "-git"; src = inputs.polkit; patches = lib.take 1 old.patches; # patches = [ # (pkgs.fetchpatch2 { # url = "https://patch-diff.githubusercontent.com/raw/polkit-org/polkit/pull/533.patch"; # hash = "sha256-noR87BAzgBWtYDb0j9jkM/8wEkp7H+nArvKZrz69wfQ="; # }) # ]; }); security.polkit.extraConfig = '' polkit.addRule(function(action, subject) { // make run0 keep pw for some time (tm) if ( subject.isInGroup("wheel") && action.id == "org.freedesktop.systemd1.manage-units" ) { return polkit.Result.YES; } }); ''; }; }