From bca2d108cbfb6c7753b61804279057660659daa2 Mon Sep 17 00:00:00 2001 From: Astro Date: Mon, 11 Feb 2019 01:40:26 +0100 Subject: [PATCH] add install-host.sh --- install-host.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 install-host.sh diff --git a/install-host.sh b/install-host.sh new file mode 100755 index 00000000..9b847799 --- /dev/null +++ b/install-host.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -e + +REPO=nix-configs +if [ -d $REPO ]; then + cd $REPO + git pull --ff-only +else + git clone https://github.com/c3d2/$REPO.git $REPO +fi + +for OLDCFG in /etc/nixos/{hardware-,}configuration.nix; do + if [ -f $OLDCFG ]; then + sudo mv ${OLDCFG}{,.old} + fi +done + +sudo ln -s $HOME/$REPO/hosts/`hostname -s`/configuration.nix /etc/nixos/configuration.nix +ls -l /etc/nixos/configuration.nix +