|
2 | 2 | description = "The PureScript Registry"; |
3 | 3 |
|
4 | 4 | inputs = { |
5 | | - nixpkgs.url = "github:nixos/nixpkgs/release-24.05"; |
| 5 | + nixpkgs.url = "github:nixos/nixpkgs/release-25.05"; |
6 | 6 | flake-utils.url = "github:numtide/flake-utils"; |
7 | 7 |
|
8 | 8 | flake-compat.url = "github:edolstra/flake-compat"; |
|
11 | 11 | purescript-overlay.url = "github:thomashoneyman/purescript-overlay"; |
12 | 12 | purescript-overlay.inputs.nixpkgs.follows = "nixpkgs"; |
13 | 13 |
|
| 14 | + mkSpagoDerivation.url = "github:jeslie0/mkSpagoDerivation"; |
| 15 | + mkSpagoDerivation.inputs.nixpkgs.follows = "nixpkgs"; |
| 16 | + mkSpagoDerivation.inputs.ps-overlay.follows = "purescript-overlay"; |
| 17 | + |
14 | 18 | slimlock.url = "github:thomashoneyman/slimlock"; |
15 | 19 | slimlock.inputs.nixpkgs.follows = "nixpkgs"; |
16 | 20 | }; |
17 | 21 |
|
18 | 22 | outputs = |
19 | 23 | { |
20 | | - self, |
21 | 24 | nixpkgs, |
22 | 25 | flake-utils, |
23 | 26 | purescript-overlay, |
| 27 | + mkSpagoDerivation, |
24 | 28 | slimlock, |
25 | 29 | ... |
26 | 30 | }: |
|
34 | 38 | "aarch64-darwin" |
35 | 39 | ]; |
36 | 40 |
|
37 | | - # Users authorized to deploy to the registry. |
38 | | - deployers = import ./nix/deployers.nix; |
39 | | - |
40 | 41 | pureScriptFileset = fileset.intersection (fileset.gitTracked ./.) ( |
41 | 42 | fileset.unions [ |
42 | 43 | ./app |
43 | 44 | (fileset.maybeMissing ./check) |
44 | 45 | ./foreign |
45 | 46 | ./lib |
46 | 47 | ./scripts |
| 48 | + ./test-utils |
47 | 49 | ./spago.lock |
48 | 50 | ./spago.yaml |
49 | 51 | ] |
|
81 | 83 | # We don't want to force everyone to update their configs if they aren't |
82 | 84 | # normally on flakes. |
83 | 85 | nixFlakes = prev.writeShellScriptBin "nixFlakes" '' |
84 | | - exec ${prev.nixFlakes}/bin/nix --experimental-features "nix-command flakes" "$@" |
| 86 | + exec ${prev.nixVersions.stable}/bin/nix --experimental-features "nix-command flakes" "$@" |
85 | 87 | ''; |
86 | 88 |
|
87 | 89 | # Detects arguments to 'git' containing a URL and replaces them with a |
|
149 | 151 | # Packages associated with the registry, ie. in this repository. |
150 | 152 | registry = |
151 | 153 | let |
152 | | - spago-lock = prev.purix.buildSpagoLock { |
153 | | - src = fileset.toSource { |
154 | | - root = ./.; |
155 | | - fileset = pureScriptFileset; |
156 | | - }; |
157 | | - corefn = true; |
| 154 | + spago-lock = prev.mkSpagoDerivation { |
| 155 | + name = "registry"; |
| 156 | + src = ./.; |
| 157 | + nativeBuildInputs = [ |
| 158 | + prev.pkgs.spago-bin.spago-0_93_44 |
| 159 | + prev.pkgs.purescript |
| 160 | + ]; |
| 161 | + buildPhase = "spago build"; |
| 162 | + installPhase = "mkdir $out; cp -r * $out"; |
158 | 163 | }; |
159 | 164 |
|
160 | 165 | package-lock = |
|
250 | 255 | inherit system; |
251 | 256 | overlays = [ |
252 | 257 | purescript-overlay.overlays.default |
| 258 | + mkSpagoDerivation.overlays.default |
253 | 259 | slimlock.overlays.default |
254 | 260 | registryOverlay |
255 | 261 | ]; |
|
270 | 276 | set -euo pipefail |
271 | 277 | WORKDIR=$(mktemp -d) |
272 | 278 | cp spago.yaml spago.lock $WORKDIR |
273 | | - cp -a app foreign lib scripts types $WORKDIR |
| 279 | + cp -a app foreign lib scripts test-utils types $WORKDIR |
274 | 280 | ln -s ${pkgs.registry.package-lock}/js/node_modules $WORKDIR/node_modules |
275 | 281 |
|
276 | 282 | pushd $WORKDIR |
277 | 283 | export HEALTHCHECKS_URL=${defaultEnv.HEALTHCHECKS_URL} |
278 | | - ${pkgs.spago-bin.spago-0_93_19}/bin/spago test |
| 284 | + ${pkgs.spago-bin.spago-0_93_44}/bin/spago test |
279 | 285 |
|
280 | 286 | popd |
281 | 287 | ''; |
282 | 288 |
|
283 | 289 | mkAppOutput = drv: { |
284 | 290 | type = "app"; |
285 | 291 | program = "${drv}/bin/${drv.name}"; |
| 292 | + meta.description = drv.meta.description or "PureScript Registry ${drv.name}"; |
286 | 293 | }; |
287 | 294 |
|
288 | 295 | # A full set of environment variables, each set to their default values |
|
327 | 334 | { |
328 | 335 | nixpkgs.overlays = [ |
329 | 336 | purescript-overlay.overlays.default |
| 337 | + mkSpagoDerivation.overlays.default |
330 | 338 | slimlock.overlays.default |
331 | 339 | registryOverlay |
332 | 340 | ]; |
|
357 | 365 | packages = pkgs.registry.apps // pkgs.registry.scripts; |
358 | 366 |
|
359 | 367 | apps = pkgs.lib.mapAttrs (_: drv: mkAppOutput drv) packages // { |
360 | | - default.type = "app"; |
361 | | - default.program = "${run-vm}"; |
| 368 | + default = { |
| 369 | + type = "app"; |
| 370 | + program = "${run-vm}"; |
| 371 | + meta.description = "Run the registry server in a NixOS VM"; |
| 372 | + }; |
362 | 373 | }; |
363 | 374 |
|
364 | 375 | checks = { |
|
868 | 879 |
|
869 | 880 | # Development tooling |
870 | 881 | purs |
871 | | - spago-bin.spago-0_93_19 # until new lockfile format supported by overlay |
| 882 | + spago-bin.spago-0_93_44 |
872 | 883 | purs-tidy-unstable |
873 | 884 | purs-backend-es-unstable |
874 | 885 | ]; |
|
885 | 896 | system = "x86_64-linux"; |
886 | 897 | overlays = [ |
887 | 898 | purescript-overlay.overlays.default |
| 899 | + mkSpagoDerivation.overlays.default |
888 | 900 | slimlock.overlays.default |
889 | 901 | registryOverlay |
890 | 902 | ]; |
|
0 commit comments