refactor: DRY and reorganise modules
lib/default.nix — new shared helper
Add resolveFrom pkgSet names, a single implementation of the
"resolve package names against a set, warn and skip missing"
pattern that was copy-pasted four times. Update lib/USAGE.md
to document it.
Deduplicate resolvePackages / resolveKde (4 sites)
modules/packages.nix, modules/darwin/packages.nix,
modules/server/packages.nix, modules/desktop.nix all replace
their local copy with a one-liner:
resolvePackages = (import ../lib).resolveFrom pkgs;
flake.nix — extract three local helpers
sharedNixpkgsConfig — allowUnfree + vscode-extensions overlay,
was duplicated verbatim in nixosModules and
darwinModules
mkHMConfig { isDarwin, extraModules }
— 7-line home-manager block that differed only
in isDarwin and the platform-specific extra
modules; replaces two identical copies
mkUnstablePkgs system
— import nixpkgs-unstable { inherit system;
config.allowUnfree = true; }, was repeated
for server and server-arm
modules/options.nix — consistent type aliases
Add listInt and attrsInt alongside the existing listStr/nullStr.
Use them for allowedTCPPorts, allowedUDPPorts, and masApps (which
were still using the raw types.listOf int / types.attrsOf int forms).
hosts/server/default.nix — minor tidying
Collapse three separate services.logind.settings.Login.Handle*
assignments into a single attrset block.
Move server-only modules under modules/server/
caddy, cloudflare-tunnel, forgejo, grafana (+dashboard JSON),
immich, jellyfin, nextcloud, pds (+pds-landing/), split-dns all
move from modules/ root into modules/server/, co-located with the
existing server/* modules. Update ../secrets/ → ../../secrets/ in
the six files that reference secrets, and update all import paths
in hosts/server/default.nix accordingly. No behaviour change.