Skip to content

Commit

Permalink
nixos/sudo: add package option
Browse files Browse the repository at this point in the history
The `package`-option is always useful if modifying a package in an
overlay would mean that a lot of other packages need to be rebuilt as
well.

In case of `sudo` this is actually the case: when having an override for
it (e.g. for `withInsults = true;`), you'd have to rebuild e.g. `zfs`
and `grub` although that's not strictly needed.
  • Loading branch information
Ma27 committed Oct 1, 2020
1 parent 25666f9 commit d2dc0ae
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions nixos/modules/security/sudo.nix
Expand Up @@ -42,6 +42,15 @@ in
'';
};

security.sudo.package = mkOption {
type = types.package;
default = pkgs.sudo;
defaultText = "pkgs.sudo";
description = ''
Which package to use for `sudo`.
'';
};

security.sudo.wheelNeedsPassword = mkOption {
type = types.bool;
default = true;
Expand Down Expand Up @@ -208,8 +217,8 @@ in
'';

security.wrappers = {
sudo.source = "${pkgs.sudo.out}/bin/sudo";
sudoedit.source = "${pkgs.sudo.out}/bin/sudoedit";
sudo.source = "${cfg.package.out}/bin/sudo";
sudoedit.source = "${cfg.package.out}/bin/sudoedit";
};

environment.systemPackages = [ sudo ];
Expand Down

0 comments on commit d2dc0ae

Please sign in to comment.