From 656211888bc661adaa75473417bc6895509bf1e9 Mon Sep 17 00:00:00 2001 From: b12f Date: Tue, 12 Nov 2024 20:30:03 +0100 Subject: [PATCH] style: run nix fmt --- logins/default.nix | 9 +++--- modules/core/users.nix | 70 ++++++++++++++++++++++-------------------- 2 files changed, 41 insertions(+), 38 deletions(-) diff --git a/logins/default.nix b/logins/default.nix index 65de0a7..dfd2775 100644 --- a/logins/default.nix +++ b/logins/default.nix @@ -7,11 +7,10 @@ in flake = { logins = { admins = admins; - wireguardDevices = - lib.lists.foldl - (wireguardDevices: adminConfig: wireguardDevices ++ (if adminConfig ? "wireguardDevices" then adminConfig.wireguardDevices else [ ])) - [ ] - (lib.attrsets.attrValues admins); + wireguardDevices = lib.lists.foldl ( + wireguardDevices: adminConfig: + wireguardDevices ++ (if adminConfig ? "wireguardDevices" then adminConfig.wireguardDevices else [ ]) + ) [ ] (lib.attrsets.attrValues admins); robots.sshPubKeys = lib.attrsets.attrValues robots; }; }; diff --git a/modules/core/users.nix b/modules/core/users.nix index b0b4357..f296c85 100644 --- a/modules/core/users.nix +++ b/modules/core/users.nix @@ -31,42 +31,46 @@ }; config = { - users.users = (lib.attrsets.foldlAttrs - (acc: name: value: acc // { ${name} = { - name = name; - group = name; - extraGroups = [ - "wheel" - "docker" - ]; - isNormalUser = true; - openssh.authorizedKeys.keys = lib.attrsets.attrValues value.sshPubKeys; + users.users = + (lib.attrsets.foldlAttrs ( + acc: name: value: + acc + // { + ${name} = { + name = name; + group = name; + extraGroups = [ + "wheel" + "docker" + ]; + isNormalUser = true; + openssh.authorizedKeys.keys = lib.attrsets.attrValues value.sshPubKeys; + }; + } + ) { } flake.self.logins.admins) + // { + # TODO: Remove when we stop locking ourselves out. + root.openssh.authorizedKeys.keys = config.pub-solar-os.authentication.sshPubKeys; + root.initialHashedPassword = config.pub-solar-os.authentication.root.initialHashedPassword; + + ${config.pub-solar-os.authentication.robot.username} = { + description = "CI and automation user"; + home = "/home/${config.pub-solar-os.authentication.robot.username}"; + createHome = true; + useDefaultShell = true; + uid = 998; + group = "${config.pub-solar-os.authentication.robot.username}"; + isSystemUser = true; + openssh.authorizedKeys.keys = config.pub-solar-os.authentication.robot.sshPubKeys; }; - }) - { } - flake.self.logins.admins) - // { - # TODO: Remove when we stop locking ourselves out. - root.openssh.authorizedKeys.keys = config.pub-solar-os.authentication.sshPubKeys; - root.initialHashedPassword = config.pub-solar-os.authentication.root.initialHashedPassword; - - ${config.pub-solar-os.authentication.robot.username} = { - description = "CI and automation user"; - home = "/home/${config.pub-solar-os.authentication.robot.username}"; - createHome = true; - useDefaultShell = true; - uid = 998; - group = "${config.pub-solar-os.authentication.robot.username}"; - isSystemUser = true; - openssh.authorizedKeys.keys = config.pub-solar-os.authentication.robot.sshPubKeys; }; - }; - users.groups = (lib.attrsets.foldlAttrs - (acc: name: value: acc // { "${name}" = { }; }) - { } - flake.self.logins.admins) - // { + users.groups = + (lib.attrsets.foldlAttrs ( + acc: name: value: + acc // { "${name}" = { }; } + ) { } flake.self.logins.admins) + // { ${config.pub-solar-os.authentication.robot.username} = { }; };