mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-14 04:52:56 +00:00
37 lines
716 B
Nix
37 lines
716 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;
|
|
}];
|
|
};
|
|
};
|
|
|
|
# Alias sudo to doas for convenience
|
|
home-manager.users.${config.user}.programs.fish.shellAliases = {
|
|
sudo = "doas";
|
|
};
|
|
|
|
};
|
|
|
|
}
|