sudo.nix: initial config

This commit is contained in:
Charlie Root 2024-08-22 21:41:20 +02:00
commit 805d897927
6 changed files with 31 additions and 19 deletions

View file

@ -5,5 +5,6 @@ _: {
./hardware
./nix/module.nix
./os/networking/module.nix
./os/security/module.nix
];
}

View file

@ -0,0 +1,5 @@
_: {
imports = [
./sudo.nix
];
}

View file

@ -0,0 +1,21 @@
{
lib,
pkgs,
}: let
inherit (lib) mkForce mkDefault;
in {
security = {
sudo-rs.enable = mkForce false;
sudo = {
enable = true;
# We use the default sudo package
package = pkgs.sudo;
# Wheel user should need the password to execute sudo commands
wheelNeedsPassword = mkDefault true;
# BUT, only wheel users should be able to use sudo.
execWheelOnly = mkForce true;
};
};
}