diff --git a/justfile b/justfile index 16c0c22..659ef32 100644 --- a/justfile +++ b/justfile @@ -8,13 +8,11 @@ test hostname=(HOSTNAME): # Apply config on hostname switch hostname=(HOSTNAME): - @nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false ) @rm -f nixos-switch.log @colmena --impure apply --on {{hostname}} # Apply config on hostname at next reboot boot: - @nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false ) @rm -f nixos-switch.log @doas nixos-rebuild switch --impure --flake .#{{HOSTNAME}} @@ -25,21 +23,18 @@ world: # Build and install the workstations workstation: - @nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false ) @rm -f nixos-switch.log @colmena --impure exec --on @workstation "locate home-manager-backup | sort -u | xargs rm -f" @colmena --impure apply --on @workstation # Build and install the servers server: - @nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false ) @rm -f nixos-switch.log @colmena --impure exec --on @server "locate home-manager-backup | sort -u | xargs rm -f" @colmena --impure apply --on @server # Build and install the webhosts web: - @nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false ) @rm -f nixos-switch.log @colmena --impure exec --on @web "locate home-manager-backup | sort -u | xargs rm -f" @colmena --impure apply --on @web @@ -47,7 +42,6 @@ web: # Build and run a vm FIXME vm hostname=(HOSTNAME): @doas rm -f result - @nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false ) @rm -f nixos-switch.log @echo Running iso build @nixos-rebuild build-vm --impure --flake .#{{hostname}} @@ -55,13 +49,11 @@ vm hostname=(HOSTNAME): result/bin/run-{{hostname}}-vm buildiso hostname: - @nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false ) @rm -f nixos-switch.log result @echo Running iso build @NIXPKGS_ALLOW_UNFREE=1 nix run --impure nixpkgs#nixos-generators -- -f iso --flake .#{{hostname}} --system x86_64-linux -o ./{{hostname}}.sd &> nixos-switch.log || ( cat nixos-switch.log && false ) buildsd hostname: - @nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false ) @rm -f nixos-switch.log result @echo Running sd build @doas nix run nixpkgs#nixos-generators -- -f sd-aarch64 --flake .#{{hostname}} --system aarch64-linux -o ./{{hostname}}.sd &> nixos-switch.log || ( cat nixos-switch.log && false ) @@ -119,10 +111,13 @@ ci: # Go old school oldschool: - @nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false ) @rm -f nixos-switch.log @doas nixos-rebuild switch --impure --flake .#{{HOSTNAME}} # Reboot on hostname reboot hostname=(HOSTNAME): @colmena --impure exec --on {{hostname}} "doas reboot" + +# Format the code +format: + @nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false )