Created
July 11, 2026 09:07
-
-
Save ckiee/f7768f55a938aa7c985406f209a6f114 to your computer and use it in GitHub Desktop.
Using NixOS-ified home-manager config on a host you don't manage (example implementation)
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
| let | |
| sources = import ../nix/sources.nix; | |
| eval = import "${sources.morph}/data/eval-machines.nix" { | |
| networkExpr = ./morph.nix; | |
| }; | |
| pkgs = import sources.nixpkgs { }; | |
| inherit (eval) uncheckedNodes nodes; | |
| inherit (pkgs) lib; | |
| in pkgs.writeScriptBin "ckie-hm-port" | |
| nodes.hmporter.config.systemd.services.home-manager-ckie.serviceConfig.ExecStart |
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
| # … | |
| elif [ "$1" == "hmport" ]; then | |
| shift | |
| # This will build the derivation on the target host. | |
| path="$(nix-instantiate hm-only.nix)" | |
| nix copy --to "ssh://$@" --derivation "$path" | |
| ssh "$@" '$(nix-store -r '$path')/bin/ckie-hm-port' | |
| else | |
| # … |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment