diff --git a/system/core/schizo.nix b/system/core/schizo.nix index 7eb0a381..e0882afc 100644 --- a/system/core/schizo.nix +++ b/system/core/schizo.nix @@ -1,5 +1,5 @@ { - config, + inputs, pkgs, lib, ... @@ -102,7 +102,33 @@ }; }; - sudo.enable = true; + sudo.enable = lib.mkForce false; + sudo-rs = { + enable = true; + extraRules = [ + { + commands = [ + { + command = "/run/current-system/sw/bin/poweroff"; + options = ["NOPASSWD"]; + } + { + command = "/run/current-system/sw/bin/reboot"; + options = ["NOPASSWD"]; + } + { + command = "/run/current-system/sw/bin/nixos-rebuild"; + options = ["NOPASSWD"]; + } + { + command = "/run/current-system/sw/bin/nh"; + options = ["NOPASSWD"]; + } + ]; + groups = ["wheel"]; + } + ]; + }; }; boot.kernel.sysctl = { diff --git a/system/core/system.nix b/system/core/system.nix index 358b5503..e41d4382 100644 --- a/system/core/system.nix +++ b/system/core/system.nix @@ -41,7 +41,6 @@ btrfs-progs appimage-run starship # having starship here means pkgs.startship will be stored during build and not during promptInit - (writeScriptBin "sudo" ''exec doas "$@"'') ]; time = {