#!/usr/bin/env bash set -euxo pipefail ################################### # Usage: # # curl nix.manu.nu | bash # ################################### if [[ -e ~/.config/home-manager ]]; then echo "Already exists: ~/.config/home-manager" >&2 exit 1 fi # Install & setup nix # if ! nix --version > /dev/null 2>&1; then curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install fi if test "$USER" = "manu" && ! grep 'trusted-public-keys' /etc/nix/nix.conf; then echo 'trusted-public-keys = manu-fw:lGp+rkvGHyKUwcO2BmanB9btfMFDAAc3NHt4dRTCQek=' | sudo tee /etc/nix/nix.conf fi if ! grep 'experimental-features' /etc/nix/nix.conf; then echo 'experimental-features = nix-command flakes' | sudo tee /etc/nix/nix.conf fi # Cowsay intro # nix --extra-experimental-features 'nix-command flakes' shell nixpkgs#neo-cowsay -c cowsay --bold --aurora -f dragon "[manu.nu] home-manager installer" || true # Clone repo # nix --extra-experimental-features 'nix-command flakes' shell nixpkgs#git-lfs -c git clone https://gitlab.com/onezoomin/nix/our-config ~/.config/home-manager cd ~/.config/home-manager # git checkout generic # until merged # ACTIVATE # nix --extra-experimental-features 'nix-command flakes' shell nixpkgs#home-manager nixpkgs#git-lfs -c home-manager --flake .#$USER@generic switch -b backup