liminix.types.replacable is a string or ref to an output

This commit is contained in:
Daniel Barlow 2024-08-21 00:16:14 +01:00
parent 21f2320d86
commit 4cc82e1502
1 changed files with 13 additions and 1 deletions

View File

@ -30,7 +30,7 @@ in {
}; };
lib = { lib = {
types = types =
let inherit (lib) types isDerivation; let inherit (lib) mkOption types isDerivation;
in rec { in rec {
service = types.package // { service = types.package // {
name = "service"; name = "service";
@ -43,6 +43,18 @@ in {
description = "parametrisable s6-rc service definition"; description = "parametrisable s6-rc service definition";
check = x: lib.isAttrs x && x ? parameters && x ? build; 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; inherit typeChecked;
}; };