summaryrefslogtreecommitdiff
path: root/modules/default.nix
blob: d32d8f64c40f421cf21221f5405c55fc51e15047 (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
26
27
{ lib, flake-parts-lib, ... }:
let
  inherit (lib) mkOption mkEnableOption types;
  inherit (flake-parts-lib) mkPerSystemOption;
in {
  options.perSystem = mkPerSystemOption ({ pkgs, system, config, ... }: {
    options.koreader = mkOption {
      default = {};
      type = types.lazyAttrsOf <| types.submoduleWith {
        shorthandOnlyDefinesConfig = true;
        modules = [
          {
            _module.args = {
              inherit pkgs lib;
            };
          }
          ({ name, ... }: {
            imports = [ ./main.nix ];
            options = {
              enable = mkEnableOption name // { default = true; };
            };
          })
        ];
      };
    };
  });
}