shell-customization #4

Open
lbailly wants to merge 61 commits from shell-customization into main
2 changed files with 18 additions and 4 deletions
Showing only changes of commit 0fb671023c - Show all commits

View file

@ -7,7 +7,7 @@
{ members, primary } :
let
inherit (liminix.services) bundle oneshot;
inherit (liminix.services) structuredBundle oneshot;
inherit (lib) mapAttrs;
addif = name: { dependencies ? [ ], member }: oneshot {
name = "${primary.name}.member.${name}";
@ -22,7 +22,7 @@ let
dependencies = [ primary member ] ++ dependencies;
};
in bundle {
in structuredBundle {
name = "${primary.name}.members";
contents = builtins.attrValues (mapAttrs addif members);
contents = mapAttrs addif members;
}

View file

@ -39,6 +39,7 @@ let
, contents ? []
, buildInputs ? []
, isTrigger ? false
, passthru ? {}
} @ args:
stdenvNoCC.mkDerivation {
# we use stdenvNoCC to avoid generating derivations with names
@ -50,6 +51,8 @@ let
dependencies = builtins.map (d: d.name) dependencies;
contents = builtins.map (d: d.name) contents;
builder = ./builder.sh;
inherit passthru;
};
longrun = {
@ -100,7 +103,18 @@ let
serviceType = "bundle";
inherit contents dependencies;
});
structuredBundle = {
name
, contents ? {}
, dependencies ? []
, ...
} @ args: service (args // {
serviceType = "bundle";
contents = builtins.attrValues contents;
inherit dependencies;
passthru.components = contents;
});
target = bundle;
in {
inherit target bundle oneshot longrun output;
inherit target bundle oneshot longrun output structuredBundle;
}