I tried to use this as a flake input, but due to the inability to pass the system it seems to be an impossible task.
|
mkConfig = |
|
{ sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null |
|
, sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) |
|
, system ? builtins.currentSystem |
|
, pkgs ? mkPkgs sources system |
|
}: rec { |
|
# The sources, i.e. the attribute set of spec name to spec |
|
inherit sources; |
|
|
|
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers |
|
inherit pkgs; |
|
}; |
|
|
|
in |
|
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } |