From b87850d1d5dab3a0cd7c5e69073570ab4507778a Mon Sep 17 00:00:00 2001 From: nikstur Date: Fri, 2 Aug 2024 15:02:59 +0200 Subject: [PATCH 1/3] nixos/etc: remove assertion --- nixos/modules/system/etc/etc-activation.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/nixos/modules/system/etc/etc-activation.nix b/nixos/modules/system/etc/etc-activation.nix index f47fd771c659..8108bdf6c9fa 100644 --- a/nixos/modules/system/etc/etc-activation.nix +++ b/nixos/modules/system/etc/etc-activation.nix @@ -26,13 +26,6 @@ assertion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.6"; message = "`system.etc.overlay.enable requires a newer kernel, at least version 6.6"; } - { - assertion = config.systemd.sysusers.enable -> (config.users.mutableUsers == config.system.etc.overlay.mutable); - message = '' - When using systemd-sysusers and mounting `/etc` via an overlay, users - can only be mutable when `/etc` is mutable and vice versa. - ''; - } ]; boot.initrd.availableKernelModules = [ "loop" "erofs" "overlay" ]; From 447c12c4f0d22f889961e232ab25c6523f161e51 Mon Sep 17 00:00:00 2001 From: nikstur Date: Fri, 2 Aug 2024 15:46:14 +0200 Subject: [PATCH 2/3] nixos/system-sysusers: include username in assertion --- nixos/modules/system/boot/systemd/sysusers.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/system/boot/systemd/sysusers.nix b/nixos/modules/system/boot/systemd/sysusers.nix index 8d401436daa1..9dfbcb65326e 100644 --- a/nixos/modules/system/boot/systemd/sysusers.nix +++ b/nixos/modules/system/boot/systemd/sysusers.nix @@ -73,9 +73,9 @@ in message = "config.users.mutableUsers requires config.system.etc.overlay.enable."; } ] ++ (lib.mapAttrsToList - (_username: opts: { + (username: opts: { assertion = !opts.isNormalUser; - message = "systemd-sysusers doesn't create normal users. You can currently only use it to create system users."; + message = "${username} is a normal user. systemd-sysusers doesn't create normal users, only system users."; }) userCfg.users) ++ lib.mapAttrsToList From 57e7129b3a156858a37c94b2af3fda2634d9aaac Mon Sep 17 00:00:00 2001 From: nikstur Date: Mon, 5 Aug 2024 16:24:47 +0200 Subject: [PATCH 3/3] nixos/systemd-sysusers: remove assertion --- nixos/modules/system/boot/systemd/sysusers.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nixos/modules/system/boot/systemd/sysusers.nix b/nixos/modules/system/boot/systemd/sysusers.nix index 9dfbcb65326e..e3dfe52e741b 100644 --- a/nixos/modules/system/boot/systemd/sysusers.nix +++ b/nixos/modules/system/boot/systemd/sysusers.nix @@ -68,10 +68,6 @@ in assertion = config.system.activationScripts.users == ""; message = "system.activationScripts.users has to be empty to use systemd-sysusers"; } - { - assertion = config.users.mutableUsers -> config.system.etc.overlay.enable; - message = "config.users.mutableUsers requires config.system.etc.overlay.enable."; - } ] ++ (lib.mapAttrsToList (username: opts: { assertion = !opts.isNormalUser;