Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implementing overlays with haskellPackages
- Loading branch information
1 parent
16f74fa
commit f9e8b48
Showing
11 changed files
with
83 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
fetchNixpkgs = import ./fetch-nixpkgs.nix; | ||
cleanSourceHaskell = import ./clean-source-haskell.nix; | ||
haskellPackages = ./haskell-packages.nix; | ||
maybeEnv = import ./maybe-env.nix; | ||
jemallocOverlay = import ./overlays/jemalloc.nix; | ||
getPackages = import ./get-packages.nix; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
haskellPackages: filter: | ||
let | ||
cusutmPackages = lib.filterAttrs (name: drv: filter name) haskellPackages; | ||
in | ||
customPackages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Gets the value of an environment variable, with a default if it's | ||
# unset or empty. | ||
env: default: | ||
let | ||
result = builtins.getEnv env; | ||
in if result != "" | ||
then result | ||
else default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ pkgs, filter }: | ||
|
||
with pkgs.lib; | ||
|
||
self: super: { | ||
mkDerivation = args: super.mkDerivation (args // optionalAttrs (filter args.pname) { | ||
doHaddock = true; | ||
postInstall = '' | ||
${args.postInstall or ""} | ||
mkdir -pv $doc/nix-support | ||
tar -czvf $doc/${args.pname}-docs.tar.gz -C $doc/share/doc/html . | ||
echo "file binary-dist $doc/${args.pname}-docs.tar.gz" >> $doc/nix-support/hydra-build-products | ||
echo "report ${args.pname}-docs.html $doc/share/doc/html index.html" >> $doc/nix-support/hydra-build-products | ||
''; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ pkgs, filter }: | ||
|
||
with pkgs.lib; | ||
|
||
self: super: { | ||
mkDerivation = args: super.mkDerivation (args // optionalAttrs (filter args.pname) { | ||
splitCheck = true; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: pkgs: hspkgs: deps: env: code: let | ||
lib = pkgs.lib; | ||
ghc = hspkgs.ghcWithPackages deps; | ||
flags = lib.optionalString pkgs.stdenv.isDarwin "-liconv"; # https://github.com/NixOS/nixpkgs/issues/46814 | ||
builtBinary = pkgs.runCommand "${name}-binary" { buildInputs = [ ghc ]; } '' | ||
mkdir -p $out/bin/ | ||
ghc ${pkgs.writeText "${name}.hs" code} ${flags} -o $out/bin/${name} | ||
''; | ||
in pkgs.runCommand name env '' | ||
${builtBinary}/bin/$name | ||
'' |