From 4cc82e1502d644b2ce941d18fe572f68680173cb Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Wed, 21 Aug 2024 00:16:14 +0100 Subject: [PATCH] liminix.types.replacable is a string or ref to an output --- pkgs/default.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/default.nix b/pkgs/default.nix index 21af04c..a43e785 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -30,7 +30,7 @@ in { }; lib = { types = - let inherit (lib) types isDerivation; + let inherit (lib) mkOption types isDerivation; in rec { service = types.package // { name = "service"; @@ -43,6 +43,18 @@ in { description = "parametrisable s6-rc service definition"; check = x: lib.isAttrs x && x ? parameters && x ? build; }; + replacable = types.either + types.str + (types.submodule { + options = { + service = mkOption { + type = service; + }; + path = mkOption { + type = types.str; + }; + }; + }); }; inherit typeChecked; };