Skip to content

Commit

Permalink
justfile: Added automatic pushing to attic cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
aftix committed Oct 14, 2024
1 parent a7ffccf commit 29d7522
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ home-manager-switch.log
result
wallpaper.png
.nixkeep-*
.deploy-rs
9 changes: 9 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ arch := `uname -m`
default:
@just --list

attic-push path cache="cfg-actions":
@if [[ -e "{{path}}" ]]; then nix-store --query --requisites --include-outputs "{{path}}" | xargs attic push "{{cache}}" &> /dev/null; fi

build host=hostname *FLAGS="":
@nom build ".#nixosConfigurations.{{host}}.config.system.build.toplevel" {{FLAGS}}
@just attic-push "./result" || :

switch *FLAGS:
@nh os switch {{FLAGS}}
Expand All @@ -21,6 +25,8 @@ check *FLAGS:
@nix flake check {{FLAGS}}

deploy node="fermi" *FLAGS="":
@nom build {{FLAGS}} --out-link .deploy-rs 'github:serokell/deploy-rs'
@just attic-push "./.deploy-rs" || :
@nix run {{FLAGS}} 'github:serokell/deploy-rs' '.#{{node}}' -- -- --impure

deploy-override node="fermi":
Expand All @@ -33,11 +39,14 @@ rekey:

iso variant="minimal" arch=arch *FLAGS="":
@nom build ".#nixosConfigurations.iso-{{variant}}-{{arch}}-linux.config.system.build.isoImage" {{FLAGS}}
@just attic-push "./result" || :

vm variant="minimal" arch=arch *FLAGS="":
@just iso {{variant}} {{arch}}
@jut attic-push "./result"
@find result/iso -type f -name "*.iso" | head -n1 | xargs -I% nix run 'nixpkgs#qemu_kvm' -- -boot d -smbios type=0,uefi=on -m 2G -cdrom % {{FLAGS}}

serialvm variant="minimal" arch=arch *FLAGS="":
@just iso {{variant}} {{arch}}
@just attic-push "./result" || :
@find result/iso -type f -name "*.iso" | head -n1 | xargs -I% nix run 'nixpkgs#qemu_kvm' -- -boot d -smbios type=0,uefi=on -m 2G -nographic -serial mon:stdio -cdrom % {{FLAGS}}

0 comments on commit 29d7522

Please sign in to comment.