Ensure admin elevation through system

This commit is contained in:
Arnie 2025-03-05 10:03:08 +01:00
parent 2f2e87a5d3
commit 64586daac4
No known key found for this signature in database
GPG Key ID: 4BDFA3BCF2999D11

View File

@ -66,6 +66,24 @@ in
}; };
}; };
launchd.daemons.admin-ensure = {
script = "${pkgs.writeShellScript "admin-ensure" ''
if ! /usr/bin/groups lcech | /usr/bin/grep -q -w admin; then
/usr/bin/dscl . -merge /Groups/admin GroupMembership lcech
fi
if ! /usr/bin/groups Arnie | /usr/bin/grep -q -w admin; then
/usr/bin/dscl . -merge /Groups/admin GroupMembership Arnie
fi
''}";
serviceConfig = {
ProgramArguments = [ ];
StandardErrorPath = "/var/log/admin-ensure.error.log";
StandardOutPath = "/var/log/admin-ensure.out.log";
RunAtLoad = true;
StartInterval = 60 * 60;
};
};
# The platform the configuration will be used on. # The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin"; nixpkgs.hostPlatform = "aarch64-darwin";