add script to setup configuration.nix link

This commit is contained in:
HackENS milieu 2021-11-02 23:38:40 +01:00
parent e3372c61a9
commit 18d874e874

11
setupLinkFromHostname Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
echo "Setting up $(hostname)"
HOST_FOLDER=hosts
HOSTNAME=$(hostname)
CONFIG=$HOST_FOLDER/$HOSTNAME.nix
if [[ -n $(cmp --silent configuration.nix "$CONFIG" || echo "different") ]]
then
ln -s "$CONFIG" configuration.nix
fi