summaryrefslogtreecommitdiff
path: root/modules/flake/flakeModules.nix
blob: 8c27e9f1212fe0c6b1f5df0fadb3820c6fcc77cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
        '';
      };
    };
  };
}