From cbbeb34cc40197f530c7bf65b83a2f24f7df972b Mon Sep 17 00:00:00 2001 From: mat ess Date: Wed, 5 May 2021 17:55:45 -0400 Subject: [PATCH] Update install script, add pine stub --- install.sh | 16 +++++++++++----- machines/pine/configuration.nix | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 machines/pine/configuration.nix diff --git a/install.sh b/install.sh index bbca43e..f640e53 100755 --- a/install.sh +++ b/install.sh @@ -1,16 +1,22 @@ #!/usr/bin/env bash -machine=$1 +dest=$1 +machine=$HOSTNAME + +if [[ -z "$dest" ]]; then + dest="/etc/nixos/configuration.nix" +fi if [[ -z "$machine" ]]; then - machine=$(hostname) + machine=default-name fi -if [[ ! -d "machines/$machine" ]]; then +if [[ ! -d "machines/$machine" || ! -f "machines/$machine/configuration.nix" ]]; then echo "$machine is not a known machine" + echo "Run as \`env HOSTNAME= ./install.sh\` to override." exit else - echo "Linking ./machines/$machine/configuration.nix to /etc/nixos/configuration.nix" + echo "Linking ./machines/$machine/configuration.nix to $dest" fi -sudo ln -sf $PWD/machines/$machine/configuration.nix /etc/nixos/configuration.nix +sudo ln -sf $PWD/machines/$machine/configuration.nix $dest diff --git a/machines/pine/configuration.nix b/machines/pine/configuration.nix new file mode 100644 index 0000000..1333ed7 --- /dev/null +++ b/machines/pine/configuration.nix @@ -0,0 +1 @@ +TODO