From cd14a37c8cc233692d79e7c4a2ca511c6383a3c4 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Wed, 11 Mar 2026 22:06:46 -0500 Subject: [PATCH] nhms works again --- modules/hosts/john-pc-ubuntu.nix | 4 +++ modules/nix-tools/user.nix | 12 ++------ modules/nixos/lxc.nix | 1 - modules/programs/zsh.nix | 7 +++-- modules/users/john.nix | 53 +++++++++++++++----------------- 5 files changed, 34 insertions(+), 43 deletions(-) diff --git a/modules/hosts/john-pc-ubuntu.nix b/modules/hosts/john-pc-ubuntu.nix index 3850003..9cf4256 100644 --- a/modules/hosts/john-pc-ubuntu.nix +++ b/modules/hosts/john-pc-ubuntu.nix @@ -1,5 +1,6 @@ { inputs, ... }: let + username = "john"; hostname = "john-pc-ubuntu"; in { @@ -20,6 +21,9 @@ in shell.program = "zsh"; + home.username = "${username}"; + home.homeDirectory = "/home/${username}"; + home.packages = with pkgs; [ nixos-rebuild (writeShellScriptBin "test-push" '' diff --git a/modules/nix-tools/user.nix b/modules/nix-tools/user.nix index 990fa7e..03de100 100644 --- a/modules/nix-tools/user.nix +++ b/modules/nix-tools/user.nix @@ -17,20 +17,12 @@ }; # https://github.com/Doc-Steve/dendritic-design-with-flake-parts/wiki/Dendritic_Aspects#multi-context-aspect home-manager.users."${username}" = { + home.username = "${username}"; + home.homeDirectory = "/home/${username}"; imports = [ self.modules.homeManager."${username}" - # self.modules.homeManager.shell-tools ]; }; }; - - homeManager."${username}" = { - home.username = "${username}"; - home.homeDirectory = "/home/${username}"; - # TODO: This doesn't get merged properly when the factory gets used - # imports = with self.modules.homeManager; [ - # shell-tools - # ]; - }; }; } \ No newline at end of file diff --git a/modules/nixos/lxc.nix b/modules/nixos/lxc.nix index 8af8b67..fb05a35 100644 --- a/modules/nixos/lxc.nix +++ b/modules/nixos/lxc.nix @@ -3,7 +3,6 @@ flake.modules.nixos.lxc = { pkgs, lib, ...}: { imports = with inputs.self.modules.nixos; [ ({ modulesPath, ... }: { imports = [ "${modulesPath}/virtualisation/proxmox-lxc.nix" ]; }) - ssh ]; nixpkgs.hostPlatform = lib.mkForce "x86_64-linux"; system.stateVersion = "25.11"; diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 6c7ad1c..caf4a4e 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -7,9 +7,10 @@ in nixos.zsh = { pkgs, ... }: { users.users."${username}".shell = pkgs.zsh; programs.zsh.enable = true; - home-manager.sharedModules = [ - inputs.self.modules.homeManager.zsh - ]; + # Already being imported by the john.nix module + # home-manager.sharedModules = [ + # inputs.self.modules.homeManager.zsh + # ]; }; homeManager.zsh = { pkgs, config, ... }: { diff --git a/modules/users/john.nix b/modules/users/john.nix index 2cc6457..53f8a52 100644 --- a/modules/users/john.nix +++ b/modules/users/john.nix @@ -1,4 +1,4 @@ -{ inputs, lib, ... }: +{ inputs, ... }: let username = "john"; in @@ -17,35 +17,30 @@ in ]; }; - modules = lib.recursiveUpdate - (inputs.self.factory.user username true) - { - # - # NixOS - # - nixos."${username}" = { - users.users."${username}" = { - openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys; - extraGroups = [ "docker" ]; - }; - }; - - # - # Home Manager - # - homeManager."${username}" = with inputs.self.meta.users."${username}"; { - home.stateVersion = "25.11"; - xdg.enable = true; - - programs.git.settings.user.name = name; - programs.git.settings.user.email = email; - - imports = with inputs.self.modules.homeManager; [ - ssh - shell-tools - git - ]; + modules = { + nixos."${username}" = { + imports = [ + (inputs.self.factory.user username true).nixos."${username}" + ]; + users.users."${username}" = { + openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys; + extraGroups = [ "docker" ]; }; }; + + homeManager."${username}" = with inputs.self.meta.users."${username}"; { + home.stateVersion = "25.11"; + xdg.enable = true; + + programs.git.settings.user.name = name; + programs.git.settings.user.email = email; + + imports = with inputs.self.modules.homeManager; [ + ssh + shell-tools + git + ]; + }; + }; }; }