From 5d68fbf0a198291330fe626d93cb1d80cb31a49e Mon Sep 17 00:00:00 2001 From: Lander Van den Bulcke Date: Tue, 4 Nov 2025 13:38:51 +0100 Subject: [PATCH] feat: ask-password as shell Signed-off-by: Lander Van den Bulcke --- hosts/hyp-01/modules/networking.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/hosts/hyp-01/modules/networking.nix b/hosts/hyp-01/modules/networking.nix index 021df0c..b90b3a6 100644 --- a/hosts/hyp-01/modules/networking.nix +++ b/hosts/hyp-01/modules/networking.nix @@ -1,4 +1,9 @@ -{ config, lib, ... }: +{ + config, + lib, + pkgs, + ... +}: { options = { networking.hyp-01.ipv4.address = lib.mkOption { @@ -44,6 +49,18 @@ boot.initrd = { availableKernelModules = [ "e1000e" ]; + systemd = + let + askPass = pkgs.writeShellScriptBin "zfs-askpass" '' + systemd-tty-ask-password-agent --watch + ''; + in + { + enable = true; + storePaths = [ "${askPass}/bin/zfs-askpass" ]; + users.root.shell = "${askPass}/bin/zfs-askpass"; + }; + network = { enable = true;