git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commitd2dc0ae2033d1655a2011fc932bca5cd9c7bfe5b authorMaximilian Bosch <maximilian@mbosch.me> dateThu 1 Oct 2020, 13:00 (6 years ago) parent25666f9
1 file changed+11−2
nixos/modules/security/sudo.nix+11−2
nixos/modules/security/sudo.nix+11−2
@@ -42,6 +42,15 @@ in
4242 '';
4343 };
4444
45+ security.sudo.package = mkOption {
46+ type = types.package;
47+ default = pkgs.sudo;
48+ defaultText = "pkgs.sudo";
49+ description = ''
50+ Which package to use for `sudo`.
51+ '';
52+ };
53+
4554 security.sudo.wheelNeedsPassword = mkOption {
4655 type = types.bool;
4756 default = true;
@@ -208,8 +217,8 @@ in
208217 '';
209218
210219 security.wrappers = {
211− sudo.source = "${pkgs.sudo.out}/bin/sudo";
212− sudoedit.source = "${pkgs.sudo.out}/bin/sudoedit";
220+ sudo.source = "${cfg.package.out}/bin/sudo";
221+ sudoedit.source = "${cfg.package.out}/bin/sudoedit";
213222 };
214223
215224 environment.systemPackages = [ sudo ];