diff options
Diffstat (limited to 'deploy.sh')
-rw-r--r-- | deploy.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..cc2aaf5 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env sh + +# Deploys the configuation to your machine + +TMP_DIRNAME="/tmp/nix-config" +GIT_REMOTE_SRC=$1 +NIX_HOST=$2 +echo "Going to clone $GIT_REMOTE_SRC into $TMP_DIRNAME" +mkdir "$TMP_DIRNAME" + +git clone "$GIT_REMOTE_SRC" "$TMP_DIRNAME" +prev=$PWD +cd "$TMP_DIRNAME" || return +echo "Now going to build nix configuration for $NIX_HOST to switch on next boot" +sudo nixos-rebuild --flake .#"$NIX_HOST" boot + +cd "$prev" || return + |