separated home-manager module for user config

This commit is contained in:
John Lancaster
2026-03-08 11:38:26 -05:00
parent 0c1e633aaa
commit 5d14d515e0
5 changed files with 50 additions and 29 deletions

View File

@@ -16,7 +16,6 @@
]; ];
}; };
flake.homeConfigurations.desktop = inputs.home-manager.lib.homeManagerConfiguration { flake.homeConfigurations.desktop = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
modules = with inputs.self.homeModules; [ modules = with inputs.self.homeModules; [

View File

@@ -1,30 +1,10 @@
{ inputs, self, ... }:
let
userName = "john";
in
{ {
flake.homeModules."${userName}" = { flake.homeModules.users.john = {
home.username = userName; home.username = "john";
home.homeDirectory = "/home/${userName}"; home.homeDirectory = "/home/john";
home.stateVersion = "25.11"; home.stateVersion = "25.11";
programs.git.settings.user.name = "John Lancaster"; programs.git.settings.user.name = "John Lancaster";
programs.git.settings.user.email = "32917998+jsl12@users.noreply.github.com"; programs.git.settings.user.email = "32917998+jsl12@users.noreply.github.com";
}; };
flake.modules.nixos.user =
{ pkgs, ... }:
{
users.users."${userName}" = {
name = "${userName}";
shell = pkgs.zsh;
};
programs.zsh.enable = true;
home-manager.users."${userName}" = {
imports = [
inputs.self.homeModules."${userName}"
];
};
};
} }

View File

@@ -1,5 +0,0 @@
{
flake.homeModules.onepassword = {
# TODO: Port `_1password = true` behavior into an explicit Home Manager module.
};
}

39
modules/users/john.nix Normal file
View File

@@ -0,0 +1,39 @@
{ inputs, ... }:
let
userName = "john";
in
{
flake.modules.nixos.user =
{ pkgs, ... }:
{
users.users."${userName}" = {
name = "${userName}";
shell = pkgs.zsh;
};
programs.zsh.enable = true;
home-manager.users."${userName}" = {
imports = [
inputs.self.homeModules."${userName}"
];
};
};
flake.homeConfigurations.${userName} = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
modules = [
inputs.self.homeModules.users."${userName}"
# Include another inline module to set the options created through the jsl-home modules
{
homeManagerFlakeDir = "~/.config/home-manager";
docker.enable = true;
ssh.matchSets = {
certs = true;
appdaemon = true;
homelab = true;
};
}
];
};
}

8
modules/users/sydney.nix Normal file
View File

@@ -0,0 +1,8 @@
{ inputs, self, ... }:
let
userName = "sydney";
in
{
flake.homeModules."${userName}" = {
};
}