mirror of
https://github.com/NotAShelf/nyxexprs.git
synced 2025-10-02 06:53:33 +00:00
treewide: switch to npins
This commit is contained in:
parent
0eef5abf3f
commit
65f49835f6
7 changed files with 193 additions and 76 deletions
47
npins/default.nix
Normal file
47
npins/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
# Generated by npins. Do not modify; will be overwritten regularly
|
||||
let
|
||||
data = builtins.fromJSON (builtins.readFile ./sources.json);
|
||||
version = data.version;
|
||||
|
||||
mkSource = spec:
|
||||
assert spec ? type; let
|
||||
path =
|
||||
if spec.type == "Git" then mkGitSource spec
|
||||
else if spec.type == "GitRelease" then mkGitSource spec
|
||||
else if spec.type == "PyPi" then mkPyPiSource spec
|
||||
else if spec.type == "Channel" then mkChannelSource spec
|
||||
else builtins.throw "Unknown source type ${spec.type}";
|
||||
in
|
||||
spec // { outPath = path; };
|
||||
|
||||
mkGitSource = { repository, revision, url ? null, hash, ... }:
|
||||
assert repository ? type;
|
||||
# At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository
|
||||
# In the latter case, there we will always be an url to the tarball
|
||||
if url != null then
|
||||
(builtins.fetchTarball {
|
||||
inherit url;
|
||||
sha256 = hash; # FIXME: check nix version & use SRI hashes
|
||||
})
|
||||
else assert repository.type == "Git"; builtins.fetchGit {
|
||||
url = repository.url;
|
||||
rev = revision;
|
||||
# hash = hash;
|
||||
};
|
||||
|
||||
mkPyPiSource = { url, hash, ... }:
|
||||
builtins.fetchurl {
|
||||
inherit url;
|
||||
sha256 = hash;
|
||||
};
|
||||
|
||||
mkChannelSource = { url, hash, ... }:
|
||||
builtins.fetchTarball {
|
||||
inherit url;
|
||||
sha256 = hash;
|
||||
};
|
||||
in
|
||||
if version == 3 then
|
||||
builtins.mapAttrs (_: mkSource) data.pins
|
||||
else
|
||||
throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"
|
53
npins/sources.json
Normal file
53
npins/sources.json
Normal file
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"pins": {
|
||||
"ani-cli": {
|
||||
"type": "GitRelease",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "pystardust",
|
||||
"repo": "ani-cli"
|
||||
},
|
||||
"pre_releases": false,
|
||||
"version_upper_bound": null,
|
||||
"version": "v4.6",
|
||||
"revision": "c7e6838647b57411d791bd250417eb0925d74cca",
|
||||
"url": "https://api.github.com/repos/pystardust/ani-cli/tarball/v4.6",
|
||||
"hash": "1ni9pzjb5qh87iz7c8252bx79qadr1qx6jnkqvvjcqrchh7q473a"
|
||||
},
|
||||
"cloneit": {
|
||||
"type": "GitRelease",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "alok8bb",
|
||||
"repo": "cloneit"
|
||||
},
|
||||
"pre_releases": false,
|
||||
"version_upper_bound": null,
|
||||
"version": "0.1.0",
|
||||
"revision": "44402e101b18be0764ddb0b49bf0393e2e83c9c3",
|
||||
"url": "https://api.github.com/repos/alok8bb/cloneit/tarball/0.1.0",
|
||||
"hash": "18z4vxrfvyp20kig2s9k5y3034nw39wkj8zzk9qskiisv2ypy90b"
|
||||
},
|
||||
"mov-cli": {
|
||||
"type": "GitRelease",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "mov-cli",
|
||||
"repo": "mov-cli"
|
||||
},
|
||||
"pre_releases": false,
|
||||
"version_upper_bound": null,
|
||||
"version": "1.5.4",
|
||||
"revision": "5f0ec5a69d37b286966d39b6596b3b76d5302387",
|
||||
"url": "https://api.github.com/repos/mov-cli/mov-cli/tarball/1.5.4",
|
||||
"hash": "0n6k9vyq21r88x5zgidaafjlhia20dx0psdpys7dyfr8azh0y6js"
|
||||
},
|
||||
"nixpkgs": {
|
||||
"type": "Channel",
|
||||
"name": "nixpkgs-unstable",
|
||||
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-23.11pre543441.b644d97bda6d/nixexprs.tar.xz",
|
||||
"hash": "1xq7rz2bcb115xkahpvslsqpliisv2587z93izz81lna77r4na1d"
|
||||
}
|
||||
},
|
||||
"version": 3
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue