Skip to content

refactor: untangle modules, home layout and lib plumbing - #104

Merged
redyf merged 11 commits into
mainfrom
refactor/untangle
Nov 11, 2026
Merged

redyf merged 11 commits into
mainfrom
refactor/untangle

Conversation

@redyf

@redyf redyf commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

What

Every NixOS module (modules/**.nix) and Home Manager module (home/**/default.nix) now declares its own enable option at the path matching its file and gates only on it. modules/default.nix and home/default.nix import every module automatically (lib/modules-in.nix), so a new module is one file.

  • Removed the category-level enable switches, the per-directory default.nix option/import lists, and the Home Manager root-level pseudo options (brave.enable, fonts.enable, git.*, ...). Group defaults moved to profiles/home/common.nix.
  • lib/hosts.nix normalizes hosts/*/meta.nix once; lib/default.nix returns the finished nixosConfigurations / homeConfigurations. Unused overlays, modules, roles and path parameters are gone.
  • home/users/ -> users/, home/hosts/<h>.nix -> hosts/<h>/home.nix, so home/ only holds modules.
  • theme.nix is the single source for scheme/cursor/polarity/terminal size and the monospace font; the default browser is one option (myConfig.system.environment.defaultBrowser).
  • Dead code, restating comments, commented-out code and no-op defaults removed. The alternate tmux/starship/ghostty themes are untouched.

Follow-up commits

  • docs(readme): new "Extending the config" section (add a module, package, host or user) and a list of the dependencies between the NixOS and Home Manager layers.
  • fix(selene): hardware-configuration.nix regenerated on the real laptop (it came from a VM: virtio, kvm-intel, no nvme). Now includes nvme, kvm-amd, not-detected.nix and AMD microcode updates.
  • refactor(pkgs): packages moved to pkgs/<name>/package.nix, exposed as overlays.default (applied by mkHost and mkHome) and as the packages output. Modules now use pkgs.inkdrop and pkgs.artix-experimental-launcher. Also fixes real-vnc-viewer, which never evaluated.
  • chore: remove the finished docs/architecture-plan.md and the redundant EF02 partition from the desktop's disko.nix (EFI-only GRUB; existing installs are unaffected because enableConfig = false).
  • refactor(home): remove the cymbal Home Manager module (the package stays in pkgs/).
  • fix(serpantinum): link sqlite into serpantinum-core; the same fix as 15871ea on main, which this branch did not have yet. Merging main is clean.
  • chore(redyf): disable minecraft. modrinth-app depends on turbo, and turbo-unwrapped 2.11.7 in the current nixpkgs fails to build (zstd-sys needs pkg-config/zstd, which the package does not declare).
  • refactor(theme): one monospace font (MonoLisa) in theme.nix, read by both Stylix modules; ghostty, serpantinum, noctalia and wofi take it from Stylix instead of hardcoding their own.
  • refactor(theme): starship (Stylix target enabled, unused mocha palette dropped), hyprland borders and the wofi stylesheet use the Stylix palette. The unused duplicate wofi/themes/catppuccin-macchiato.css is removed. tmux already used the Stylix palette.
  • fix(desktop): the desktop monitors are described once per display protocol. Wayland (hyprland, sway) is in hosts/desktop/home.nix; the i3 backup uses a single xrandr line in configuration.nix. Removed the conflicting DP-0 autorandr profile (180 Hz vs 165 Hz in displaySetup), the outputs hardcoded in the shared sway module and noctalia's stale DP-3 wallpaper entry.

Behavior changes

  • The empty xboxusers group no longer exists.
  • example no longer gets the Hyprland screenshot scripts (Hyprland sub-files are now gated).
  • The CTRL+Print / grim -o DP-1 bind moved to the desktop host, so selene no longer has it.
  • Fixed the swapped down/right focus binds in Hyprland.
  • selene: the regenerated hardware config adds AMD microcode and the right initrd modules, so it changes the initrd.
  • NixOS Stylix monospace font: TX-02 -> MonoLisa (GTK/Qt and system apps).
  • The starship prompt colours come from the Stylix palette instead of the terminal's ANSI colours.
  • wofi loses the Catppuccin crust/mantle shades, which the base16 scheme does not have: the window background is base00 and the search field base01. The selection gradient has 14 palette stops instead of 20 hand-mixed rgba values.
  • desktop: autorandr is no longer enabled (no host enables myConfig.services.autorandr now). The i3 xrandr line uses the integrated-GPU names (DP-1, HDMI-2) and now also sets up the rotated secondary monitor.
  • sway: CTRL+Print / grim -o DP-1 moved to the desktop host; selene relies on sway auto-detecting eDP-1.

Verification

  • nix flake check passes.
  • Compared derivations before/after for desktop, selene, example and the three Home Manager configs, also with every option switched on. Installed package sets are identical apart from the example screenshot scripts; remaining diffs are the items above, the nix registry (dirty-tree noise) and package ordering.
  • nh os test on selene built and activated the first commit of this branch. The hardware config and pkgs/ commits were checked with nix flake check and derivation comparison, not yet activated.
  • nh os switch and nh home switch on desktop built and activated everything up to chore(redyf): disable minecraft. The theme and monitor commits were checked with nix flake check and by evaluating the resulting fonts, colours and xrandr line, not yet activated.

Not done

  • Modules enabled nowhere stay on purpose: they are fallbacks or optional apps (sway, noctalia, caelestia, rofi, foot, ...). The alternate tmux/starship/ghostty themes are also kept.
  • The X11 output name HDMI-2 is inferred from the kernel connector HDMI-A-2 and is untested in i3.
  • The desktop monitor layout is for the integrated GPU while the NVIDIA card is away; the NVIDIA layout (DP-3 / HDMI-A-3 @144) is in 5fe5f91.
  • noctalia's fontDefault (UI font) is still JetBrainsMono Nerd Font.

redyf added 11 commits November 9, 2026 23:16
Each NixOS module (modules/**.nix) and Home Manager module (home/**/default.nix)
now declares its own `enable` option at the path matching its file and gates
only on it. modules/default.nix and home/default.nix import every module
automatically (lib/modules-in.nix), so adding a module touches one file.

- Remove the category-level `enable` switches and the default.nix files that
  listed options and imports; profiles list the leaves they want.
- Remove the Home Manager root-level pseudo options (brave.enable, fonts.enable,
  git.*) and the forwarding aggregators; group defaults live in
  profiles/home/common.nix.
- lib/hosts.nix normalizes hosts/*/meta.nix once; lib/default.nix returns the
  finished nixosConfigurations/homeConfigurations. Drop the unused overlays,
  modules, roles and path parameters.
- Move home/users to users/ and home/hosts/<h>.nix to hosts/<h>/home.nix so
  home/ only holds modules.
- Share scheme/cursor/polarity/terminal size through theme.nix and the default
  browser through myConfig.system.environment.defaultBrowser.
- sops sets the default hashedPasswordFile; the users module loses its unused
  options and gaming groups move to the steam module.
- Gate the Hyprland sub-files behind hyprland.enable, move the DP-1 screenshot
  bind to the desktop host and fix the swapped down/right focus binds.
- Remove restating comments, commented-out code, no-op defaults and the
  unreferenced swww scripts.

Behavior changes: the empty `xboxusers` group is gone, `example` no longer gets
the Hyprland screenshot scripts, and selene no longer has the DP-1 bind.
Installed packages are otherwise unchanged for desktop, selene and example.
Upstream core.nix does not declare sqlite, so linking fails with
-lsqlite3. Override serpantinum-core with sqlite and pkg-config
(ported from 15871ea on main).
Both Stylix modules read MonoLisa from theme.nix (the NixOS one used
TX-02); ghostty, serpantinum and noctalia read it from Stylix instead of
hardcoding their own font.
Enable the Stylix starship target and drop the unused mocha palette;
hyprland borders and the wofi stylesheet use the Stylix palette and
mono font. Remove the unused duplicate wofi catppuccin-macchiato.css.
Wayland layouts (hyprland, sway) live in hosts/desktop/home.nix; the i3
backup uses a single xrandr line with the integrated-GPU output names.
Drop the conflicting DP-0 autorandr profile (180 Hz vs 165 Hz), the
laptop/desktop outputs hardcoded in the shared sway module and noctalia's
stale DP-3 wallpaper entry.
@redyf
redyf merged commit b3270b1 into main Nov 11, 2026
2 checks passed
@redyf
redyf deleted the refactor/untangle branch November 13, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant