Repository navigation
Deduplicate the NixOS config and drop no-op Home Manager settings - #26
Merged
Merged
Conversation
Restructure without changing the built systems (the nixos-wsl, nixos-wsl-bootstrap and nixos-native toplevel derivations are byte-identical to master): - Move settings shared by both hosts into systems/common.nix - Let mkSystem add common.nix, the overlays and Home Manager for every host, and define the username once as `user` in flake.nix - Drop home.username/homeDirectory (set by Home Manager's NixOS module) and import the shared home modules from home/modules/common.nix - Replace the 11 mkOutOfStoreSymlink paths with config.lib.dotfiles.link - Remove settings that restate defaults (openssh.enable = false, i18n.defaultLocale, Docker enableOnBoot), empty placeholders and the mislabeled "Windows SSH agent" comment Fix settings that did nothing and packages listed twice; only Home Manager outputs change: - Remove home.sessionVariables: zsh never read them, and bash sets EDITOR, VISUAL and DOTFILES itself - Replace programs.yazi with pkgs.yazi: its zsh integration and yy wrapper were no-ops with Home Manager's shell modules off - Keep neovim, git, wget and curl (and firefox on native) as system packages only, let programs.gh and programs.gpg install gh and gnupg, and list ripgrep, fd, gcc, nil and nixpkgs-fmt once The combined system and Home Manager package set is unchanged apart from the regenerated hm-session-vars.sh. Docs and AGENTS.md are updated to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The refactor consistently preserves host-specific behavior while centralizing shared settings and removing verified redundancies.
0 open findings
What changed in this PR
This PR centralizes shared NixOS configuration and removes redundant Home Manager settings without changing host functionality.
Changes:
- Adds shared system and Home Manager module composition.
- Centralizes username, overlays, and configuration-link helpers.
- Deduplicates packages and updates documentation.
| File | Description |
|---|---|
systems/wsl/configuration.nix |
Retains WSL-specific settings only. |
systems/native/configuration.nix |
Retains native host settings only. |
systems/common.nix |
Adds shared NixOS configuration. |
nvim/.config/nvim/README.md |
Documents revised package ownership. |
home/nixos-wsl.nix |
Simplifies WSL Home Manager imports. |
home/nixos-native.nix |
Simplifies native Home Manager imports. |
home/modules/wezterm.nix |
Uses the shared link helper. |
home/modules/terminal.nix |
Simplifies Yazi and configuration links. |
home/modules/shell.nix |
Uses the shared link helper. |
home/modules/neovim.nix |
Removes duplicate packages. |
home/modules/languages.nix |
Simplifies package syntax. |
home/modules/git.nix |
Removes packages installed elsewhere. |
home/modules/dev-tools.nix |
Consolidates development packages. |
home/modules/common.nix |
Imports shared modules and defines link helper. |
flake.nix |
Centralizes system construction and username. |
docs/README.nix.md |
Documents shared module locations. |
docs/QUICK_REFERENCE.md |
Updates configuration ownership references. |
docs/DEPLOYMENT.md |
Documents centralized username handling. |
docs/ARCHITECTURE.md |
Updates architecture and package ownership. |
AGENTS.md |
Updates contributor rules and layout. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the NixOS config more concise without adding or removing any package or feature.
Restructure, with no change to the built systems. The
nixos-wsl,nixos-wsl-bootstrapandnixos-nativetoplevel derivations are byte-identical tomaster.systems/common.nixholds the settings both hosts had copied: Nix settings, garbage collection, unfree, timezone, the user, zsh and base packages.mkSystemaddscommon.nix, the overlays and Home Manager for every host. The username is defined once asuserinflake.nix.home.username/home.homeDirectory, which Home Manager's NixOS module already sets.home/modules/common.niximports the shared modules.config.lib.dotfiles.link "<path>"replaces the 11 longmkOutOfStoreSymlinkpaths.services.openssh.enable = false,i18n.defaultLocale, DockerenableOnBoot), empty placeholders, and the mislabeled "Windows SSH agent" comment.Fixes, which change only Home Manager outputs.
home.sessionVariables(EDITOR,VISUAL,DOTFILES). zsh never read them, and bash already sets all three itself.programs.yaziwithpkgs.yazi. Its zsh integration andyywrapper were no-ops with Home Manager's shell modules off.neovim,git,wgetandcurl(andfirefoxon native) stay system packages only.programs.ghandprograms.gpginstallghandgnupg.ripgrep,fd,gcc,nilandnixpkgs-fmteach live in one module.AGENTS.mdand the docs are updated to match, including a "list each package once" rule.Deliberately unchanged
log-driver = "json-file": NixOS defaults Docker to journald, so this isn't redundant.iptables = true: removing it would rewritedaemon.jsonand restart Docker.nixpkgs-fmt→nixfmtswap, the Home Manager CLI and standalonedocker-compose: changing them would change the package set.Makefile.defaultSessionrename warning: fixing it needs native'sservicessection re-nested to satisfy statix.Verification
.drvpaths are identical tomasterfor all three configs.masterbaseline:hm-session-vars.sh, which only loses the three exports.master's build):home-manager-user3301.service.gitand its helpers,nvim,curl/wcurl,wget). They stay onPATHvia the system profile, with identical binaries.hash -r. zsh falls back on its own.Test plan
nix-quality,lua-format,zsh-syntaxandbash-syntaxchecks passnixos-wslandnixos-nativeevaluate. WSL has no warnings; native shows only the existingdefaultSessionrename warning.nixos-wsltoplevel builds without activationmake switchon WSL🤖 Generated with Claude Code