My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/infra/libkookie/build-on-remote

23 lines
623 B

#!/bin/sh
HOST=$(hostname)
DIR=$(realpath $(dirname $0))
OUT=$(mktemp -du)
ROOT="$DIR/roots/$HOST.nix"
# By default build on hyperion
if [ -z "$REMOTE" ]
then
REMOTE="hyperion"
fi
drvs="$(nix-instantiate -A system '<nixpkgs/nixos>' \
-I nixos-config="$ROOT" \
-I "nixpkgs=$DIR/nixpkgs/unstable" \
-I "nixpkgs-overlays=$DIR/overlays" \
-I "home-manager=$DIR/home-manager" \
-I "modules=$DIR/modules" \
-I "configuration=$DIR/configuration")"
nix-copy-closure -s --to $REMOTE $drvs
nix-copy-closure --from $REMOTE $(ssh $REMOTE nix-build $drvs)