diff options
| author | tv <tv@krebsco.de> | 2017-07-06 21:47:47 +0200 | 
|---|---|---|
| committer | tv <tv@krebsco.de> | 2017-07-10 11:05:48 +0200 | 
| commit | 112a652a9866d18263790ce5232459d4abf042b6 (patch) | |
| tree | e953f148307fe2f1692c4925302a81515a2eaa39 /lib | |
| parent | 585c3f70f1f8fe07b977524375244ab6d1953219 (diff) | |
move source config from module system to 1systems/*/source.nix
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/default.nix | 3 | ||||
| -rw-r--r-- | lib/eval-source.nix | 17 | 
2 files changed, 20 insertions, 0 deletions
| diff --git a/lib/default.nix b/lib/default.nix index 803a614..4c54f60 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,6 +1,9 @@  let    nixpkgs-lib = import <nixpkgs/lib>;    lib = with lib; nixpkgs-lib // builtins // { + +    evalSource = import ./eval-source.nix; +      git = import ./git.nix { inherit lib; };      shell = import ./shell.nix { inherit lib; };      types = nixpkgs-lib.types // import ./types.nix { inherit lib; }; diff --git a/lib/eval-source.nix b/lib/eval-source.nix new file mode 100644 index 0000000..de5f0b4 --- /dev/null +++ b/lib/eval-source.nix @@ -0,0 +1,17 @@ +with import <stockholm/lib>; +let +  eval = _file: source: evalModules { +    modules = singleton { +      inherit _file; +      options.source = mkOption { +        type = types.attrsOf types.source; +        default = {}; +      }; +      config = { +        inherit source; +      }; +    }; +  }; +in +  # This function's return value can be used as pkgs.populate input. +  _file: source: (eval _file source).config.source | 
