Skip to content

Commit f58bb30

Browse files
committed
extra-hackages wip
1 parent 9ca5939 commit f58bb30

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed

flake.lock

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66

77
nixpkgs.follows = "haskell-nix/nixpkgs-unstable";
88

9+
haskell-nix-extra-hackage = {
10+
url = "github:mlabs-haskell/haskell-nix-extra-hackage/main";
11+
inputs.nixpkgs.follows = "nixpkgs";
12+
inputs.haskell-nix.follows = "haskell-nix";
13+
};
14+
915
iohk-nix.url = "github:input-output-hk/iohk-nix";
1016
iohk-nix.flake = false; # Bad Nix code
1117

@@ -313,16 +319,31 @@
313319
}
314320
];
315321

322+
extraHackagePackages = with nixpkgs.lib;
323+
(concatLists (map
324+
(extraSource: (map
325+
(subdir:
326+
if subdir == "." then extraSource.src.outPath else "${extraSource.src.outPath}/${subdir}")
327+
extraSource.subdirs))
328+
extraSources));
329+
316330
projectFor = system:
317331
let
318332
pkgs = nixpkgsFor system;
319333
pkgs' = nixpkgsFor' system;
334+
# Usage:
335+
extraHackage = inputs.haskell-nix-extra-hackage.mkHackage.${system} extraHackagePackages;
320336
in
321337
pkgs.haskell-nix.cabalProject' {
322338
src = ./.;
323-
inherit cabalProjectLocal extraSources;
339+
inherit cabalProjectLocal;
324340
name = "bot-plutus-interface";
325341
compiler-nix-name = "ghc8107";
342+
343+
extra-hackages = [ (import extraHackage.hackageNix) ];
344+
extra-hackage-tarballs = [{ name = "extraHackage"; index = extraHackage.hackageTarball; }];
345+
modules = [ extraHackage.module ] ++ haskellModules;
346+
326347
shell = {
327348
additional = ps: [
328349
ps.plutus-pab
@@ -342,7 +363,6 @@
342363
nixpkgs-fmt
343364
];
344365
};
345-
modules = haskellModules;
346366
};
347367

348368
formatCheckFor = system:

0 commit comments

Comments
 (0)