-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup
More file actions
executable file
·26 lines (21 loc) · 877 Bytes
/
setup
File metadata and controls
executable file
·26 lines (21 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /bin/sh
set -e
sudo ln -sF $(pwd)/home-manager $HOME/.config/home-manager
if ! command -v nix &> /dev/null; then
echo "Nix n'est pas installé. Installation en cours..."
sh <(curl -L https://nixos.org/nix/install) --daemon
source ~/.nix-profile/etc/profile.d/nix.sh
fi
if [ -f "/etc/NIXOS" ]; then
flake_path="$HOME/bonsly/nixos"
echo "NixOS détecté, installation complète avec configuration système et utilisateur."
echo "Génération de hardware-configuration.nix..."
nixos-generate-config --dir "$(pwd)/nixos"
sudo nixos-rebuild switch --flake "$flake_path#$(hostname)"
fi
if ! command -v home-manager &> /dev/null; then
echo "Installation de home-manager..."
nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager && \
nix-channel --update && \
nix-shell '<home-manager>' -A install
fi