-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathflake.nix
More file actions
517 lines (491 loc) · 26.8 KB
/
flake.nix
File metadata and controls
517 lines (491 loc) · 26.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
{
description = "Minimal devshell flake for haskell";
inputs.haskellNix.url = "github:input-output-hk/haskell.nix";
inputs.nixpkgs.follows = "haskellNix/nixpkgs-2511";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.iohk-nix.url = "github:input-output-hk/iohk-nix";
inputs.cabal.url = "github:stable-haskell/cabal";
inputs.cabal.flake = false;
outputs = { self, nixpkgs, flake-utils, haskellNix, iohk-nix, ... }:
let overlays = {
inherit (iohk-nix.overlays) crypto;
# add static-$pkg for a few packages to be able to pull them im explicitly.
static-libs = (final: prev: {
static-libsodium-vrf = final.libsodium-vrf.overrideDerivation (old: {
configureFlags = old.configureFlags ++ [ "--disable-shared" ];
});
static-secp256k1 = final.secp256k1.overrideDerivation (old: {
configureFlags = old.configureFlags ++ ["--enable-static" "--disable-shared" ];
});
static-gmp = (final.gmp.override { withStatic = true; }).overrideDerivation (old: {
configureFlags = old.configureFlags ++ ["--enable-static" "--disable-shared" ];
});
static-openssl = (final.openssl.override { static = true; });
static-zlib = final.zlib.override { shared = false; };
static-pcre = final.pcre.override { shared = false; };
static-snappy = final.snappy.override { static = true; };
static-libblst = final.libblst.overrideDerivation (old: {
configureFlags = old.configureFlags ++ [ "--enable-static" "--disable-shared" ];
buildPhase = ''
runHook preBuild
./build.sh
runHook postBuild
'';
postFixup = "";
});
# lmdb uses a plain Makefile (no autoconf), so we strip the .so
# target the same way nixpkgs does for isStatic platforms.
static-lmdb = final.lmdb.overrideAttrs (old: {
postPatch = (old.postPatch or "") + ''
sed 's/^ILIBS\>.*/ILIBS = liblmdb.a/' -i Makefile
'';
});
# liburing always builds both static and dynamic libraries, so we remove the .so
# target the same way nixpkgs does for isStatic platforms.
static-liburing = final.liburing.overrideAttrs (old: {
dontdisableStatic = true;
# There are several files in man/ that have the same filename but with
# different case. When building on macOS, Nix renames these files with a
# "~nix~case~hack~" suffix, and then the Makefile won't be able to find them
# during the installPhase. Copy these back over the original. This should not
# cause any case conflicts, because it will be built in a Linux VM.
preInstall = ''
# Rename any case-hacked files back to their original names
for f in man/*~nix~case~hack~*; do
if [ -f "$f" ]; then
mv "$f" "''${f%~nix~case~hack~*}"
fi
done
'';
postInstall = ''
# Always builds both static and dynamic libraries, so we need to remove the
# dynamic libraries.
rm $out/lib/liburing*.so*
# Copy the examples into $bin. Most reverse dependency of
# this package should reference only the $out output
for file in $(find ./examples -executable -type f); do
install -Dm555 -t "$bin/bin" "$file"
done
'';
});
});
# nixpkgs defines happy = justStaticExecutables haskellPackages.happy
# which sets disallowGhcReference = true. In nixpkgs-2511, this causes
# the build to fail because the happy binary transitively references GHC
# through happy-lib (happy -> happy-lib -> ghc). The postFixup only
# removes $out/lib but cannot break the reference chain through happy-lib
# which lives in the Nix store. We override to disable the GHC reference
# check while keeping the rest of justStaticExecutables behavior.
build-fixes = (final: prev: {
happy = final.haskell.lib.compose.overrideCabal (drv: {
disallowGhcReference = false;
}) prev.happy;
});
cddl-tools = (final: prev: {
cbor-diag = final.callPackage ./pkgs/cbor-diag { };
cddl = final.callPackage ./pkgs/cddl { };
});
musl = (final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl {
# We don't need a ruby static build. We're only interested in producing static
# outputs, not necessarily build tools.
ruby = prev.pkgsBuildBuild.ruby;
# OpenSSL 3.6.0 test 82-test_ocsp_cert_chain.t fails in the nix sandbox
# because the OCSP stapling test requires network/timing conditions that
# aren't reliably available during cross-compilation builds. Only 1 of 3888
# tests fails, and it's unrelated to the actual crypto functionality.
openssl = prev.openssl.overrideAttrs (old: {
preCheck = (old.preCheck or "") + ''
rm -f test/recipes/82-test_ocsp_cert_chain.t
'';
});
# PostgreSQL fixes for musl cross-compilation:
#
# nixpkgs-2511 postgresql/generic.nix has multiple issues with
# musl64 because pkgsCross.musl64 doesn't set isStatic=true:
#
# 1. jitSupport defaults true → pulls in LLVM build inputs.
# 2. perlSupport defaults true → musl perl lacks shared libperl.
# 3. pythonSupport/tclSupport default true → adds plpython3/pltcl
# outputs. These are unnecessary for musl cross-builds and
# each extra output widens the nix-copy window, exacerbating
# the min-free GC race on darwin builders.
# 4. generic.nix switches to LLVM stdenv+bintools for LTO when
# GCC is used. Cross-compiled LLVM 20 OOMs on darwin builders.
# We override llvmPackages_20 to prevent the switch (avoids
# LLVM dependency), then explicitly disable LTO with -fno-lto
# since GCC LTO + GNU ld is broken for postgresql (.ltrans
# link failures). Can't use hardeningDisable=["lto"] because
# "lto" is not a recognized hardening flag on musl cross.
# 5. outputChecks unconditionally reference llvmPackages.llvm.
postgresql = (prev.postgresql.override {
jitSupport = false;
perlSupport = false;
pythonSupport = false;
tclSupport = false;
# Prevent the LTO stdenv switch: provide normal GCC-based
# musl stdenv as llvmPackages_20, making the switch a no-op.
llvmPackages_20 = prev.llvmPackages_20 // {
inherit (prev) stdenv;
bintools = prev.stdenv.cc.bintools;
};
}).overrideAttrs (old: {
# Explicitly disable LTO since we're using GCC + GNU ld
# (not the LLVM bintools the stdenv switch would provide).
env = (old.env or {}) // {
NIX_CFLAGS_COMPILE = (old.env.NIX_CFLAGS_COMPILE or "") + " -fno-lto";
};
doCheck = false;
outputChecks = {};
separateDebugInfo = false;
disallowedReferences = [];
# Break multi-output reference cycles. Nix refuses to register
# outputs that form cycles. The cycles are:
# dev ↔ out: dev has .pc files referencing out; out has
# baked-in dev paths from configure
# lib ↔ out: lib has embedded out paths (share/locale refs
# in libpq); out links against lib
# Fix: strip dev refs from out+lib, strip out refs from lib.
# out→lib is the only legitimate runtime dependency.
postFixup = (old.postFixup or "") + ''
find "$out" -name '*.la' -delete
find "$out" -type f -exec remove-references-to -t "$dev" {} +
find "$lib" -name '*.la' -delete
find "$lib" -type f -exec remove-references-to -t "$dev" {} +
find "$lib" -type f -exec remove-references-to -t "$out" {} +
'';
});
});
};
supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
in let flake-outputs = flake-utils.lib.eachSystem supportedSystems (system:
let
pkgs = import nixpkgs {
overlays = [haskellNix.overlay] ++ builtins.attrValues overlays;
inherit system;
inherit (haskellNix) config;
};
# These are for checking IOG projects build in an environment
# without haskell packages built by haskell.nix.
#
# Usage:
#
# nix develop github:input-output-hk/devx#ghc96 --no-write-lock-file -c cabal build
#
static-pkgs = if pkgs.stdenv.hostPlatform.isLinux
then if pkgs.stdenv.hostPlatform.isAarch64
then pkgs.pkgsCross.aarch64-multiplatform-musl
else pkgs.pkgsCross.musl64
else pkgs;
js-pkgs = pkgs.pkgsCross.ghcjs;
windows-pkgs = pkgs.pkgsCross.mingwW64;
devShellsWithToolsModule = toolsModule:
# Map the compiler-nix-name to a final compiler-nix-name the way haskell.nix
# projects do (that way we can use short names)
let compilers = pkgs: pkgs.lib.genAttrs [
"ghc96"
"ghc98"
"ghc910"
"ghc912"] (short-name: rec {
inherit pkgs self toolsModule;
compiler-nix-name = pkgs.haskell-nix.resolve-compiler-name short-name;
compiler = pkgs.buildPackages.haskell-nix.compiler.${compiler-nix-name};
});
js-compilers = pkgs: builtins.removeAttrs (compilers pkgs)
[
"ghc90"
"ghc92"
"ghc94"
"ghc910"
];
# Windows cross-compilation disabled pending nixpkgs-2511
# crossThreadsStdenv fix (mcfgthread/pthreads bootstrap).
windows-compilers = _pkgs: {};
in (builtins.mapAttrs (short-name: args:
import ./dynamic.nix (args // { withIOG = false; })
) (compilers pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-minimal" (
import ./dynamic.nix (args // { withHLS = false; withHlint = false; withIOG = false; })
)) (compilers pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-minimal-ghc" (
import ./dynamic.nix (args // { withHLS = false; withHlint = false; withIOG = false; withGHCTooling = true; })
)) (compilers pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-static" (
import ./static.nix (args // { withIOG = false; })
)) (compilers static-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-static-minimal" (
import ./static.nix (args // { withHLS = false; withHlint = false; withIOG = false; })
)) (compilers static-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-js" (
import ./cross-js.nix (args // { pkgs = js-pkgs.pkgsBuildBuild; })
)) (js-compilers js-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-js-minimal" (
import ./cross-js.nix (args // { pkgs = js-pkgs.buildPackages; withHLS = false; withHlint = false; })
)) (js-compilers js-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-windows" (
import ./cross-windows.nix args
)) (windows-compilers windows-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-windows-minimal" (
import ./cross-windows.nix (args // { withHLS = false; withHlint = false; })
)) (windows-compilers windows-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-iog" (
import ./dynamic.nix (args // { withIOG = true; })
)) (compilers pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-minimal-iog" (
import ./dynamic.nix (args // { withHLS = false; withHlint = false; withIOG = true; })
)) (compilers pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-iog-full" (
import ./dynamic.nix (args // { withIOGFull = true; })
)) (compilers pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-minimal-iog-full" (
import ./dynamic.nix (args // { withHLS = false; withHlint = false; withIOGFull = true; })
)) (compilers pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-static-iog" (
import ./static.nix (args // { withIOG = true; })
)) (compilers static-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-static-iog-full" (
import ./static.nix (args // { withIOG = true; withIOGFull = true;})
)) (compilers static-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-static-minimal-iog" (
import ./static.nix (args // { withHLS = false; withHlint = false; withIOG = true; })
)) (compilers static-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-static-minimal-iog-full" (
import ./static.nix (args // { withHLS = false; withHlint = false; withIOG = true; withIOGFull = true; })
)) (compilers static-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-js-iog" (
import ./cross-js.nix (args // { pkgs = js-pkgs.buildPackages; withIOG = true; })
)) (js-compilers js-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-js-minimal-iog" (
import ./cross-js.nix (args // { pkgs = js-pkgs.buildPackages; withHLS = false; withHlint = false; withIOG = true; })
)) (js-compilers js-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-windows-iog" (
import ./cross-windows.nix (args // { withIOG = true; })
)) (windows-compilers windows-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-windows-minimal-iog" (
import ./cross-windows.nix (args // { withHLS = false; withHlint = false; withIOG = true; })
)) (windows-compilers windows-pkgs)
);
devShells = devShellsWithToolsModule {};
# Eval must be done on linux when we use hydra to build environment
# scripts for other platforms. That way a linux GHA can download the
# cached files without needing access to the actual build platform.
devShellsWithEvalOnLinux = devShellsWithToolsModule { evalSystem = "x86_64-linux"; };
in {
inherit devShells;
hydraJobs = devShells // {
# *-dev sentinel job. Signals all -env have been built.
required = pkgs.runCommand "required dependencies (${system})" {
_hydraAggregate = true;
constituents = map (name: "${system}.${name}-env") (builtins.attrNames devShellsWithEvalOnLinux);
} "touch $out";
} // (
# Generate environment wrapper scripts at evaluation time.
# This avoids:
# - IFD (Import From Derivation) which forces cross-platform builds during eval
# - recursive-nix which is not supported on remote builders
#
# Each wrapper exports the derivation's raw attributes (buildInputs,
# nativeBuildInputs, stdenv, etc.) then sources $stdenv/setup to run
# all setup hooks (cc-wrapper, pkg-config-wrapper, etc.). This gives
# the same environment as `nix develop`: full PATH, NIX_CFLAGS_COMPILE,
# NIX_LDFLAGS, PKG_CONFIG_PATH, and all other hook-computed variables.
let
mkEnvScript = name: drv:
let
inherit (pkgs) lib;
# Extract all derivation attributes as string-valued env vars.
# This includes stdenv, buildInputs, nativeBuildInputs, initialPath,
# and all user-defined variables (NIX_CABAL_FLAGS, etc.).
# These seed stdenv's setup.sh which iterates over build inputs
# and runs their setup hooks to populate NIX_CFLAGS_COMPILE,
# NIX_LDFLAGS, PKG_CONFIG_PATH, PATH, etc.
drvEnv = pkgs.devShellTools.unstructuredDerivationInputEnv {
inherit (drv) drvAttrs;
} // pkgs.devShellTools.derivationOutputEnv {
outputList = drv.outputs;
outputMap = drv;
};
# Filter to exportable variables. We keep build-input variables
# (stdenv, buildInputs, nativeBuildInputs, initialPath, etc.)
# because setup.sh needs them to drive the setup hook machinery.
# Only truly internal nix plumbing is excluded.
exportableEnv = lib.filterAttrs (varName: value:
! lib.elem varName [
# Nix builder internals (meaningless outside sandbox)
"out" "outputs" "args" "builder"
"__structuredAttrs" "__ignoreNulls"
"preferLocalBuild" "allowSubstitutes"
"allowedReferences" "allowedRequisites"
"disallowedReferences" "disallowedRequisites"
# Handled separately after setup.sh
"shellHook"
# Darwin sandbox internals
"__darwinAllowLocalNetworking" "__sandboxProfile"
"__propagatedSandboxProfile" "__impureHostDeps"
"__propagatedImpureHostDeps"
]
&& value != ""
&& value != null
&& ! lib.isList value
&& ! lib.isAttrs value
&& ! lib.isFunction value
) drvEnv;
envExports = lib.concatStringsSep "\n" (
lib.mapAttrsToList (varName: value:
"declare -x ${varName}=${lib.escapeShellArg (toString value)}"
) exportableEnv
);
shellHook = drv.shellHook or "";
in pkgs.writeTextFile {
name = "devx";
executable = true;
text = ''
#!${pkgs.bash}/bin/bash
# Raw derivation environment variables. These seed stdenv's
# setup.sh with build inputs, compiler paths, and other
# attributes needed to initialize the full dev environment.
${envExports}
# setup.sh expects Nix builder runtime variables that are
# only set inside `nix build`. When running directly
# (container, CI, CLI) we provide sensible defaults.
if [ -z "''${NIX_BUILD_TOP:-}" ]; then
export NIX_BUILD_TOP="$(mktemp -d)"
export TMPDIR="$NIX_BUILD_TOP"
export TMP="$NIX_BUILD_TOP"
export TEMP="$NIX_BUILD_TOP"
export TEMPDIR="$NIX_BUILD_TOP"
export NIX_STORE="/nix/store"
export out="$NIX_BUILD_TOP/out"
mkdir -p "$out"
fi
# Development shells must not enforce store-path purity.
# The stdenv preHook defaults NIX_ENFORCE_PURITY to 1, which
# causes the cc-wrapper to reject -I/-L flags pointing outside
# /nix/store/ (e.g. the cabal package store at $CABAL_DIR/store/).
# Setting it to empty before sourcing setup.sh makes the preHook's
# ''${NIX_ENFORCE_PURITY-1} keep the empty value instead of defaulting.
export NIX_ENFORCE_PURITY=
# Suppress the cc-wrapper --target mismatch warning on aarch64-darwin.
# GNU config.sub normalises to "aarch64-apple-darwin" while Apple's
# LLVM toolchain (and nix cc-wrapper's @defaultTarget@) uses
# "arm64-apple-darwin". GHC passes --target=aarch64-apple-darwin which
# triggers a noisy warning from cc-wrapper's add-clang-cc-cflags-before
# hook. The warning itself is harmless — clang handles both triples
# identically — but it pollutes stderr and causes thousands of GHC
# testsuite failures via unexpected compiler output.
export NIX_CC_WRAPPER_SUPPRESS_TARGET_WARNING=1
# Source stdenv's setup.sh to initialize the development
# environment. This runs all setup hooks (cc-wrapper,
# pkg-config-wrapper, etc.) and populates NIX_CFLAGS_COMPILE,
# NIX_LDFLAGS, PKG_CONFIG_PATH, PATH, etc. — exactly like
# `nix develop` does.
_DEVX_HOME="''${HOME:-}"
source "$stdenv/setup"
# Restore settings for interactive / script use.
# setup.sh enables strict mode and may reset HOME.
set +eu +o pipefail
[ -n "$_DEVX_HOME" ] && export HOME="$_DEVX_HOME"
unset _DEVX_HOME
# Set TERM=dumb if not already set so tput and other
# ncurses tools don't fail in CI/container environments.
export TERM="''${TERM:-dumb}"
# Shell hook from mkShell
${shellHook}
# Source the user's script if provided
if [ -n "''${1:-}" ]; then
source "$1"
fi
'';
};
in
pkgs.lib.mapAttrs' (name: drv:
pkgs.lib.nameValuePair "${name}-env" (mkEnvScript name drv)
) devShells
# Smoke-test each -env.sh script: source it in a sandbox and verify
# that the essential tools (ghc, cabal, pkg-config, and optionally HLS)
# are functional. Catches PATH construction errors, missing packages,
# and broken shellHooks that would produce unusable containers.
// pkgs.lib.mapAttrs' (name: drv:
let
inherit (pkgs) lib;
envScript = mkEnvScript name drv;
# HLS is only available when:
# - not a -minimal variant (withHLS was true)
# - not a -js variant (JS backend)
# - not a -windows variant (cross-windows)
# - compiler version < 9.11 (ghc912+ not yet supported)
hasHLS = !(lib.hasInfix "-minimal" name)
&& !(lib.hasInfix "-js" name)
&& !(lib.hasInfix "-windows" name)
&& !(lib.hasInfix "ghc912" name);
in lib.nameValuePair "${name}-env-test" (
pkgs.runCommand "${name}-env-test" {} ''
# Save the test output path before sourcing the devshell
# environment — setup.sh resets output-related variables.
_TEST_OUT="$out"
# Source the environment script. This exports drvAttrs and
# runs source "$stdenv/setup", giving us the full development
# environment with all tools on PATH.
source ${envScript}
# For cross-compilation shells (static/musl, JS), the GHC binary
# has a target prefix (e.g. x86_64-unknown-linux-musl-ghc).
# Extract the correct name from NIX_CABAL_FLAGS if set.
GHC_CMD="ghc"
if [[ -n "''${NIX_CABAL_FLAGS:-}" ]]; then
for flag in $NIX_CABAL_FLAGS; do
case "$flag" in
--with-ghc=*) GHC_CMD="''${flag#--with-ghc=}" ;;
esac
done
fi
echo "=== Testing ${name} ==="
echo -n "GHC: "; $GHC_CMD --version
echo -n "Cabal: "; cabal --version | head -1
echo -n "pkg-config packages: "; pkg-config --list-all | wc -l
${lib.optionalString hasHLS ''
echo -n "HLS: "; haskell-language-server --version || true
''}
echo "=== ${name}: OK ==="
touch "$_TEST_OUT"
'')
) devShells)
// (pkgs.lib.mapAttrs' (name: drv:
pkgs.lib.nameValuePair "${name}-plans" drv.plans) devShells);
packages.cabalProjectLocal-static = (import ./quirks.nix { pkgs = static-pkgs; static = true; }).template;
packages.cabalProjectLocal-cross-js = (import ./quirks.nix { pkgs = js-pkgs; }).template;
packages.cabalProjectLocal-cross-windows = (import ./quirks.nix { pkgs = windows-pkgs; }).template;
});
# we use flake-outputs here to inject a required job that aggregates all required jobs.
in flake-outputs // {
hydraJobs = flake-outputs.hydraJobs // {
required = (import nixpkgs { system = "x86_64-linux"; }).runCommand "required dependencies" {
_hydraAggregate = true;
constituents = map (s: "${s}.required") supportedSystems;
} "touch $out";
};
};
}