nixos-configuration/justfile
2024-05-29 02:05:52 +02:00

34 lines
934 B
Makefile

usb_ram_disk := "/dev/disk/by-id/usb-jalr_RAM_Mass_Storage_DE6270431F6F342C-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 // { \
lib = flake.inputs.nixpkgs.lib; \
pkgs = flake.inputs.nixpkgs.legacyPackages."\${builtins.currentSystem}"; \
} \
"
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