xin/configs/doas.nix

28 lines
495 B
Nix
Raw Permalink Normal View History

2023-09-12 08:44:05 -06:00
{ config
, lib
, ...
2023-07-11 09:12:50 -06:00
}:
2022-08-25 12:21:35 -06:00
with lib; {
options = {
2023-09-12 08:44:05 -06:00
doas = { enable = mkEnableOption "Enable doas for priv-escie"; };
2022-08-25 12:21:35 -06:00
};
config = mkIf config.doas.enable {
nixpkgs.config.packageOverrides = pkgs: {
2023-09-12 08:44:05 -06:00
doas = pkgs.doas.override { withPAM = false; };
2022-08-25 12:21:35 -06:00
};
security = {
doas = {
enable = true;
2023-07-11 09:12:50 -06:00
extraRules = [
{
2023-09-12 08:44:05 -06:00
groups = [ "wheel" ];
2023-07-11 09:12:50 -06:00
persist = true;
}
];
2022-08-25 12:21:35 -06:00
};
sudo.enable = false;
};
};
}