nixos-configuration/justfile
2024-12-04 03:55:17 +01:00

34 lines
957 B
Makefile

usb_ram_disk := "/dev/disk/by-id/usb-jalr_USB_RAM_disk_prototype-01-0:0"
boot:
nixos-rebuild boot --flake . --use-remote-sudo
which fwupdmgr >/dev/null 2>&1 && fwupdmgr update || true
switch:
nixos-rebuild switch --flake . --use-remote-sudo
which fwupdmgr >/dev/null 2>&1 && fwupdmgr update || true
build:
nixos-rebuild build --flake .
update:
nix flake update --commit-lock-file
which fwupdmgr >/dev/null 2>&1 && fwupdmgr refresh || true
repl:
nix repl --expr "\
let \
flake = builtins.getFlake \"$(git rev-parse --show-toplevel)\"; in \
flake // (with flake; { \
lib = inputs.nixpkgs.lib; \
pkgs = inputs.nixpkgs.legacyPackages."\${builtins.currentSystem}".extend(import ./pkgs inputs); \
}) \
"
luks-pass host:
@if [ -b "{{usb_ram_disk}}" ]; then \
gpg -d hosts/{{host}}/luks-passfile.gpg | sudo dd of={{usb_ram_disk}}; \
else \
echo "{{usb_ram_disk}} is not a block device" >&2; \
fi