nixos-config/update.sh
Charlotte Van Petegem 576e6bdc23
Update dependencies
2021-04-07 10:30:14 +02:00

14 lines
599 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
set -x
nix flake update
if [ -z "${OVERRIDE:-}" ]
then
nix build --no-link --profile /nix/var/nix/profiles/per-user/charlotte/`hostname` .#nixosConfigurations.`hostname`.config.system.build.toplevel
su -c "nixos-rebuild --flake . switch"
else
nix build --no-link --override-input nixpkgs ../nixpkgs --no-write-lock-file --profile /nix/var/nix/profiles/per-user/charlotte/`hostname` .#nixosConfigurations.`hostname`.config.system.build.toplevel
su -c "nixos-rebuild --flake . --override-input nixpkgs ../nixpkgs --no-write-lock-file switch"
fi