mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-26 16:03:38 +03:00
42 lines
650 B
Nix
42 lines
650 B
Nix
|
{
|
||
|
fetchurl,
|
||
|
lib,
|
||
|
python3,
|
||
|
|
||
|
utils,
|
||
|
...
|
||
|
}:
|
||
|
{
|
||
|
|
||
|
inputs = [
|
||
|
"pname"
|
||
|
"version"
|
||
|
];
|
||
|
|
||
|
versionField = "version";
|
||
|
|
||
|
# defaultUpdater = "";
|
||
|
|
||
|
outputs = { pname, version, ... }@inp:
|
||
|
let
|
||
|
b = builtins;
|
||
|
|
||
|
submodule = lib.last (lib.splitString "/" pname);
|
||
|
url = "https://registry.npmjs.org/${pname}/-/${submodule}-${version}.tgz";
|
||
|
in
|
||
|
{
|
||
|
|
||
|
calcHash = algo: utils.hashPath algo (
|
||
|
b.fetchurl { inherit url; }
|
||
|
);
|
||
|
|
||
|
fetched = hash:
|
||
|
(fetchurl {
|
||
|
inherit url;
|
||
|
sha256 = hash;
|
||
|
}).overrideAttrs (old: {
|
||
|
outputHashMode = "recursive";
|
||
|
});
|
||
|
};
|
||
|
}
|