about summary refs log tree commit diff
path: root/modules/doas.nix
blob: 262028bd6b7f1813717b2441ff4dee407751432d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{ pkgs, ... }:
{
  security.sudo.enable = false;
  security.doas = {
    enable = true;
    wheelNeedsPassword = false;
    extraRules = [{
      groups = [ "wheel" ];
      # keepEnv = true;
      # I need to set NIX_PATH explicitly, since my user and root use different paths
      setEnv = [ "NIX_PATH=nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels" ];
    }];
  };
  environment.shellAliases = {
    sudo = "doas";
  };
}