flake/justfile
uku e1e19a908b feat(justfile): switch away from nh (#1)
replaces the usage of nh with a super awesome little bash script that does basically the same thing :)

Reviewed-on: #1
Co-authored-by: uku <hi@uku.moe>
Co-committed-by: uku <hi@uku.moe>
2025-03-06 09:40:00 +01:00

24 lines
652 B
Makefile

alias s := switch
alias d := deploy
check:
nix flake check
switch *args:
bash switch.sh {{ justfile_directory() }} {{args}}
rollback:
sudo nixos-rebuild switch --rollback
boot *args:
sudo nixos-rebuild boot --flake {{ justfile_directory() }} --keep-going {{args}}
deploy system user="leo":
#!/usr/bin/env bash
set -euo pipefail
flake=$(nix eval --impure --raw --expr "(builtins.getFlake \"git+file://$PWD\").outPath")
nix copy "$flake" --to "ssh://{{user}}@{{system}}"
ssh -t "{{user}}@{{system}}" "bash $flake/switch.sh $flake"
lint *args:
statix check -i flake.nix **/hardware-configuration.nix {{args}}