Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This my haskell dev env (please note I don't use stack)
- with import <nixpkgs> {};
- {
- sdlEnv = stdenv.mkDerivation {
- name = "haskell";
- shellHook = ''
- export NIX_LABEL="haskell"
- '';
- buildInputs = [
- ghc cabal-install cabal2nix stack
- ];
- };
- }
- // Here is the result of cabal2nix
- { nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
- let
- inherit (nixpkgs) pkgs;
- f = { mkDerivation, base, containers, hedgehog, hspec
- , postgresql-simple, stdenv, text
- }:
- mkDerivation {
- pname = "simity";
- version = "0.0.0.0";
- src = ./.;
- isLibrary = true;
- isExecutable = true;
- libraryHaskellDepends = [ base containers postgresql-simple text ];
- executableHaskellDepends = [ base containers postgresql-simple ];
- testHaskellDepends = [ base containers hedgehog hspec text ];
- doHaddock = false;
- license = "LicenseRef-PublicDomain";
- };
- haskellPackages = if compiler == "default"
- then pkgs.haskellPackages
- else pkgs.haskell.packages.${compiler};
- variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
- drv = variant (haskellPackages.callPackage f {});
- in
- if pkgs.lib.inNixShell then drv.env else drv
- // Then i do `nix-shell . --command fish` with the file above as `default.nix`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement