+121
-20
packetmix/npins/default.nix
+121
-20
packetmix/npins/default.nix
···
9
9
*/
10
10
# Generated by npins. Do not modify; will be overwritten regularly
11
11
let
12
-
data = builtins.fromJSON (builtins.readFile ./sources.json);
13
-
version = data.version;
12
+
# Backwards-compatibly make something that previously didn't take any arguments take some
13
+
# The function must return an attrset, and will unfortunately be eagerly evaluated
14
+
# Same thing, but it catches eval errors on the default argument so that one may still call it with other arguments
15
+
mkFunctor =
16
+
fn:
17
+
let
18
+
e = builtins.tryEval (fn { });
19
+
in
20
+
(if e.success then e.value else { error = fn { }; }) // { __functor = _self: fn; };
14
21
15
22
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
16
23
range =
···
21
28
22
29
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
23
30
stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
24
-
concatMapStrings = f: list: concatStrings (map f list);
25
31
concatStrings = builtins.concatStringsSep "";
26
32
27
33
# If the environment variable NPINS_OVERRIDE_${name} is set, then use
···
48
54
49
55
mkSource =
50
56
name: spec:
57
+
{
58
+
pkgs ? null,
59
+
}:
51
60
assert spec ? type;
52
61
let
62
+
# Unify across builtin and pkgs fetchers.
63
+
# `fetchGit` requires a wrapper because of slight API differences.
64
+
fetchers =
65
+
if pkgs == null then
66
+
{
67
+
inherit (builtins) fetchTarball fetchurl;
68
+
# For some fucking reason, fetchGit has a different signature than the other builtin fetchers …
69
+
fetchGit = args: (builtins.fetchGit args).outPath;
70
+
}
71
+
else
72
+
{
73
+
fetchTarball =
74
+
{
75
+
url,
76
+
sha256,
77
+
}:
78
+
pkgs.fetchzip {
79
+
inherit url sha256;
80
+
extension = "tar";
81
+
};
82
+
inherit (pkgs) fetchurl;
83
+
fetchGit =
84
+
{
85
+
url,
86
+
submodules,
87
+
rev,
88
+
name,
89
+
narHash,
90
+
}:
91
+
pkgs.fetchgit {
92
+
inherit url rev name;
93
+
fetchSubmodules = submodules;
94
+
hash = narHash;
95
+
};
96
+
};
97
+
98
+
# Dispatch to the correct code path based on the type
53
99
path =
54
100
if spec.type == "Git" then
55
-
mkGitSource spec
101
+
mkGitSource fetchers spec
56
102
else if spec.type == "GitRelease" then
57
-
mkGitSource spec
103
+
mkGitSource fetchers spec
58
104
else if spec.type == "PyPi" then
59
-
mkPyPiSource spec
105
+
mkPyPiSource fetchers spec
60
106
else if spec.type == "Channel" then
61
-
mkChannelSource spec
107
+
mkChannelSource fetchers spec
62
108
else if spec.type == "Tarball" then
63
-
mkTarballSource spec
109
+
mkTarballSource fetchers spec
110
+
else if spec.type == "Container" then
111
+
mkContainerSource pkgs spec
64
112
else
65
113
builtins.throw "Unknown source type ${spec.type}";
66
114
in
···
68
116
69
117
mkGitSource =
70
118
{
119
+
fetchTarball,
120
+
fetchGit,
121
+
...
122
+
}:
123
+
{
71
124
repository,
72
125
revision,
73
126
url ? null,
74
127
submodules,
75
128
hash,
76
-
branch ? null,
77
129
...
78
130
}:
79
131
assert repository ? type;
80
132
# At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository
81
133
# In the latter case, there we will always be an url to the tarball
82
134
if url != null && !submodules then
83
-
builtins.fetchTarball {
135
+
fetchTarball {
84
136
inherit url;
85
137
sha256 = hash;
86
138
}
···
107
159
"${if matched == null then "source" else builtins.head matched}${appendShort}";
108
160
name = urlToName url revision;
109
161
in
110
-
builtins.fetchGit {
162
+
fetchGit {
111
163
rev = revision;
112
164
narHash = hash;
113
165
···
115
167
};
116
168
117
169
mkPyPiSource =
118
-
{ url, hash, ... }:
119
-
builtins.fetchurl {
170
+
{ fetchurl, ... }:
171
+
{
172
+
url,
173
+
hash,
174
+
...
175
+
}:
176
+
fetchurl {
120
177
inherit url;
121
178
sha256 = hash;
122
179
};
123
180
124
181
mkChannelSource =
125
-
{ url, hash, ... }:
126
-
builtins.fetchTarball {
182
+
{ fetchTarball, ... }:
183
+
{
184
+
url,
185
+
hash,
186
+
...
187
+
}:
188
+
fetchTarball {
127
189
inherit url;
128
190
sha256 = hash;
129
191
};
130
192
131
193
mkTarballSource =
194
+
{ fetchTarball, ... }:
132
195
{
133
196
url,
134
197
locked_url ? url,
135
198
hash,
136
199
...
137
200
}:
138
-
builtins.fetchTarball {
201
+
fetchTarball {
139
202
url = locked_url;
140
203
sha256 = hash;
141
204
};
205
+
206
+
mkContainerSource =
207
+
pkgs:
208
+
{
209
+
image_name,
210
+
image_tag,
211
+
image_digest,
212
+
...
213
+
}:
214
+
if pkgs == null then
215
+
builtins.throw "container sources require passing in a Nixpkgs value: https://github.com/andir/npins/blob/master/README.md#using-the-nixpkgs-fetchers"
216
+
else
217
+
pkgs.dockerTools.pullImage {
218
+
imageName = image_name;
219
+
imageDigest = image_digest;
220
+
finalImageTag = image_tag;
221
+
};
142
222
in
143
-
if version == 6 then
144
-
builtins.mapAttrs mkSource data.pins
145
-
else
146
-
throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"
223
+
mkFunctor (
224
+
{
225
+
input ? ./sources.json,
226
+
}:
227
+
let
228
+
data =
229
+
if builtins.isPath input then
230
+
# while `readFile` will throw an error anyways if the path doesn't exist,
231
+
# we still need to check beforehand because *our* error can be caught but not the one from the builtin
232
+
# *piegames sighs*
233
+
if builtins.pathExists input then
234
+
builtins.fromJSON (builtins.readFile input)
235
+
else
236
+
throw "Input path ${toString input} does not exist"
237
+
else if builtins.isAttrs input then
238
+
input
239
+
else
240
+
throw "Unsupported input type ${builtins.typeOf input}, must be a path or an attrset";
241
+
version = data.version;
242
+
in
243
+
if version == 7 then
244
+
builtins.mapAttrs (name: spec: mkFunctor (mkSource name spec)) data.pins
245
+
else
246
+
throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"
247
+
)
+53
-53
packetmix/npins/sources.json
+53
-53
packetmix/npins/sources.json
···
61
61
},
62
62
"branch": "main",
63
63
"submodules": false,
64
-
"revision": "c518cf4f62659d9cf585da6f29b67f8a77d0fbc0",
65
-
"url": "https://github.com/bluesky-social/atproto/archive/c518cf4f62659d9cf585da6f29b67f8a77d0fbc0.tar.gz",
66
-
"hash": "sha256-fW9BKtG9vptNYzCh/AWf8m9QoPEGX6najSFlAekElHA="
64
+
"revision": "532b22822f2c57d2c7b59ea6ac74e56fc02c4131",
65
+
"url": "https://github.com/bluesky-social/atproto/archive/532b22822f2c57d2c7b59ea6ac74e56fc02c4131.tar.gz",
66
+
"hash": "sha256-hVU8dlDQDD09Oz3o30JY21sNjVCfq6Tfg8umwNiBu5Y="
67
67
},
68
68
"catppuccin": {
69
69
"type": "Git",
···
88
88
},
89
89
"branch": "master",
90
90
"submodules": false,
91
-
"revision": "8395ec4576cf54411d974675d26f64208acdcee0",
92
-
"url": "https://gitlab.collabora.com/api/v4/projects/collabora%2Fgtimelog/repository/archive.tar.gz?sha=8395ec4576cf54411d974675d26f64208acdcee0",
93
-
"hash": "sha256-M9pCF+XVf5ylxgq0BSUn5Vkg1HZ6i88LDiUDM4Y1Ghs="
91
+
"revision": "1be9d9f7e844831f221b67a46a55fc47a164e416",
92
+
"url": "https://gitlab.collabora.com/api/v4/projects/collabora%2Fgtimelog/repository/archive.tar.gz?sha=1be9d9f7e844831f221b67a46a55fc47a164e416",
93
+
"hash": "sha256-v5WEa7M0mmrxdU1l7nIqyrMaVy2jiJNnXHLiHnw2xIc="
94
94
},
95
95
"copyparty": {
96
96
"type": "GitRelease",
···
103
103
"version_upper_bound": null,
104
104
"release_prefix": null,
105
105
"submodules": false,
106
-
"version": "v1.19.17",
107
-
"revision": "e2a15a3a922514efe97afc4afa043cd7c4619ad1",
108
-
"url": "https://api.github.com/repos/9001/copyparty/tarball/refs/tags/v1.19.17",
109
-
"hash": "sha256-Rb6Lq2CW+LrIH8M4sCPA8k12GX7xNUWK4I+xeByLl+M="
106
+
"version": "v1.19.20",
107
+
"revision": "450cd86dc1e98b98ab131fc9417c83289165a507",
108
+
"url": "https://api.github.com/repos/9001/copyparty/tarball/refs/tags/v1.19.20",
109
+
"hash": "sha256-/Wm8hZvdGfYWdTOF+dgTPX8DGuSKLhGw4qC4crf1dAo="
110
110
},
111
111
"headscale": {
112
112
"type": "Git",
···
117
117
},
118
118
"branch": "main",
119
119
"submodules": false,
120
-
"revision": "8010cc574ea309728f5c7d3fd1cb08252f0111f5",
121
-
"url": "https://github.com/juanfont/headscale/archive/8010cc574ea309728f5c7d3fd1cb08252f0111f5.tar.gz",
122
-
"hash": "sha256-lQhaw7SVV+qBEZnH8u+gsEwqIByFlZQyjDJ3RbW7uzM="
120
+
"revision": "2024219bd10adbb5c0d29f900ed0961ace8cc15c",
121
+
"url": "https://github.com/juanfont/headscale/archive/2024219bd10adbb5c0d29f900ed0961ace8cc15c.tar.gz",
122
+
"hash": "sha256-fWpOvGq+/0Wk1bBELw0CfW1qGffzEK5Dp408fIkr43o="
123
123
},
124
124
"home-manager": {
125
125
"type": "Git",
···
143
143
},
144
144
"branch": "master",
145
145
"submodules": false,
146
-
"revision": "189c21cf879669008ccf06e78a553f17e88d8ef0",
147
-
"url": "https://github.com/nix-community/home-manager/archive/189c21cf879669008ccf06e78a553f17e88d8ef0.tar.gz",
148
-
"hash": "sha256-nZh6uvc71nVNaf/y+wesnjwsmJ6IZZUnP2EzpZe48To="
146
+
"revision": "0562fef070a1027325dd4ea10813d64d2c967b39",
147
+
"url": "https://github.com/nix-community/home-manager/archive/0562fef070a1027325dd4ea10813d64d2c967b39.tar.gz",
148
+
"hash": "sha256-33YUsWpPyeBZEWrKQ2a1gkRZ7i0XCC/2MYpU6BVeQSU="
149
149
},
150
150
"impermanence": {
151
151
"type": "Git",
···
171
171
"version_upper_bound": null,
172
172
"release_prefix": null,
173
173
"submodules": false,
174
-
"version": "v0.4.2",
175
-
"revision": "f0212638a2ec787a7841882f4477d40ae24f0a5d",
176
-
"url": "https://api.github.com/repos/nix-community/lanzaboote/tarball/refs/tags/v0.4.2",
177
-
"hash": "sha256-AEEDktApTEZ5PZXNDkry2YV2k6t0dTgLPEmAZbnigXU="
174
+
"version": "v0.4.3",
175
+
"revision": "65a4aa3d4dccf50f22c0190c7ee660de51c586f2",
176
+
"url": "https://api.github.com/repos/nix-community/lanzaboote/tarball/refs/tags/v0.4.3",
177
+
"hash": "sha256-If6vQ+KvtKs3ARBO9G3l+4wFSCYtRBrwX1z+I+B61wQ="
178
178
},
179
179
"lix": {
180
180
"type": "Git",
···
186
186
},
187
187
"branch": "main",
188
188
"submodules": false,
189
-
"revision": "2d2cd7ac03311bddb9645a7ab82c7e78edccbaa0",
190
-
"url": "https://git.lix.systems/lix-project/lix/archive/2d2cd7ac03311bddb9645a7ab82c7e78edccbaa0.tar.gz",
191
-
"hash": "sha256-jUn34QOaXqguaH+WwB2xWRHlmelvzJfFuEcQrC1cwK0="
189
+
"revision": "3ad1af8a9883986eb95744e088eab15c752c339c",
190
+
"url": "https://git.lix.systems/lix-project/lix/archive/3ad1af8a9883986eb95744e088eab15c752c339c.tar.gz",
191
+
"hash": "sha256-N176NqnIhym6Ki8G13heS73I4b30ZJ2QGYhP9eL0+Zs="
192
192
},
193
193
"lix-module": {
194
194
"type": "Git",
···
200
200
},
201
201
"branch": "main",
202
202
"submodules": false,
203
-
"revision": "7c31a18259b8358ac196cf803a26967c0fa1d3e4",
204
-
"url": "https://git.lix.systems/lix-project/nixos-module/archive/7c31a18259b8358ac196cf803a26967c0fa1d3e4.tar.gz",
205
-
"hash": "sha256-n5dRAIC3/78drQtFxmQRrBLd6TKfotUnX7GWu0mAcSg="
203
+
"revision": "c47f62187601ea2991b79a9bacdbfdf76cd29fbe",
204
+
"url": "https://git.lix.systems/lix-project/nixos-module/archive/c47f62187601ea2991b79a9bacdbfdf76cd29fbe.tar.gz",
205
+
"hash": "sha256-FvuAw56NIVJpS3Kr8Wv9PpU4eehZMcdIVkxjStuYmqc="
206
206
},
207
207
"lua-multipart": {
208
208
"type": "GitRelease",
···
231
231
"version_upper_bound": null,
232
232
"release_prefix": null,
233
233
"submodules": false,
234
-
"version": "v0.0.0-alpha.14",
235
-
"revision": "2e98ae315a592ad6b6de44670514c048dcc88dc7",
236
-
"url": "https://api.github.com/repos/nilla-nix/nilla/tarball/refs/tags/v0.0.0-alpha.14",
237
-
"hash": "sha256-15lwhWcMonJH6UholMMHDc+p2BoSpGA4AYGrsXQA9Do="
234
+
"version": "v0.0.0-alpha.15",
235
+
"revision": "b617bdbaa5faa9345ca077cd497372ece77bf119",
236
+
"url": "https://api.github.com/repos/nilla-nix/nilla/tarball/refs/tags/v0.0.0-alpha.15",
237
+
"hash": "sha256-eCKqHY7uUiNqmP0XqWlXxpBLABuk65MRPLH2INFEE5U="
238
238
},
239
239
"nilla-cli": {
240
240
"type": "Git",
···
245
245
},
246
246
"branch": "main",
247
247
"submodules": false,
248
-
"revision": "6c6c42eaae3d095de6d1b47396c8b74ea57cb442",
249
-
"url": "https://github.com/nilla-nix/cli/archive/6c6c42eaae3d095de6d1b47396c8b74ea57cb442.tar.gz",
250
-
"hash": "sha256-0+d6LZfofBG+4OxnZcFaNg2ycgj1zcOJQUcPL1TEaSc="
248
+
"revision": "aa042dbd9152c99e5a8db51bcf87306737423b9e",
249
+
"url": "https://github.com/nilla-nix/cli/archive/aa042dbd9152c99e5a8db51bcf87306737423b9e.tar.gz",
250
+
"hash": "sha256-cPdYYXhCsDllVgq+gs5Wqhb41bFtKWHlkTvjOJv7its="
251
251
},
252
252
"nilla-home": {
253
253
"type": "GitRelease",
···
287
287
},
288
288
"branch": "main",
289
289
"submodules": false,
290
-
"revision": "f851a923137c0a54719412146fd63d24b3214e60",
291
-
"url": "https://github.com/sodiboo/niri-flake/archive/f851a923137c0a54719412146fd63d24b3214e60.tar.gz",
292
-
"hash": "sha256-E2ySTu/oK7cYBdAI3tlGP9zVjF4mZgWJ1OZInBCMb00="
290
+
"revision": "75bacb66302bca38fa6e0c180f1e5369a8115454",
291
+
"url": "https://github.com/sodiboo/niri-flake/archive/75bacb66302bca38fa6e0c180f1e5369a8115454.tar.gz",
292
+
"hash": "sha256-AZ/xrJ5JXvpRQYyiVf8Hx4lzFBQAaH9l0utOfvAA28I="
293
293
},
294
294
"nix-index-database": {
295
295
"type": "Git",
···
300
300
},
301
301
"branch": "main",
302
302
"submodules": false,
303
-
"revision": "5024e1901239a76b7bf94a4cd27f3507e639d49e",
304
-
"url": "https://github.com/nix-community/nix-index-database/archive/5024e1901239a76b7bf94a4cd27f3507e639d49e.tar.gz",
305
-
"hash": "sha256-xmU8kAsRprJiTGBTaGrwmjBP3AMA9ltlrxHKFuy5JWc="
303
+
"revision": "359ff6333a7b0b60819d4c20ed05a3a1f726771f",
304
+
"url": "https://github.com/nix-community/nix-index-database/archive/359ff6333a7b0b60819d4c20ed05a3a1f726771f.tar.gz",
305
+
"hash": "sha256-Pu1v3mlFhRzZiSxVHb2/i/f5yeYyRNqr0RvEUJ4UgHo="
306
306
},
307
307
"nix-monitored": {
308
308
"type": "Git",
···
320
320
"nixos-unstable": {
321
321
"type": "Channel",
322
322
"name": "nixos-unstable",
323
-
"url": "https://releases.nixos.org/nixos/unstable/nixos-25.11pre880095.5e2a59a5b1a8/nixexprs.tar.xz",
324
-
"hash": "sha256-u0JUo46QSoXnjLaezAM75wRNuxVMVbm5OxHH122TeTY="
323
+
"url": "https://releases.nixos.org/nixos/unstable/nixos-25.11pre889928.ae814fd3904b/nixexprs.tar.xz",
324
+
"hash": "sha256-RCg6EE0WY/2bcLCMRE2eYRs610kHisK3vc3xo8nKeeY="
325
325
},
326
326
"nixpkgs": {
327
327
"type": "Channel",
328
328
"name": "nixos-25.05",
329
-
"url": "https://releases.nixos.org/nixos/25.05/nixos-25.05.811497.33c6dca0c0cb/nixexprs.tar.xz",
330
-
"hash": "sha256-Z7kbKnORypPkJ74r6sHA2RQH1XATHLWiGgZVrli0scY="
329
+
"url": "https://releases.nixos.org/nixos/25.05/nixos-25.05.812554.6faeb062ee4c/nixexprs.tar.xz",
330
+
"hash": "sha256-aIePlSVgncfoNZHebbu/yfdhMwkzkeCX08zye8PvQmY="
331
331
},
332
332
"npins": {
333
333
"type": "Git",
···
363
363
},
364
364
"branch": "master",
365
365
"submodules": false,
366
-
"revision": "7d1888abf8c5b82692476a9de2137a024d484771",
366
+
"revision": "2e5a4cde904d86825cefe5971e68f1bdfb1dd36f",
367
367
"url": null,
368
-
"hash": "sha256-WD/UFUMcXMV/3tqD4h2tPaQH1KDlsJ00M+T4N/xkAGs="
368
+
"hash": "sha256-qDVJ2sEQL0TJbWer6ByhhQrzHE1bZI3U1mmCk0sPZqo="
369
369
},
370
370
"treefmt-nix": {
371
371
"type": "Git",
···
376
376
},
377
377
"branch": "main",
378
378
"submodules": false,
379
-
"revision": "f56b1934f5f8fcab8deb5d38d42fd692632b47c2",
380
-
"url": "https://github.com/numtide/treefmt-nix/archive/f56b1934f5f8fcab8deb5d38d42fd692632b47c2.tar.gz",
381
-
"hash": "sha256-ZRVs8UqikBa4Ki3X4KCnMBtBW0ux1DaT35tgsnB1jM4="
379
+
"revision": "97a30861b13c3731a84e09405414398fbf3e109f",
380
+
"url": "https://github.com/numtide/treefmt-nix/archive/97a30861b13c3731a84e09405414398fbf3e109f.tar.gz",
381
+
"hash": "sha256-aF5fvoZeoXNPxT0bejFUBXeUjXfHLSL7g+mjR/p5TEg="
382
382
},
383
383
"walker": {
384
384
"type": "GitRelease",
···
391
391
"version_upper_bound": null,
392
392
"release_prefix": null,
393
393
"submodules": false,
394
-
"version": "v2.5.5",
395
-
"revision": "ff292cb12c4816ce21dab47cd9894b8046b16a93",
396
-
"url": "https://api.github.com/repos/abenz1267/walker/tarball/refs/tags/v2.5.5",
397
-
"hash": "sha256-xc0yW9OhLTppjkaWWCWG9q4BVJZbhnLqLniLeMkcTvM="
394
+
"version": "v2.9.3",
395
+
"revision": "6ade427b3cc347ad5363471c6c5fca46d8c81c9a",
396
+
"url": "https://api.github.com/repos/abenz1267/walker/tarball/refs/tags/v2.9.3",
397
+
"hash": "sha256-yJKjyURwPfH3QN5e4ettmhctgieBeKTx7z7huFtMhiQ="
398
398
}
399
399
},
400
-
"version": 6
400
+
"version": 7
401
401
}
+1
-1
packetmix/systems/midnight/spindle.nix
+1
-1
packetmix/systems/midnight/spindle.nix
+121
-20
sprinkles/npins/default.nix
+121
-20
sprinkles/npins/default.nix
···
9
9
*/
10
10
# Generated by npins. Do not modify; will be overwritten regularly
11
11
let
12
-
data = builtins.fromJSON (builtins.readFile ./sources.json);
13
-
version = data.version;
12
+
# Backwards-compatibly make something that previously didn't take any arguments take some
13
+
# The function must return an attrset, and will unfortunately be eagerly evaluated
14
+
# Same thing, but it catches eval errors on the default argument so that one may still call it with other arguments
15
+
mkFunctor =
16
+
fn:
17
+
let
18
+
e = builtins.tryEval (fn { });
19
+
in
20
+
(if e.success then e.value else { error = fn { }; }) // { __functor = _self: fn; };
14
21
15
22
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
16
23
range =
···
21
28
22
29
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
23
30
stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
24
-
concatMapStrings = f: list: concatStrings (map f list);
25
31
concatStrings = builtins.concatStringsSep "";
26
32
27
33
# If the environment variable NPINS_OVERRIDE_${name} is set, then use
···
48
54
49
55
mkSource =
50
56
name: spec:
57
+
{
58
+
pkgs ? null,
59
+
}:
51
60
assert spec ? type;
52
61
let
62
+
# Unify across builtin and pkgs fetchers.
63
+
# `fetchGit` requires a wrapper because of slight API differences.
64
+
fetchers =
65
+
if pkgs == null then
66
+
{
67
+
inherit (builtins) fetchTarball fetchurl;
68
+
# For some fucking reason, fetchGit has a different signature than the other builtin fetchers …
69
+
fetchGit = args: (builtins.fetchGit args).outPath;
70
+
}
71
+
else
72
+
{
73
+
fetchTarball =
74
+
{
75
+
url,
76
+
sha256,
77
+
}:
78
+
pkgs.fetchzip {
79
+
inherit url sha256;
80
+
extension = "tar";
81
+
};
82
+
inherit (pkgs) fetchurl;
83
+
fetchGit =
84
+
{
85
+
url,
86
+
submodules,
87
+
rev,
88
+
name,
89
+
narHash,
90
+
}:
91
+
pkgs.fetchgit {
92
+
inherit url rev name;
93
+
fetchSubmodules = submodules;
94
+
hash = narHash;
95
+
};
96
+
};
97
+
98
+
# Dispatch to the correct code path based on the type
53
99
path =
54
100
if spec.type == "Git" then
55
-
mkGitSource spec
101
+
mkGitSource fetchers spec
56
102
else if spec.type == "GitRelease" then
57
-
mkGitSource spec
103
+
mkGitSource fetchers spec
58
104
else if spec.type == "PyPi" then
59
-
mkPyPiSource spec
105
+
mkPyPiSource fetchers spec
60
106
else if spec.type == "Channel" then
61
-
mkChannelSource spec
107
+
mkChannelSource fetchers spec
62
108
else if spec.type == "Tarball" then
63
-
mkTarballSource spec
109
+
mkTarballSource fetchers spec
110
+
else if spec.type == "Container" then
111
+
mkContainerSource pkgs spec
64
112
else
65
113
builtins.throw "Unknown source type ${spec.type}";
66
114
in
···
68
116
69
117
mkGitSource =
70
118
{
119
+
fetchTarball,
120
+
fetchGit,
121
+
...
122
+
}:
123
+
{
71
124
repository,
72
125
revision,
73
126
url ? null,
74
127
submodules,
75
128
hash,
76
-
branch ? null,
77
129
...
78
130
}:
79
131
assert repository ? type;
80
132
# At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository
81
133
# In the latter case, there we will always be an url to the tarball
82
134
if url != null && !submodules then
83
-
builtins.fetchTarball {
135
+
fetchTarball {
84
136
inherit url;
85
137
sha256 = hash;
86
138
}
···
107
159
"${if matched == null then "source" else builtins.head matched}${appendShort}";
108
160
name = urlToName url revision;
109
161
in
110
-
builtins.fetchGit {
162
+
fetchGit {
111
163
rev = revision;
112
164
narHash = hash;
113
165
···
115
167
};
116
168
117
169
mkPyPiSource =
118
-
{ url, hash, ... }:
119
-
builtins.fetchurl {
170
+
{ fetchurl, ... }:
171
+
{
172
+
url,
173
+
hash,
174
+
...
175
+
}:
176
+
fetchurl {
120
177
inherit url;
121
178
sha256 = hash;
122
179
};
123
180
124
181
mkChannelSource =
125
-
{ url, hash, ... }:
126
-
builtins.fetchTarball {
182
+
{ fetchTarball, ... }:
183
+
{
184
+
url,
185
+
hash,
186
+
...
187
+
}:
188
+
fetchTarball {
127
189
inherit url;
128
190
sha256 = hash;
129
191
};
130
192
131
193
mkTarballSource =
194
+
{ fetchTarball, ... }:
132
195
{
133
196
url,
134
197
locked_url ? url,
135
198
hash,
136
199
...
137
200
}:
138
-
builtins.fetchTarball {
201
+
fetchTarball {
139
202
url = locked_url;
140
203
sha256 = hash;
141
204
};
205
+
206
+
mkContainerSource =
207
+
pkgs:
208
+
{
209
+
image_name,
210
+
image_tag,
211
+
image_digest,
212
+
...
213
+
}:
214
+
if pkgs == null then
215
+
builtins.throw "container sources require passing in a Nixpkgs value: https://github.com/andir/npins/blob/master/README.md#using-the-nixpkgs-fetchers"
216
+
else
217
+
pkgs.dockerTools.pullImage {
218
+
imageName = image_name;
219
+
imageDigest = image_digest;
220
+
finalImageTag = image_tag;
221
+
};
142
222
in
143
-
if version == 6 then
144
-
builtins.mapAttrs mkSource data.pins
145
-
else
146
-
throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"
223
+
mkFunctor (
224
+
{
225
+
input ? ./sources.json,
226
+
}:
227
+
let
228
+
data =
229
+
if builtins.isPath input then
230
+
# while `readFile` will throw an error anyways if the path doesn't exist,
231
+
# we still need to check beforehand because *our* error can be caught but not the one from the builtin
232
+
# *piegames sighs*
233
+
if builtins.pathExists input then
234
+
builtins.fromJSON (builtins.readFile input)
235
+
else
236
+
throw "Input path ${toString input} does not exist"
237
+
else if builtins.isAttrs input then
238
+
input
239
+
else
240
+
throw "Unsupported input type ${builtins.typeOf input}, must be a path or an attrset";
241
+
version = data.version;
242
+
in
243
+
if version == 7 then
244
+
builtins.mapAttrs (name: spec: mkFunctor (mkSource name spec)) data.pins
245
+
else
246
+
throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"
247
+
)
+13
-13
sprinkles/npins/sources.json
+13
-13
sprinkles/npins/sources.json
···
9
9
},
10
10
"branch": "monthly",
11
11
"submodules": false,
12
-
"revision": "f44d7c3596ff028ad9f7fcc31d1941ed585f11b3",
13
-
"url": "https://github.com/nix-community/fenix/archive/f44d7c3596ff028ad9f7fcc31d1941ed585f11b3.tar.gz",
14
-
"hash": "sha256-6RzWfxENGlO73jQb3uQNgOvubUFwvveeIg+PZxhAu6s="
12
+
"revision": "3107255abfe4f2d1c3eee7a3e2f5a5eb6f2200fe",
13
+
"url": "https://github.com/nix-community/fenix/archive/3107255abfe4f2d1c3eee7a3e2f5a5eb6f2200fe.tar.gz",
14
+
"hash": "sha256-isqMvjTk3jdTHN6KA/BWQvOSVe7O35OQKAZNtLK76OY="
15
15
},
16
16
"nilla": {
17
17
"type": "Git",
···
22
22
},
23
23
"branch": "main",
24
24
"submodules": false,
25
-
"revision": "4e6038f4ebc89487194013af6a1e077dfeb00359",
26
-
"url": "https://github.com/nilla-nix/nilla/archive/4e6038f4ebc89487194013af6a1e077dfeb00359.tar.gz",
27
-
"hash": "sha256-7iLzbTLtgdFtm9em3xxHO9BunN2YpgYquMLKXh5hEpQ="
25
+
"revision": "b617bdbaa5faa9345ca077cd497372ece77bf119",
26
+
"url": "https://github.com/nilla-nix/nilla/archive/b617bdbaa5faa9345ca077cd497372ece77bf119.tar.gz",
27
+
"hash": "sha256-eCKqHY7uUiNqmP0XqWlXxpBLABuk65MRPLH2INFEE5U="
28
28
},
29
29
"nixpkgs": {
30
30
"type": "Git",
···
35
35
},
36
36
"branch": "nixos-unstable",
37
37
"submodules": false,
38
-
"revision": "a84ebe20c6bc2ecbcfb000a50776219f48d134cc",
39
-
"url": "https://github.com/nixos/nixpkgs/archive/a84ebe20c6bc2ecbcfb000a50776219f48d134cc.tar.gz",
40
-
"hash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ="
38
+
"revision": "ae814fd3904b621d8ab97418f1d0f2eb0d3716f4",
39
+
"url": "https://github.com/nixos/nixpkgs/archive/ae814fd3904b621d8ab97418f1d0f2eb0d3716f4.tar.gz",
40
+
"hash": "sha256-YRqMDEtSMbitIMj+JLpheSz0pwEr0Rmy5mC7myl17xs="
41
41
},
42
42
"quickshell": {
43
43
"type": "GitRelease",
···
49
49
"version_upper_bound": null,
50
50
"release_prefix": null,
51
51
"submodules": false,
52
-
"version": "v0.2.0",
53
-
"revision": "a5431dd02dc23d9ef1680e67777fed00fe5f7cda",
52
+
"version": "v0.2.1",
53
+
"revision": "a1a150fab00a93ea983aaca5df55304bc837f51b",
54
54
"url": null,
55
-
"hash": "sha256-vqkSDvh7hWhPvNjMjEDV4KbSCv2jyl2Arh73ZXe274k="
55
+
"hash": "sha256-e++Ogy91Sv7gGLMdAqZaBzbH/UmPWZ4GAt7VDCA66aU="
56
56
}
57
57
},
58
-
"version": 6
58
+
"version": 7
59
59
}