-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
29 lines (23 loc) · 873 Bytes
/
justfile
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
27
28
29
alias s := switch
alias d := deploy
check:
nix flake check
switch *args:
@sudo -v
nh os switch --no-nom --ask . -- --keep-going {{args}}
rollback:
@sudo -v
sudo nixos-rebuild switch --rollback
boot *args:
@sudo -v
nh os boot --no-nom --ask . -- --keep-going {{args}}
deploy system user="leo":
#!/usr/bin/env bash
set -euxo pipefail
flake=$(nix eval --impure --raw --expr "(builtins.getFlake \"git+file://$PWD\").outPath")
nix copy "$flake" --to "ssh://{{user}}@{{system}}"
# -R/--bypass-root-check is needed because of a Git CVE regression in Nix 2.20
# See NixOS/nix#10202, viperML/nh#200
ssh -t "{{user}}@{{system}}" "sudo flock -w 60 /dev/shm/deploy-{{system}} nix run n#nh -- os switch --no-nom -R -H {{system}} --ask $flake"
lint *args:
statix check -i flake.nix **/hardware-configuration.nix {{args}}