2024-06-06 12:41:31 +02:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
# This script sets up nix and home-manager for distributions that are not NixOS.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
BASE_PATH="$(dirname "$(realpath "$0")")"
|
|
|
|
|
|
|
|
if [ ! -d "/nix" ]; then
|
|
|
|
# Do multi-user installation
|
|
|
|
sh <(curl -L https://nixos.org/nix/install) --daemon
|
|
|
|
nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -x "$HOME/.nix-profile/bin/home-manager" ]; then
|
|
|
|
ln -svf "$BASE_PATH/users/blank/home-manager" "$HOME/.config/home-manager"
|
|
|
|
ln -svf "$BASE_PATH/users/blank/nixpkgs" "$HOME/.config/nixpkgs"
|
2024-06-06 12:55:21 +02:00
|
|
|
ln -svf "$BASE_PATH/users/blank/nix" "$HOME/.config/nix"
|
2024-06-06 12:41:31 +02:00
|
|
|
|
|
|
|
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
|
|
|
nix-channel --update
|
|
|
|
nix-shell '<home-manager>' -A install
|
|
|
|
fi
|
|
|
|
|