modular-flake/nix/output/def.nix

43 lines
1.1 KiB
Nix

{ lib, ... }:
let
# not used in the actual type, because it breaks things. idk why, try it out
_outputType =
with lib;
with types;
functionTo submodule {
options = {
# before first
options = mkOption {
type = deferredModule;
description = "Definition of module exposed by this kind of output";
default = _: { };
};
# between first and second
specialArgs = mkOption {
type = attrs;
description = "Definition of specialArgs passed to the second fixed point";
default = _: { };
};
# after second
outputs = mkOption {
type = functionTo attrs;
description = "Extractor for the produced flake outputs.";
default = _: { };
};
};
};
in
{
options = with lib; {
outputKinds = mkOption {
type = with types; listOf anything;
description = ''
Definition for the kind of flake output.
Each definition is a lambda, provided with the following variables:
- `hasSystem`: if the system is known
'';
default = [ ];
};
};
}