mirror of
https://github.com/nix-community/disko.git
synced 2024-11-04 05:44:29 +03:00
dcb0c42857
This should make the code cleaner, more robust and errors should be clearer. we also changed the configuration format a bit.
23 lines
558 B
Nix
23 lines
558 B
Nix
{ lib ? import <nixpkgs/lib>
|
|
, pkgs ? import <nixpkgs> {}
|
|
}:
|
|
let
|
|
types = import ./types.nix { inherit pkgs; };
|
|
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;
|
|
}
|