fix install.sh

This commit is contained in:
Felix Schröter 2019-10-18 20:08:05 +02:00 committed by Felix Schröter
parent e6e1cac0e7
commit 36b5207ebd

View file

@ -1,15 +1,17 @@
#!/bin/bash
#!/bin/sh
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
CONFIG=$0
CONFIG=$1
if [ -z "$CONFIG" ]
then
echo "path to config to use as configuration.nix needs to be passed as first argument"
else
echo "using configuration: '$CONFIG'"
fi
ln -s $CONFIG configuration.nix
@ -17,7 +19,7 @@ ln -s $CONFIG configuration.nix
nixos-generate-config --root /mnt
# add nixos-unstable and home-manager channels
nix-channel --add http://nixos.org/channels/nixos-unstable nixos-unstable
nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
nix-channel --add https://github.com/rycee/home-manager/archive/release-19.03.tar.gz home-manager
nix-channel --update