]> Git — Sourcephile - julm/julm-nix.git/blob - install
nix: move secrets to private
[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 +2 --profile /nix/var/nix/profiles/system
11 fi