summaryrefslogtreecommitdiffstats
path: root/default.nix
blob: 98f521344650b7533449ea174d0b9583b8d3556e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{ 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;
}