From d5dc7479c489d17e6dcacf081c0f1b5242d99bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 8 Jan 2023 11:25:01 +0100 Subject: Format using Alejandra --- nixos/modules/autounlock.nix | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'nixos/modules/autounlock.nix') diff --git a/nixos/modules/autounlock.nix b/nixos/modules/autounlock.nix index 0458c7b..7f7c24e 100644 --- a/nixos/modules/autounlock.nix +++ b/nixos/modules/autounlock.nix @@ -1,13 +1,12 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - +{ + config, + lib, + pkgs, + ... +}: +with lib; let cnf = config.cynerd.autounlock; - in { - options = { cynerd.autounlock = mkOption { type = with types; attrsOf string; @@ -17,24 +16,23 @@ in { }; config = mkIf (cnf != {}) { - - environment.systemPackages = [ pkgs.luks-hw-password ]; + environment.systemPackages = [pkgs.luks-hw-password]; boot.initrd = { extraFiles."/luks-hw-password".source = pkgs.luks-hw-password; - luks.devices = mapAttrs (name: value: { + luks.devices = + mapAttrs (name: value: { device = value; keyFile = "/keys/${name}.key"; fallbackToPassword = true; preOpenCommands = '' mkdir -p /keys /luks-hw-password/bin/luks-hw-password > /keys/${name}.key - ''; + ''; postOpenCommands = '' rm -rf /keys - ''; - }) cnf; + ''; + }) + cnf; }; - }; - } -- cgit v1.2.3