Skip to content

feat: add system-manager for home-manager-only hosts - #704

Merged
genebean merged 3 commits into
mainfrom
feat/system-manager-hm-only
Jul 22, 2026
Merged

genebean merged 3 commits into
mainfrom
feat/system-manager-hm-only

Conversation

@genebean

Copy link
Copy Markdown
Owner

Summary

  • Adds numtide/system-manager to declaratively manage system-level config on non-NixOS Linux hosts (Ubuntu laptop), filling the gap between home-manager (user-level) and NixOS (full system)
  • Initial managed config: /etc/nix/nix.custom.conf — trusted-users plus the same substituters/keys as NixOS hosts; previously required manual steps after each reinstall
  • nixup on HM-only hosts now runs system-manager switch first, then home-manager switch
  • nixdiff on HM-only hosts now builds the system-manager config and diffs each managed /etc file (via jq + diff-so-fancy) before the home-manager diff
  • Also includes: fix deprecated pkgs.systempkgs.stdenv.hostPlatform.system in deploy-with-retry, and mcp-nixos added to general home packages

First-time setup on a new host

# Remove any hand-written nix.custom.conf, then activate
sudo rm /etc/nix/nix.custom.conf
nix run ~/repos/dots#system-manager -- switch --sudo --flake ~/repos/dots#gene-x86_64-linux

Test plan

  • system-manager switch activated successfully on rainbow-planet
  • /etc/nix/nix.custom.conf is now a store symlink with correct content
  • nixdiff shows system /etc diff before HM package diff
  • nixup alias runs system-manager then home-manager in sequence
  • pre-commit run --all-files passes

🤖 Generated with Claude Code

genebean and others added 3 commits July 21, 2026 19:26
…recated pkgs.system

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds numtide/system-manager to manage system-level config (/etc files,
packages, services) on non-NixOS Linux hosts where home-manager alone
can't reach the system layer.

Initially manages /etc/nix/nix.custom.conf: trusted-users, and the same
set of extra-substituters and extra-trusted-public-keys as the NixOS hosts,
all of which were previously manual one-time steps after each reinstall.

- lib/mkSystemConfig.nix: new helper parallel to mkHomeConfig; sets
  nixpkgs.hostPlatform from the system param so both x86_64 and aarch64 work
- lib/default.nix: exports mkSystemConfig
- flake.nix: adds system-manager input (follows nixpkgs-unstable), systemConfigs
  output (gene-x86_64-linux and gene-aarch64-linux), exposes system-manager
  binary in packages, and adds numtide cache to nixConfig
- modules/hosts/home-manager-only/system.nix: system module managing nix.custom.conf
- zsh.nix: nixup on HM-only hosts now runs system-manager switch --sudo first,
  then home-manager switch
- pkgs/nixdiff/default.nix: adds diff-so-fancy to runtimeInputs
- pkgs/nixdiff/linux.sh: HM-only branch builds the system-manager config, parses
  etcFiles.json with jq to diff each text-mode /etc entry (rendered via
  diff-so-fancy), then proceeds to the home-manager diff as before

First-time setup on a host: sudo rm /etc/nix/nix.custom.conf, then run
nix run ~/repos/dots#system-manager -- switch --sudo --flake ~/repos/dots#gene-x86_64-linux

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@genebean
genebean merged commit e43e3fd into main Jul 22, 2026
2 checks passed
@genebean
genebean deleted the feat/system-manager-hm-only branch July 22, 2026 00:45
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