summaryrefslogtreecommitdiff
path: root/modules/flake/flakeModules.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-05-08 00:18:25 -0400
committerseth <[email protected]>2023-05-08 00:18:25 -0400
commit150bf82391638a4ea6a514fbd4704bb62ab22eb6 (patch)
tree493a04061ec18101aa259d7555496809650831d8 /modules/flake/flakeModules.nix
parent5d3773f5ce23f0a07f73761d177130d885232a11 (diff)
feat: add flake-parts modules
Diffstat (limited to 'modules/flake/flakeModules.nix')
-rw-r--r--modules/flake/flakeModules.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/flake/flakeModules.nix b/modules/flake/flakeModules.nix
new file mode 100644
index 0000000..8c27e9f
--- /dev/null
+++ b/modules/flake/flakeModules.nix
@@ -0,0 +1,25 @@
+{
+ self,
+ lib,
+ flake-parts-lib,
+ ...
+}: let
+ inherit (lib) mapAttrs mkOption types;
+ inherit (flake-parts-lib) mkSubmoduleOptions;
+in {
+ options = {
+ flake = mkSubmoduleOptions {
+ flakeModules = mkOption {
+ type = types.lazyAttrsOf types.unspecified;
+ default = {};
+ apply = mapAttrs (k: v: {
+ _file = "${toString self.outPath}/flake.nix#flakeModules.${k}";
+ imports = [v];
+ });
+ description = ''
+ flake-parts modules
+ '';
+ };
+ };
+ };
+}