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