change many thing

This commit is contained in:
atagen 2026-02-16 11:32:22 +11:00
parent b2d69d270e
commit fe668b5b9e
30 changed files with 632 additions and 470 deletions

41
common/auth.nix Normal file
View file

@ -0,0 +1,41 @@
{
lib,
inputs,
getFlakePkg,
...
}:
{
environment.shellAliases = {
#make run0 use aliases
run0 = "run0 --background='' ";
s = "run0";
};
services.dbus.implementation = "broker";
security = {
sudo.enable = false;
polkit = {
enable = true;
extraConfig = ''
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.policykit.exec") {
return polkit.Result.AUTH_ADMIN_KEEP;
}
});
polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.freedesktop.systemd1.") == 0) {
return polkit.Result.AUTH_ADMIN_KEEP;
}
});
'';
};
};
environment.etc."polkit-1/polkitd.conf".text = ''
[Polkitd]
ExpirationSeconds=60
'';
imports = [ inputs.run0-shim.nixosModules.default ];
environment.systemPackages = [ (getFlakePkg inputs.run0-shim) ];
security.soteria.enable = true;
systemd.user.services.niri-flake-polkit = lib.mkForce { };
}