2022-09-13 14:21:37 +03:00
|
|
|
{ lib ? import <nixpkgs/lib> }:
|
2022-08-24 23:24:33 +03:00
|
|
|
let
|
2022-09-13 14:21:37 +03:00
|
|
|
types = import ./types.nix { inherit lib; };
|
2022-08-29 12:45:19 +03:00
|
|
|
eval = cfg: lib.evalModules {
|
|
|
|
modules = lib.singleton {
|
|
|
|
# _file = toString input;
|
|
|
|
imports = lib.singleton { topLevel.devices = cfg; };
|
|
|
|
options = {
|
|
|
|
topLevel = lib.mkOption {
|
|
|
|
type = types.topLevel;
|
|
|
|
};
|
|
|
|
};
|
2022-08-25 16:08:26 +03:00
|
|
|
};
|
|
|
|
};
|
2022-08-29 12:45:19 +03:00
|
|
|
in {
|
|
|
|
types = types;
|
|
|
|
create = cfg: (eval cfg).config.topLevel.create;
|
|
|
|
mount = cfg: (eval cfg).config.topLevel.mount;
|
|
|
|
config = cfg: (eval cfg).config.topLevel.config;
|
2022-10-21 23:25:20 +03:00
|
|
|
packages = cfg: (eval cfg).config.topLevel.packages;
|
2018-09-11 21:52:12 +03:00
|
|
|
}
|