summaryrefslogtreecommitdiffstats
path: root/default.nix
blob: 00333a860f1b6f89c2d4c248c55471468f52ad82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ lib ? import <nixpkgs/lib> }:
let
  types = import ./types.nix { inherit lib; };
  eval = cfg: lib.evalModules {
    modules = lib.singleton {
      # _file = toString input;
      imports = lib.singleton { topLevel.devices = cfg; };
      options = {
        topLevel = lib.mkOption {
          type = types.topLevel;
        };
      };
    };
  };
in {
  types = types;
  create = cfg: (eval cfg).config.topLevel.create;
  mount = cfg: (eval cfg).config.topLevel.mount;
  config = cfg: (eval cfg).config.topLevel.config;
  packages = cfg: (eval cfg).config.topLevel.packages;
}