Skip to content

Instantly share code, notes, and snippets.

@Kiwi

Kiwi/shell.nix Secret

Last active July 13, 2019 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kiwi/66b290945ad27162d23b75e0d38b60e3 to your computer and use it in GitHub Desktop.
Save Kiwi/66b290945ad27162d23b75e0d38b60e3 to your computer and use it in GitHub Desktop.
shell.nix for haskell package these
{ nixpkgs ? import <nixpkgs> {} }:
let
inherit (nixpkgs) pkgs;
# haskellPackages = nixpkgs.haskellPackages.override {
# overrides = self: super: {
# these = pkgs.callPackage ./these/these {};
# semialign = pkgs.callPackage ./these/semialign {};
# semialign-indexed = pkgs.callPackage ./these/semialign-indexed {};
#these = super.callCabal2nix "these" ./these/these {};
#semialign = super.callCabal2nix "semialign" ./these/semialign {};
#semialign-indexed = super.callCabal2nix "semialign-indexed" ./these/semialign-indexed {};
# };
# };
these = pkgs.haskellPackages.callCabal2nix "these" ./these/these {};
semialign = pkgs.haskellPackages.callCabal2nix "semialign" ./these/semialign {these = these;};
semialign-indexed = pkgs.haskellPackages.callCabal2nix "semialign-indexed" ./these/semialign-indexed {these=these; semialign=semialign;};
#these = pkgs.callPackage ./these/these {};
#semialign = pkgs.callPackage ./these/semialign {};
#semialign-indexed = pkgs.callPackage ./these/semialign-indexed {};
# ghc = pkgs.haskellPackages.ghcWithPackages (p: [p.these p.semialign p.semialign-indexed]) ;
ghc = pkgs.haskellPackages.ghcWithPackages (p: [these semialign semialign-indexed]) ;
#ghc = pkgs.haskellPackages.ghcWithPackages (p: [p.semialign p.semialign-indexed p.these]) ;
in
pkgs.stdenv.mkDerivation {
name = "these";
propagatedBuildInputs = with pkgs; [
cabal-install
ghc
#zlib
];
shellHook = ''
eval $(egrep ^export ${ghc}/bin/ghc)
# export HIE_HOOGLE_DATABASE="$(cat $(which hoogle) | sed -n -e 's|.*--database \(.*\.hoo\).*|\1|p')"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment