1
Fork 0
nixos-system-config/non-nixos-install.sh
caem 8136b7633f
Add configuration for nix itself
This enables the experimental features required to run `nix develop`.
2024-06-06 12:55:21 +02:00

23 lines
784 B
Bash
Executable file

#!/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"
ln -svf "$BASE_PATH/users/blank/nix" "$HOME/.config/nix"
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