feat: add system-manager for home-manager-only hosts - #704
Merged
Merged
Conversation
…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>
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
numtide/system-managerto declaratively manage system-level config on non-NixOS Linux hosts (Ubuntu laptop), filling the gap between home-manager (user-level) and NixOS (full system)/etc/nix/nix.custom.conf— trusted-users plus the same substituters/keys as NixOS hosts; previously required manual steps after each reinstallnixupon HM-only hosts now runssystem-manager switchfirst, thenhome-manager switchnixdiffon HM-only hosts now builds the system-manager config and diffs each managed/etcfile (via jq + diff-so-fancy) before the home-manager diffpkgs.system→pkgs.stdenv.hostPlatform.systemindeploy-with-retry, andmcp-nixosadded to general home packagesFirst-time setup on a new host
Test plan
system-manager switchactivated successfully on rainbow-planet/etc/nix/nix.custom.confis now a store symlink with correct contentnixdiffshows system /etc diff before HM package diffnixupalias runs system-manager then home-manager in sequencepre-commit run --all-filespasses🤖 Generated with Claude Code