summary refs log tree commit diff stats
path: root/lib/default.nix
blob: 023566e5b0c14e1f231bf3bf3cb2d2c5fd36bc6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ pkgs }:
with builtins;
let
  inherit (pkgs) lib;
in
rec {
  importPathStore = p: "${append ../. "/${p}"}";

  mkPathable = s:
    if
      s.type == "local"
    then
      toString (lib.path.append ../. s.outPath)
    else
      toString s.outPath
  ;

  mkNixPath = sources: lib.attrsets.mapAttrsToList
    (k: v: "${k}=${mkPathable v}")
    (removeAttrs sources [ "__functor" ]);
}