From d091471c01bbeb6b106698b3a95ecea579a0a24f Mon Sep 17 00:00:00 2001 From: Maciej Jur Date: Sun, 9 Jul 2023 15:02:41 +0200 Subject: [PATCH] Update structure --- kamoshi.nix => hosts/kamoshi/configuration.nix | 2 +- symlink.sh | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) rename kamoshi.nix => hosts/kamoshi/configuration.nix (98%) create mode 100644 symlink.sh diff --git a/kamoshi.nix b/hosts/kamoshi/configuration.nix similarity index 98% rename from kamoshi.nix rename to hosts/kamoshi/configuration.nix index 479ac0d..f907c47 100644 --- a/kamoshi.nix +++ b/hosts/kamoshi/configuration.nix @@ -7,7 +7,7 @@ { imports = [ # Include the results of the hardware scan. - ./hardware-configuration.nix + /etc/nixos/hardware-configuration.nix ]; # Use the GRUB 2 boot loader. diff --git a/symlink.sh b/symlink.sh new file mode 100644 index 0000000..d09e458 --- /dev/null +++ b/symlink.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +HOST=`hostname` +if [[ ! -z "$1" ]]; then + HOST=$1 +fi + +if [[ ! -e "hosts/$HOST/configuration.nix" ]]; then + echo "missing config file for $HOST" >&2 + exit 1 +fi + +ln -f "hosts/$HOST/configuration.nix" .