From 10b6e8ba218b188438d6bd702985601ddc7b14da Mon Sep 17 00:00:00 2001 From: nicoo Date: Thu, 31 Aug 2023 10:02:14 +0000 Subject: [PATCH] nixos/sudo: Guard against `security.sudo.package = pkgs.sudo-rs;` This is not unlikely to happen, given the enthusiasm shown by some users, but we are not there yet, and this will save them from breaking their system. --- nixos/modules/security/sudo.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/security/sudo.nix b/nixos/modules/security/sudo.nix index 9ac91bd0d36..d225442773c 100644 --- a/nixos/modules/security/sudo.nix +++ b/nixos/modules/security/sudo.nix @@ -192,6 +192,10 @@ in ###### implementation config = mkIf cfg.enable { + assertions = [ + { assertion = cfg.package.pname != "sudo-rs"; + message = "The NixOS `sudo` module does not work with `sudo-rs` yet."; } + ]; # We `mkOrder 600` so that the default rule shows up first, but there is # still enough room for a user to `mkBefore` it.