36 lines
634 B
Nix
Raw Normal View History

2022-04-25 21:54:53 -04:00
# Replace sudo with doas
2022-12-21 14:18:03 -07:00
{ config, pkgs, lib, ... }: {
2022-04-25 21:54:53 -04:00
2022-12-21 14:18:03 -07:00
config = lib.mkIf pkgs.stdenv.isLinux {
2022-04-25 21:54:53 -04:00
2022-12-21 14:18:03 -07:00
security = {
2022-04-25 21:54:53 -04:00
2022-12-21 14:18:03 -07:00
# Remove sudo
sudo.enable = false;
2022-04-25 21:54:53 -04:00
2022-12-21 14:18:03 -07:00
# Add doas
doas = {
enable = true;
2022-04-25 21:54:53 -04:00
2022-12-21 14:18:03 -07:00
# No password required
wheelNeedsPassword = false;
# Pass environment variables from user to root
# Also requires removing password here
extraRules = [{
groups = [ "wheel" ];
noPass = true;
keepEnv = true;
}];
};
};
home-manager.users.${config.user}.programs.fish.shellAliases = {
sudo = "doas";
2022-04-25 21:54:53 -04:00
};
2022-04-30 10:21:43 -04:00
2022-04-30 12:07:58 -04:00
};
2022-12-21 14:18:03 -07:00
2022-04-25 21:54:53 -04:00
}