From 16712777dc6f87e9327cb4728e894b9574cae02f Mon Sep 17 00:00:00 2001 From: Jelle Spreeuwenberg Date: Sat, 25 Apr 2026 01:28:28 +0200 Subject: [PATCH] refactor: extract users --- modules/data.nix | 64 -------------------------------- modules/features/dev-tools.nix | 9 +++++ modules/hosts/zenith/default.nix | 21 +---------- modules/lib/helpers.nix | 6 ++- modules/users/ergon.nix | 20 ++++++++++ modules/users/kiri.nix | 39 +++++++++++++++++++ 6 files changed, 74 insertions(+), 85 deletions(-) create mode 100644 modules/users/ergon.nix create mode 100644 modules/users/kiri.nix diff --git a/modules/data.nix b/modules/data.nix index 7668c7e..59aeae3 100644 --- a/modules/data.nix +++ b/modules/data.nix @@ -1,69 +1,5 @@ -{ - config, - ... -}: -let - homeModules = config.flake.modules.homeManager; -in { repo = { - accounts = { - kiri = { - realName = "Jelle Spreeuwenberg"; - workstationModule = { - imports = [ - homeModules.workstation-base - homeModules.syncthing - homeModules.qbittorrent-client - ]; - }; - emails = { - personal = { - address = "mail@jelles.net"; - primary = true; - scope = "personal"; - type = "mxrouting"; - }; - old = { - address = "mail@jellespreeuwenberg.nl"; - scope = null; - type = "mxrouting"; - }; - uni = { - address = "j.spreeuwenberg@student.tue.nl"; - scope = null; - type = "office365"; - }; - work = { - address = "jelle.spreeuwenberg@yookr.org"; - scope = "work"; - type = "office365"; - }; - }; - }; - - ergon = { - realName = "Jelle Spreeuwenberg"; - sourceControl.projectScope = "work"; - workstationModule = { - imports = [ homeModules.workstation-base ]; - }; - emails = { - personal = { - address = "mail@jelles.net"; - scope = "personal"; - type = "mxrouting"; - }; - work = { - address = "jelle.spreeuwenberg@yookr.org"; - primary = true; - scope = "work"; - type = "office365"; - }; - }; - }; - }; - contact.email = "mail@jelles.net"; desktop = { diff --git a/modules/features/dev-tools.nix b/modules/features/dev-tools.nix index 6915033..f7a9f90 100644 --- a/modules/features/dev-tools.nix +++ b/modules/features/dev-tools.nix @@ -7,6 +7,7 @@ devenv httpie bruno + usql ]; programs.direnv = { @@ -24,5 +25,13 @@ programs.bun.enable = true; programs.ripgrep.enable = true; programs.uv.enable = true; + + programs.git.ignores = [ + "devenv.*" + ".devenv*" + ".direnv" + "pre-commit-config.yaml" + ".envrc" + ]; }; } diff --git a/modules/hosts/zenith/default.nix b/modules/hosts/zenith/default.nix index 0672543..a344747 100644 --- a/modules/hosts/zenith/default.nix +++ b/modules/hosts/zenith/default.nix @@ -52,25 +52,6 @@ in inputs.nixos-hardware.nixosModules.lenovo-yoga-7-14ARH7-amdgpu ]; - home-manager.users = { - kiri.imports = [ homeModules.noctalia-portable ]; - ergon.imports = [ - homeModules.noctalia-portable - ( - { pkgs, ... }: - { - home.packages = [ pkgs.usql ]; - - programs.git.ignores = [ - "devenv.*" - ".devenv*" - ".direnv" - "pre-commit-config.yaml" - ".envrc" - ]; - } - ) - ]; - }; + home-manager.sharedModules = [ homeModules.noctalia-portable ]; }; } diff --git a/modules/lib/helpers.nix b/modules/lib/helpers.nix index f17ec19..ddc136e 100644 --- a/modules/lib/helpers.nix +++ b/modules/lib/helpers.nix @@ -1,6 +1,7 @@ { lib, config, ... }: let nixosModules = config.flake.modules.nixos; + hmModules = config.flake.modules.homeManager; resolvePackagePath = { @@ -91,7 +92,10 @@ let }) machine.users; home-manager.users = lib.mapAttrs (_: user: { - imports = [ user.account.workstationModule ]; + imports = [ + hmModules.workstation-base + user.account.workstationModule + ]; }) machine.users; }; in diff --git a/modules/users/ergon.nix b/modules/users/ergon.nix new file mode 100644 index 0000000..27a0d54 --- /dev/null +++ b/modules/users/ergon.nix @@ -0,0 +1,20 @@ +{ config, ... }: +{ + repo.accounts.ergon = { + realName = "Jelle Spreeuwenberg"; + sourceControl.projectScope = "work"; + emails = { + personal = { + address = "mail@jelles.net"; + scope = "personal"; + type = "mxrouting"; + }; + work = { + address = "jelle.spreeuwenberg@yookr.org"; + primary = true; + scope = "work"; + type = "office365"; + }; + }; + }; +} diff --git a/modules/users/kiri.nix b/modules/users/kiri.nix new file mode 100644 index 0000000..e3255dc --- /dev/null +++ b/modules/users/kiri.nix @@ -0,0 +1,39 @@ +{ config, ... }: +let + hmModules = config.flake.modules.homeManager; +in +{ + repo.accounts.kiri = { + realName = "Jelle Spreeuwenberg"; + workstationModule = { + imports = [ + hmModules.syncthing + hmModules.qbittorrent-client + ]; + }; + emails = { + personal = { + address = "mail@jelles.net"; + primary = true; + scope = "personal"; + type = "mxrouting"; + }; + old = { + address = "mail@jellespreeuwenberg.nl"; + scope = null; + type = "mxrouting"; + }; + uni = { + address = "j.spreeuwenberg@student.tue.nl"; + scope = null; + type = "office365"; + }; + work = { + address = "jelle.spreeuwenberg@yookr.org"; + scope = "work"; + type = "office365"; + }; + }; + }; + +}