Skip to content

Commit 9479992

Browse files
committed
extra-hackages wip
1 parent d882ffb commit 9479992

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

flake.lock

Lines changed: 25 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

@@ -335,16 +341,31 @@
335341
}
336342
];
337343

344+
extraHackagePackages = with nixpkgs.lib;
345+
(concatLists (map
346+
(extraSource: (map
347+
(subdir:
348+
if subdir == "." then extraSource.src.outPath else "${extraSource.src.outPath}/${subdir}")
349+
extraSource.subdirs))
350+
extraSources));
351+
338352
projectFor = system:
339353
let
340354
pkgs = nixpkgsFor system;
341355
pkgs' = nixpkgsFor' system;
356+
# Usage:
357+
extraHackage = inputs.haskell-nix-extra-hackage.mkHackage.${system} extraHackagePackages;
342358
in
343359
pkgs.haskell-nix.cabalProject' {
344360
src = ./.;
345-
inherit cabalProjectLocal extraSources;
361+
inherit cabalProjectLocal;
346362
name = "bot-plutus-interface";
347363
compiler-nix-name = "ghc8107";
364+
365+
extra-hackages = [ (import extraHackage.hackageNix) ];
366+
extra-hackage-tarballs = [{ name = "extraHackage"; index = extraHackage.hackageTarball; }];
367+
modules = [ extraHackage.module ] ++ haskellModules;
368+
348369
shell = {
349370
additional = ps: [
350371
ps.plutus-pab
@@ -364,7 +385,6 @@
364385
nixpkgs-fmt
365386
];
366387
};
367-
modules = haskellModules;
368388
};
369389

370390
formatCheckFor = system:

0 commit comments

Comments
 (0)