mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-11-25 11:45:01 +03:00
29 lines
821 B
Nix
29 lines
821 B
Nix
# This is currently only used for legacy modules ported to v1.
|
|
# The dream-lock concept might be deprecated together with this module at some
|
|
# point.
|
|
{lib, ...}: let
|
|
l = builtins // lib;
|
|
|
|
getDreamLockSource = fetchedSources: pname: version:
|
|
if
|
|
fetchedSources
|
|
? "${pname}"."${version}"
|
|
&& fetchedSources."${pname}"."${version}" != "unknown"
|
|
then fetchedSources."${pname}"."${version}"
|
|
else
|
|
throw ''
|
|
The source for ${pname}#${version} is not defined.
|
|
This can be fixed via an override. Example:
|
|
```
|
|
dream2nix.make[Flake]Outputs {
|
|
...
|
|
sourceOverrides = oldSources: {
|
|
"${pname}"."${version}" = builtins.fetchurl { ... };
|
|
};
|
|
...
|
|
}
|
|
```
|
|
'';
|
|
in
|
|
getDreamLockSource
|