diff options
| author | Maximilian Bosch <maximilian@mbosch.me> | 2020-10-01 13:00:52 +0200 |
|---|---|---|
| committer | Maximilian Bosch <maximilian@mbosch.me> | 2020-10-01 13:00:52 +0200 |
| commit | d2dc0ae2033d1655a2011fc932bca5cd9c7bfe5b (patch) | |
| tree | 87f9fb44c80448232514ae26b44f1c2202e29a44 | |
| parent | Merge pull request #99245 from stigtsp/package/perl-imager-qrcode-init (diff) | |
| download | nixpkgs-d2dc0ae2033d1655a2011fc932bca5cd9c7bfe5b.tar.gz | |
nixos/sudo: add `package` option
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.
| -rw-r--r-- | nixos/modules/security/sudo.nix | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/nixos/modules/security/sudo.nix b/nixos/modules/security/sudo.nix index 1ed5269c5ae7..cc3ff3d11b91 100644 --- a/nixos/modules/security/sudo.nix +++ b/nixos/modules/security/sudo.nix @@ -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; @@ -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 ]; |
