summaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/install.sh b/install.sh
index c00066d..360ffdd 100755
--- a/install.sh
+++ b/install.sh
@@ -1,5 +1,11 @@
#!/usr/bin/env bash
+if [ -z "$1" ]
+then
+ echo "usage: install.sh <file.nix>"
+ exit 1
+fi
+
echo "Symlinking directories"
mkdir -p ~/.config/nixpkgs
@@ -7,7 +13,7 @@ mkdir -p ~/.config/nixpkgs
NIXDIR="$HOME/.config/nixpkgs"
HOMEFILE="$NIXDIR/home.nix"
-NIXFILE="$(pwd)/$(uname | tr A-Z a-z).nix"
+NIXFILE="$(pwd)/$1"
[[ -e "$HOMEFILE" ]] || ln -s "$NIXFILE" "$HOMEFILE"
[[ -e "$NIXDIR/config.nix" ]] || ln -s "$(pwd)/config.nix" "$NIXDIR/config.nix"