summaryrefslogtreecommitdiffstats
path: root/default.nix
blob: 4a81f03b5169252853fcf3d3c7a9c65bf7bc423c (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 { devices = cfg; };
      options = {
        devices = lib.mkOption {
          type = types.devices;
        };
      };
    };
  };
in {
  types = types;
  create = cfg: types.diskoLib.create (eval cfg).config.devices;
  mount = cfg: types.diskoLib.mount (eval cfg).config.devices;
  config = cfg: { imports = types.diskoLib.config (eval cfg).config.devices; };
  packages = cfg: types.diskoLib.packages (eval cfg).config.devices;
}