]> Git — Sourcephile - julm/julm-nix.git/blob - install
losurdo: enable desktop
[julm/julm-nix.git] / install
1 #!/bin/sh -eux
2 if test "$(id -u)" != 0
3 then sudo "$0" "$@"
4 else
5 cd "${0%/*}"
6 ln -sfn "$PWD/private/root" /root/private
7 trap 'git reset private/root' EXIT
8 git rm -rf --cached --ignore-unmatch private/root # prevent copying to /nix/store
9 nixos-rebuild switch --flake . "$@"
10 nix-env --delete-generations +9 --profile /nix/var/nix/profiles/system
11 fi