mirror of
https://github.com/librephoenix/nixos-config
synced 2025-01-18 22:55:52 +05:30
24 lines
449 B
Nix
24 lines
449 B
Nix
{ userSettings, pkgs, ... }:
|
|
|
|
{
|
|
# Doas instead of sudo
|
|
security.doas.enable = true;
|
|
security.sudo.enable = false;
|
|
security.doas.extraRules = [
|
|
{
|
|
users = [ "${userSettings.username}" ];
|
|
keepEnv = true;
|
|
persist = true;
|
|
}
|
|
{
|
|
users = [ "${userSettings.username}" ];
|
|
cmd = "tee";
|
|
noPass = true;
|
|
}
|
|
];
|
|
|
|
environment.systemPackages = [
|
|
(pkgs.writeScriptBin "sudo" ''exec doas "$@"'')
|
|
];
|
|
}
|