Revert "refactor: cleanup and extract user config"

This reverts commit 8a14ad2ed5.
This commit is contained in:
2026-04-24 00:43:19 +02:00
parent 5e4b1fc930
commit 112fa1b006
7 changed files with 80 additions and 104 deletions
+60
View File
@@ -1,5 +1,57 @@
{ lib, ... }: { lib, ... }:
let 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 = { repo = {
contact.email = "mail@jelles.net"; contact.email = "mail@jelles.net";
@@ -130,5 +182,13 @@ in
readOnly = true; 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.repo = repo;
config.meta.lib.accounts = accounts;
} }
+2 -2
View File
@@ -4,7 +4,7 @@ let
homeModules = config.flake.modules.homeManager; homeModules = config.flake.modules.homeManager;
in in
{ {
flake.modules.nixos.workstation-base = { flake.modules.nixos.workstation = {
imports = [ imports = [
nixosModules.audio nixosModules.audio
nixosModules.bluetooth nixosModules.bluetooth
@@ -30,7 +30,7 @@ in
environment.localBinInPath = true; environment.localBinInPath = true;
}; };
flake.modules.homeManager.workstation-base = { flake.modules.homeManager.workstation = {
imports = [ imports = [
homeModules.ai homeModules.ai
homeModules.bitwarden homeModules.bitwarden
+5 -7
View File
@@ -7,15 +7,13 @@ let
nixosModules = config.flake.modules.nixos; nixosModules = config.flake.modules.nixos;
homeModules = config.flake.modules.homeManager; homeModules = config.flake.modules.homeManager;
metaLib = config.meta.lib; metaLib = config.meta.lib;
workstationHomeImports = [ homeModules.workstation-base ]; workstationHomeImports = [ homeModules.workstation ];
kiriHomeImports = workstationHomeImports ++ [ kiriHomeImports = workstationHomeImports ++ [
homeModules.kiri-workstation homeModules.syncthing
homeModules.noctalia homeModules.qbittorrent-client
];
ergonHomeImports = workstationHomeImports ++ [
homeModules.ergon-workstation
homeModules.noctalia homeModules.noctalia
]; ];
ergonHomeImports = workstationHomeImports ++ [ homeModules.noctalia ];
in in
{ {
flake.modules.nixos.polaris = metaLib.mkHost { flake.modules.nixos.polaris = metaLib.mkHost {
@@ -53,7 +51,7 @@ in
}; };
imports = [ imports = [
nixosModules.workstation-base nixosModules.workstation
nixosModules.steam nixosModules.steam
./_hardware.nix ./_hardware.nix
] ]
+13 -4
View File
@@ -7,15 +7,24 @@ let
nixosModules = config.flake.modules.nixos; nixosModules = config.flake.modules.nixos;
homeModules = config.flake.modules.homeManager; homeModules = config.flake.modules.homeManager;
metaLib = config.meta.lib; metaLib = config.meta.lib;
workstationHomeImports = [ homeModules.workstation-base ]; workstationHomeImports = [ homeModules.workstation ];
portableNoctalia = homeModules.noctalia-portable; portableNoctalia = homeModules.noctalia-portable;
kiriHomeImports = workstationHomeImports ++ [ kiriHomeImports = workstationHomeImports ++ [
homeModules.kiri-workstation homeModules.syncthing
homeModules.qbittorrent-client
portableNoctalia portableNoctalia
]; ];
ergonHomeImports = workstationHomeImports ++ [ ergonHomeImports = workstationHomeImports ++ [
homeModules.ergon-workstation
portableNoctalia portableNoctalia
(
{ pkgs, ... }:
{
home.packages = [
pkgs.rustup
pkgs.usql
];
}
)
]; ];
in in
{ {
@@ -62,7 +71,7 @@ in
}; };
imports = [ imports = [
nixosModules.workstation-base nixosModules.workstation
nixosModules.laptop-power nixosModules.laptop-power
{ {
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
-17
View File
@@ -361,23 +361,6 @@ in
readOnly = true; 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 = { config.meta.lib = {
inherit inherit
mkInputProfiles mkInputProfiles
-31
View File
@@ -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
];
};
}
-43
View File
@@ -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
];
};
}