From a6c7ecd8ba90c1eb2515cb235d85649295848e68 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 11 Jan 2024 04:37:02 +0100 Subject: populate: add passage source type --- lib/types/populate.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'lib') diff --git a/lib/types/populate.nix b/lib/types/populate.nix index 18b5cd8..6264f99 100644 --- a/lib/types/populate.nix +++ b/lib/types/populate.nix @@ -39,6 +39,17 @@ default = null; type = lib.types.nullOr source-types.pass; }; + passage = lib.mkOption { + apply = x: + if lib.types.pathname.check x + then { dir = x; } + else x; + default = null; + type = lib.types.nullOr (lib.types.oneOf [ + lib.types.pathname + source-types.passage + ]); + }; pipe = lib.mkOption { apply = x: if lib.types.absolute-pathname.check x @@ -160,6 +171,21 @@ }; }; }; + passage = lib.types.submodule { + options = { + age = lib.mkOption { + default = "age"; + type = lib.types.pathname; + }; + dir = lib.mkOption { + type = lib.types.pathname; + }; + identities_file = lib.mkOption { + default = toString ~/.passage/identities; + type = lib.types.pathname; + }; + }; + }; pipe = lib.types.submodule { options = { command = lib.mkOption { -- cgit v1.2.3