diff --git a/logins/default.nix b/logins/default.nix index dfd27759..0493ca83 100644 --- a/logins/default.nix +++ b/logins/default.nix @@ -11,6 +11,11 @@ in wireguardDevices: adminConfig: wireguardDevices ++ (if adminConfig ? "wireguardDevices" then adminConfig.wireguardDevices else [ ]) ) [ ] (lib.attrsets.attrValues admins); + sshPubKeys = lib.lists.foldl ( + sshPubKeys: adminConfig: + sshPubKeys + ++ (if adminConfig ? "sshPubKeys" then lib.attrsets.attrValues adminConfig.sshPubKeys else [ ]) + ) [ ] (lib.attrsets.attrValues admins); robots.sshPubKeys = lib.attrsets.attrValues robots; }; }; diff --git a/modules/core/default.nix b/modules/core/default.nix index 64d4c765..f0914fdc 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -54,9 +54,5 @@ }; time.timeZone = "Etc/UTC"; - - home-manager.users.${config.pub-solar-os.authentication.username} = { - home.stateVersion = "23.05"; - }; }; } diff --git a/modules/core/terminal-tooling.nix b/modules/core/terminal-tooling.nix index 823898a1..dd0a82fd 100644 --- a/modules/core/terminal-tooling.nix +++ b/modules/core/terminal-tooling.nix @@ -1,19 +1,27 @@ -{ flake, config, ... }: +{ flake, lib, ... }: { - home-manager.users.${config.pub-solar-os.authentication.username} = { - programs.git.enable = true; - programs.starship.enable = true; - programs.bash.enable = true; - programs.neovim = { - enable = true; - vimAlias = true; - viAlias = true; - defaultEditor = true; - # configure = { - # packages.myVimPackages = with pkgs.vimPlugins; { - # start = [vim-nix vim-surrund rainbow]; - # }; - # }; - }; - }; + home-manager.users = ( + lib.attrsets.foldlAttrs ( + acc: name: value: + acc + // { + ${name} = { + programs.git.enable = true; + programs.starship.enable = true; + programs.bash.enable = true; + programs.neovim = { + enable = true; + vimAlias = true; + viAlias = true; + defaultEditor = true; + # configure = { + # packages.myVimPackages = with pkgs.vimPlugins; { + # start = [vim-nix vim-surrund rainbow]; + # }; + # }; + }; + }; + } + ) { } flake.self.logins.admins + ); } diff --git a/modules/core/users.nix b/modules/core/users.nix index f296c85b..d3a1cfc4 100644 --- a/modules/core/users.nix +++ b/modules/core/users.nix @@ -50,7 +50,7 @@ ) { } flake.self.logins.admins) // { # TODO: Remove when we stop locking ourselves out. - root.openssh.authorizedKeys.keys = config.pub-solar-os.authentication.sshPubKeys; + root.openssh.authorizedKeys.keys = flake.self.logins.sshPubKeys; root.initialHashedPassword = config.pub-solar-os.authentication.root.initialHashedPassword; ${config.pub-solar-os.authentication.robot.username} = { @@ -65,6 +65,18 @@ }; }; + home-manager.users = ( + lib.attrsets.foldlAttrs ( + acc: name: value: + acc + // { + ${name} = { + home.stateVersion = "23.05"; + }; + } + ) { } flake.self.logins.admins + ); + users.groups = (lib.attrsets.foldlAttrs ( acc: name: value: diff --git a/modules/unlock-luks-on-boot/default.nix b/modules/unlock-luks-on-boot/default.nix index 09521880..fd8c547f 100644 --- a/modules/unlock-luks-on-boot/default.nix +++ b/modules/unlock-luks-on-boot/default.nix @@ -10,7 +10,7 @@ # Please create this manually the first time. hostKeys = [ "/etc/secrets/initrd/ssh_host_ed25519_key" ]; - authorizedKeys = config.pub-solar-os.authentication.sshPubKeys; + authorizedKeys = flake.self.logins.sshPubKeys; }; postCommands = '' # Automatically ask for the password on SSH login diff --git a/modules/unlock-zfs-on-boot/default.nix b/modules/unlock-zfs-on-boot/default.nix index 2e68b398..586f9440 100644 --- a/modules/unlock-zfs-on-boot/default.nix +++ b/modules/unlock-zfs-on-boot/default.nix @@ -11,7 +11,7 @@ # Please create this manually the first time. hostKeys = [ "/etc/secrets/initrd/ssh_host_ed25519_key" ]; - authorizedKeys = config.pub-solar-os.authentication.sshPubKeys; + authorizedKeys = flake.self.logins.sshPubKeys; }; # this will automatically load the zfs password prompt on login # and kill the other prompt so boot can continue diff --git a/tests/keycloak.nix b/tests/keycloak.nix index 5e735fd6..59b085a1 100644 --- a/tests/keycloak.nix +++ b/tests/keycloak.nix @@ -66,7 +66,7 @@ in testScript = { nodes, ... }: let - user = nodes.client.users.users.${nodes.client.pub-solar-os.authentication.username}; + user = nodes.client.users.users.b12f; #uid = toString user.uid; bus = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u ${user.name})/bus"; gdbus = "${bus} gdbus"; diff --git a/tests/support/client.nix b/tests/support/client.nix index 41e97f09..c34c847c 100644 --- a/tests/support/client.nix +++ b/tests/support/client.nix @@ -11,7 +11,7 @@ services.xserver.displayManager.gdm.enable = true; services.xserver.desktopManager.gnome.enable = true; services.xserver.displayManager.autoLogin.enable = true; - services.xserver.displayManager.autoLogin.user = config.pub-solar-os.authentication.username; + services.xserver.displayManager.autoLogin.user = "b12f"; systemd.user.services = { "org.gnome.Shell@wayland" = {