Add luks-pass command

This commit is contained in:
Jakob Lechner 2024-05-28 12:33:06 +02:00
parent 10dd7b937c
commit 15576bc7a0

View file

@ -1,3 +1,5 @@
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
@ -22,3 +24,11 @@ repl:
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