From 112fa1b006a6a064c48d8521bca2b49884f45f15 Mon Sep 17 00:00:00 2001 From: Jelle Spreeuwenberg Date: Fri, 24 Apr 2026 00:43:19 +0200 Subject: [PATCH] Revert "refactor: cleanup and extract user config" This reverts commit 8a14ad2ed50a8452ed44cae750db6618d559bc25. --- modules/data.nix | 60 +++++++++++++++++++++++++++ modules/features/workstation-base.nix | 4 +- modules/hosts/polaris/default.nix | 12 +++--- modules/hosts/zenith/default.nix | 17 ++++++-- modules/lib.nix | 17 -------- modules/users/ergon.nix | 31 -------------- modules/users/kiri.nix | 43 ------------------- 7 files changed, 80 insertions(+), 104 deletions(-) delete mode 100644 modules/users/ergon.nix delete mode 100644 modules/users/kiri.nix diff --git a/modules/data.nix b/modules/data.nix index 8416ab6..50f96f1 100644 --- a/modules/data.nix +++ b/modules/data.nix @@ -1,5 +1,57 @@ { lib, ... }: let + userSpecs = { + kiri = { + realName = "Jelle Spreeuwenberg"; + homeDirectory = "/home/kiri"; + 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"; + }; + }; + sourceControl = { }; + }; + + ergon = { + realName = "Jelle Spreeuwenberg"; + homeDirectory = "/home/ergon"; + emails = { + personal = { + address = "mail@jelles.net"; + scope = "personal"; + type = "mxrouting"; + }; + work = { + address = "jelle.spreeuwenberg@yookr.org"; + primary = true; + scope = "work"; + type = "office365"; + }; + }; + sourceControl.projectScope = "work"; + }; + }; + + accounts = lib.mapAttrs (name: spec: spec // { inherit name; }) userSpecs; + repo = { contact.email = "mail@jelles.net"; @@ -130,5 +182,13 @@ in readOnly = true; }; + options.meta.lib.accounts = lib.mkOption { + type = lib.types.attrs; + description = "Canonical account attrsets shared by host definitions."; + internal = true; + readOnly = true; + }; + config.meta.lib.repo = repo; + config.meta.lib.accounts = accounts; } diff --git a/modules/features/workstation-base.nix b/modules/features/workstation-base.nix index c462e5e..656ec9b 100644 --- a/modules/features/workstation-base.nix +++ b/modules/features/workstation-base.nix @@ -4,7 +4,7 @@ let homeModules = config.flake.modules.homeManager; in { - flake.modules.nixos.workstation-base = { + flake.modules.nixos.workstation = { imports = [ nixosModules.audio nixosModules.bluetooth @@ -30,7 +30,7 @@ in environment.localBinInPath = true; }; - flake.modules.homeManager.workstation-base = { + flake.modules.homeManager.workstation = { imports = [ homeModules.ai homeModules.bitwarden diff --git a/modules/hosts/polaris/default.nix b/modules/hosts/polaris/default.nix index 2ad140f..2886a24 100644 --- a/modules/hosts/polaris/default.nix +++ b/modules/hosts/polaris/default.nix @@ -7,15 +7,13 @@ let nixosModules = config.flake.modules.nixos; homeModules = config.flake.modules.homeManager; metaLib = config.meta.lib; - workstationHomeImports = [ homeModules.workstation-base ]; + workstationHomeImports = [ homeModules.workstation ]; kiriHomeImports = workstationHomeImports ++ [ - homeModules.kiri-workstation - homeModules.noctalia - ]; - ergonHomeImports = workstationHomeImports ++ [ - homeModules.ergon-workstation + homeModules.syncthing + homeModules.qbittorrent-client homeModules.noctalia ]; + ergonHomeImports = workstationHomeImports ++ [ homeModules.noctalia ]; in { flake.modules.nixos.polaris = metaLib.mkHost { @@ -53,7 +51,7 @@ in }; imports = [ - nixosModules.workstation-base + nixosModules.workstation nixosModules.steam ./_hardware.nix ] diff --git a/modules/hosts/zenith/default.nix b/modules/hosts/zenith/default.nix index 64c2c75..d90b317 100644 --- a/modules/hosts/zenith/default.nix +++ b/modules/hosts/zenith/default.nix @@ -7,15 +7,24 @@ let nixosModules = config.flake.modules.nixos; homeModules = config.flake.modules.homeManager; metaLib = config.meta.lib; - workstationHomeImports = [ homeModules.workstation-base ]; + workstationHomeImports = [ homeModules.workstation ]; portableNoctalia = homeModules.noctalia-portable; kiriHomeImports = workstationHomeImports ++ [ - homeModules.kiri-workstation + homeModules.syncthing + homeModules.qbittorrent-client portableNoctalia ]; ergonHomeImports = workstationHomeImports ++ [ - homeModules.ergon-workstation portableNoctalia + ( + { pkgs, ... }: + { + home.packages = [ + pkgs.rustup + pkgs.usql + ]; + } + ) ]; in { @@ -62,7 +71,7 @@ in }; imports = [ - nixosModules.workstation-base + nixosModules.workstation nixosModules.laptop-power { hardware.enableRedistributableFirmware = true; diff --git a/modules/lib.nix b/modules/lib.nix index 3b68897..f69efa4 100644 --- a/modules/lib.nix +++ b/modules/lib.nix @@ -361,23 +361,6 @@ in readOnly = true; }; - options.meta.lib.accounts = lib.mkOption { - type = lib.types.attrs; - default = { }; - apply = lib.mapAttrs ( - name: account: - let - accountName = account.name or name; - in - account - // { - name = accountName; - } - ); - description = "Canonical account attrsets shared by host definitions."; - internal = true; - }; - config.meta.lib = { inherit mkInputProfiles diff --git a/modules/users/ergon.nix b/modules/users/ergon.nix deleted file mode 100644 index 1dcc986..0000000 --- a/modules/users/ergon.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - ... -}: -{ - meta.lib.accounts.ergon = { - realName = "Jelle Spreeuwenberg"; - emails = { - personal = { - address = "mail@jelles.net"; - scope = "personal"; - type = "mxrouting"; - }; - work = { - address = "jelle.spreeuwenberg@yookr.org"; - primary = true; - scope = "work"; - type = "office365"; - }; - }; - sourceControl.projectScope = "work"; - }; - - flake.modules.homeManager.ergon-workstation = - { pkgs, ... }: - { - home.packages = [ - pkgs.rustup - pkgs.usql - ]; - }; -} diff --git a/modules/users/kiri.nix b/modules/users/kiri.nix deleted file mode 100644 index d6b8f98..0000000 --- a/modules/users/kiri.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - config, - ... -}: -let - homeModules = config.flake.modules.homeManager; -in -{ - meta.lib.accounts.kiri = { - realName = "Jelle Spreeuwenberg"; - 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"; - }; - }; - sourceControl = { }; - }; - - flake.modules.homeManager.kiri-workstation = { - imports = [ - homeModules.syncthing - homeModules.qbittorrent-client - ]; - }; -}