Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .PHONY: hostname
- hostname:
- drv=$$(nix-build --no-out-link --expr "\
- let \
- nixos = import <nixpkgs/nixos> { configuration = \
- import host/$@/configuration.nix; }; \
- in nixos.system") && \
- nix-copy-closure --use-substitutes --to "$@" "$${drv}" && \
- ssh -t "$@" "trap '' HUP && sudo sh -c \
- 'nix-env -p /nix/var/nix/profiles/system --set "$${drv}" && \
- "$${drv}"/bin/switch-to-configuration switch'"
- ssh "$@" readlink -f /run/{booted,current}-system{,/kernel}
Add Comment
Please, Sign In to add comment