From e7e618f42be677f0d419861ba6c901dfd8301af4 Mon Sep 17 00:00:00 2001 From: caem Date: Thu, 6 Jun 2024 16:28:28 +0200 Subject: [PATCH] Fix install script for non-nixos --- non-nixos-install.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/non-nixos-install.sh b/non-nixos-install.sh index c1a445d..c267a45 100755 --- a/non-nixos-install.sh +++ b/non-nixos-install.sh @@ -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