diff --git a/darwin/common.nix b/darwin/common.nix index 6c28637..fc66a97 100644 --- a/darwin/common.nix +++ b/darwin/common.nix @@ -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. nixpkgs.hostPlatform = "aarch64-darwin";