stockholm/lass/2configs/pass.nix

19 lines
400 B
Nix
Raw Normal View History

2015-07-16 15:51:01 +02:00
{ config, pkgs, ... }:
{
2021-06-05 13:17:36 +02:00
users.users.mainUser.packages = with pkgs; [
2019-10-14 15:36:03 +02:00
(pass.withExtensions (ext: [ ext.pass-otp ]))
2017-10-03 23:53:43 +02:00
gnupg
2021-10-24 22:15:02 +02:00
(pkgs.writers.writeDashBin "unlock" ''
set -efu
HOST=$1
pw=$(pass show "admin/$HOST/luks")
torify sshn root@$(pass "hosts/$HOST/initrd/hostname") "echo $pw > /crypt-ramfs/passphrase"
'')
2015-07-16 15:51:01 +02:00
];
2017-10-05 05:05:00 +02:00
programs.gnupg.agent.enable = true;
2021-10-24 22:15:02 +02:00
2015-07-16 15:51:01 +02:00
}