2022-04-26 01:54:53 +00:00
|
|
|
# Replace sudo with doas
|
|
|
|
|
2022-04-30 14:21:43 +00:00
|
|
|
{ user, ... }: {
|
2022-04-26 01:54:53 +00:00
|
|
|
|
2022-04-29 02:55:42 +00:00
|
|
|
security = {
|
2022-04-26 01:54:53 +00:00
|
|
|
|
2022-04-29 02:55:42 +00:00
|
|
|
# Remove sudo
|
|
|
|
sudo.enable = false;
|
2022-04-26 01:54:53 +00:00
|
|
|
|
2022-04-29 02:55:42 +00:00
|
|
|
# Add doas
|
|
|
|
doas = {
|
|
|
|
enable = true;
|
2022-04-26 01:54:53 +00:00
|
|
|
|
2022-04-29 02:55:42 +00:00
|
|
|
# No password required
|
|
|
|
wheelNeedsPassword = false;
|
2022-04-26 01:54:53 +00:00
|
|
|
|
2022-04-29 02:55:42 +00:00
|
|
|
# Pass environment variables from user to root
|
|
|
|
# Also requires removing password here
|
|
|
|
extraRules = [{
|
|
|
|
groups = [ "wheel" ];
|
|
|
|
noPass = true;
|
|
|
|
keepEnv = true;
|
|
|
|
}];
|
2022-04-26 01:54:53 +00:00
|
|
|
};
|
|
|
|
};
|
2022-04-30 14:21:43 +00:00
|
|
|
|
|
|
|
home-manager.users.${user}.programs.fish.shellAliases = { sudo = "doas"; };
|
2022-04-26 01:54:53 +00:00
|
|
|
}
|