From e50e3ff64e8bdb6477bcd9e77b3184cddefff784 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 19 Aug 2024 00:54:13 +0200 Subject: [PATCH] Force copying of Linux users to Windows --- lib/modules/users.nix | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/lib/modules/users.nix b/lib/modules/users.nix index aa4f24b3..f34b5b3c 100644 --- a/lib/modules/users.nix +++ b/lib/modules/users.nix @@ -91,23 +91,26 @@ windows.users = mkOption { type = types.attrsOf winUserType; description = "The users to create on the Windows machine."; - default = (lib.attrsets.concatMapAttrs ( - name: options: - if builtins.elem name (builtins.attrNames linuxOptions) - then {} - else { - ${capitalize name} = (lib.attrsets.concatMapAttrs ( - name: value: - if builtins.elem name (builtins.attrNames linuxOptions) - then {} - else { - ${name} = value; - } - ) options) // { - groups = []; - }; - }) cfg.users); }; }; }; + + config = { + valhalla.windows.users = (lib.attrsets.concatMapAttrs ( + name: options: + if builtins.elem name (builtins.attrNames linuxOptions) + then {} + else { + ${capitalize name} = (lib.attrsets.concatMapAttrs ( + name: value: + if builtins.elem name (builtins.attrNames linuxOptions) + then {} + else { + ${name} = value; + } + ) options) // { + groups = []; + }; + }) cfg.users); + }; }