mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-24 06:15:38 +00:00
49 lines
891 B
Nix
49 lines
891 B
Nix
# Replace sudo with doas
|
|
|
|
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
{
|
|
|
|
config = lib.mkIf pkgs.stdenv.isLinux {
|
|
|
|
security = {
|
|
|
|
# Remove sudo
|
|
sudo.enable = false;
|
|
|
|
# Add doas
|
|
doas = {
|
|
enable = true;
|
|
|
|
# No password required for trusted users
|
|
wheelNeedsPassword = false;
|
|
|
|
# Pass environment variables from user to root
|
|
# Also requires specifying that we are removing password here
|
|
extraRules = [
|
|
{
|
|
groups = [ "wheel" ];
|
|
noPass = true;
|
|
keepEnv = true;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
|
|
home-manager.users.${config.user}.programs = {
|
|
|
|
# Alias sudo to doas for convenience
|
|
fish.shellAliases = {
|
|
sudo = "doas";
|
|
};
|
|
|
|
# Disable overriding our sudo alias with a TERMINFO alias
|
|
kitty.settings.shell_integration = "no-sudo";
|
|
};
|
|
};
|
|
}
|