Fix install script for non-nixos
This commit is contained in:
parent
8136b7633f
commit
e7e618f42b
1 changed files with 9 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script sets up nix and home-manager for distributions that are not NixOS.
|
||||
|
||||
|
@ -8,13 +8,18 @@ BASE_PATH="$(dirname "$(realpath "$0")")"
|
|||
if [ ! -d "/nix" ]; then
|
||||
# Do multi-user installation
|
||||
sh <(curl -L https://nixos.org/nix/install) --daemon
|
||||
exec bash -e "$(realpath "$0")"
|
||||
fi
|
||||
|
||||
if [ -z "$(nix-channel --list | grep nixpkgs)" ]; then
|
||||
nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
|
||||
nix-channel --update
|
||||
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"
|
||||
ln -svf "$BASE_PATH/users/i/home-manager" "$HOME/.config/home-manager"
|
||||
ln -svf "$BASE_PATH/users/i/nixpkgs" "$HOME/.config/nixpkgs"
|
||||
ln -svf "$BASE_PATH/users/i/nix" "$HOME/.config/nix"
|
||||
|
||||
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
nix-channel --update
|
||||
|
|
Loading…
Reference in a new issue