2021-10-27 09:05:52 +00:00
|
|
|
{ lib }:
|
|
|
|
let
|
|
|
|
inherit (lib)
|
|
|
|
mkOption
|
|
|
|
types
|
2022-05-13 08:14:10 +00:00
|
|
|
functionTo
|
2021-10-27 09:05:52 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
flake-modules-core-lib = {
|
|
|
|
evalFlakeModule =
|
|
|
|
{ self
|
|
|
|
, specialArgs ? { }
|
|
|
|
}:
|
|
|
|
module:
|
|
|
|
|
|
|
|
lib.evalModules {
|
|
|
|
specialArgs = { inherit self flake-modules-core-lib; } // specialArgs;
|
|
|
|
modules = [ ./all-modules.nix module ];
|
|
|
|
};
|
2021-11-21 14:47:11 +00:00
|
|
|
|
|
|
|
# For extending options in an already declared submodule.
|
|
|
|
# Workaround for https://github.com/NixOS/nixpkgs/issues/146882
|
|
|
|
mkSubmoduleOptions =
|
|
|
|
options:
|
|
|
|
mkOption {
|
|
|
|
type = types.submoduleWith {
|
|
|
|
modules = [ { inherit options; } ];
|
|
|
|
};
|
|
|
|
};
|
2022-05-13 08:14:10 +00:00
|
|
|
|
|
|
|
mkPerSystemType =
|
|
|
|
module:
|
|
|
|
types.functionTo (types.submoduleWith {
|
|
|
|
modules = [ module ];
|
|
|
|
shorthandOnlyDefinesConfig = false;
|
|
|
|
});
|
|
|
|
|
|
|
|
mkPerSystemModule =
|
|
|
|
module:
|
|
|
|
mkOption {
|
|
|
|
type = flake-modules-core-lib.mkPerSystemType module;
|
|
|
|
};
|
|
|
|
|
2021-10-27 09:05:52 +00:00
|
|
|
};
|
2021-11-21 14:47:11 +00:00
|
|
|
|
2021-10-27 09:05:52 +00:00
|
|
|
in
|
|
|
|
flake-modules-core-lib
|