mirror of
https://github.com/Unkn0wnCat/dotfiles.git
synced 2025-05-18 01:46:10 +02:00
Initial commit
This commit is contained in:
commit
a46d297fc7
8 changed files with 356 additions and 0 deletions
21
nixos/install.sh
Executable file
21
nixos/install.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Source: https://stackoverflow.com/questions/59895/how-do-i-get-the-directory-where-a-bash-script-is-located-from-within-the-script
|
||||
SOURCE=${BASH_SOURCE[0]}
|
||||
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
|
||||
SOURCE=$(readlink "$SOURCE")
|
||||
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
|
||||
|
||||
echo "Installing NixOS modules..."
|
||||
|
||||
if [ -d /etc/nixos/modules ]; then
|
||||
echo "Directory /etc/nixos/modules exists - exiting."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
sudo ln -s $DIR/modules /etc/nixos/modules
|
||||
|
||||
echo "Done."
|
Loading…
Add table
Add a link
Reference in a new issue