default_flags := ""

build flags=default_flags:
    nix run nixpkgs#nix-output-monitor -- build .#nixosConfigurations.pipa.config.system.build.toplevel {{flags}} -o result-toplevel

build-kernel flags=default_flags:
    nix run nixpkgs#nix-output-monitor -- build .#nixosConfigurations.pipa.config.boot.kernelPackages.kernel {{flags}} -o result-kernel

build-images:
    nix run

push:
    attic push my-config result-toplevel

flash-all:
    fastboot flash fedora_boot images/boot.img
    fastboot flash fedora_root images/rootfs.sparse.img
    fastboot reboot

flash-boot:
    fastboot flash fedora_boot images/boot.img
    fastboot reboot

flash-root:
    fastboot flash fedora_root images/rootfs.sparse.img
    fastboot reboot

format:
    alejandra .

build-image-bg:
    just build-image "--cores 6 -j 1"