Skip to content

Commit c9a3f5a

Browse files
committed
overlay.nix: refactor using pipe, add buildFromSdist
1 parent f9edde0 commit c9a3f5a

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

overlay.nix

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
1-
pkgs: hlib: helf: huper: {
1+
pkgs: hlib: helf: huper:
2+
let
3+
lib = pkgs.lib;
4+
in
5+
{
26
hnix-store-core =
3-
helf.callCabal2nix "hnix-store-core" ./hnix-store-core {};
7+
lib.pipe
8+
(helf.callCabal2nix "hnix-store-core" ./hnix-store-core {})
9+
[
10+
hlib.compose.buildFromSdist
11+
];
412
hnix-store-remote =
5-
if pkgs.stdenv.isDarwin
6-
then helf.callCabal2nix "hnix-store-remote" ./hnix-store-remote { }
7-
else
8-
( helf.callCabal2nixWithOptions "hnix-store-remote" ./hnix-store-remote "-fio-testsuite" { }
9-
).overrideAttrs (attrs: {
13+
lib.pipe
14+
# enable -fio-testsuite for Linux systems as
15+
# it requires linux-namespaces
16+
# NOTE: we cannot use hlib.compose.enableCabalFlag
17+
# as the testsuite deps won't get picked up
18+
# after cabal2nix step
19+
(
20+
if pkgs.stdenv.isDarwin
21+
then helf.callCabal2nix "hnix-store-remote" ./hnix-store-remote {}
22+
else helf.callCabal2nixWithOptions "hnix-store-remote" ./hnix-store-remote "-fio-testsuite" {}
23+
)
24+
[
25+
hlib.compose.buildFromSdist
26+
(pkg: pkg.overrideAttrs (attrs: {
1027
buildInputs = attrs.buildInputs ++ [
1128
pkgs.nix
1229
];
13-
});
30+
}))
31+
];
1432
}

0 commit comments

Comments
 (0)