From f48fc2c18c0360a9fc7cc4fc030f4960e4a91927 Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Sun, 2 Feb 2020 16:06:07 +0100 Subject: [PATCH] Haskell project summoner nix --- src/posts/0011-Haskell-Projects/shell.nix | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/posts/0011-Haskell-Projects/shell.nix diff --git a/src/posts/0011-Haskell-Projects/shell.nix b/src/posts/0011-Haskell-Projects/shell.nix new file mode 100644 index 0000000..42b005b --- /dev/null +++ b/src/posts/0011-Haskell-Projects/shell.nix @@ -0,0 +1,40 @@ +let + config = { allowBroken = true; }; +in + { nixpkgs ? import (fetchGit { + name = "nixos-release-19.09"; + url = "https://github.com/NixOS/nixpkgs"; + # obtained via + # git ls-remote https://github.com/nixos/nixpkgs master + ref = "refs/heads/nixpkgs-19.09-darwin"; + rev = "d5291756487d70bc336e33512a9baf9fa1788faf"; + }) { inherit config; } }: + let + inherit (nixpkgs) pkgs; + inherit (pkgs) haskellPackages; + + haskellDeps = ps: with ps; [ + base + protolude + containers + ]; + + ghc = haskellPackages.ghcWithPackages haskellDeps; + + nixPackages = [ + ghc + pkgs.gdb + # haskellPackages.haskell-overridez + haskellPackages.summoner + haskellPackages.summoner-tui + haskellPackages.cabal-install + haskellPackages.ghcid + ]; + in + pkgs.stdenv.mkDerivation { + name = "env"; + buildInputs = nixPackages; + shellHook = '' + export PS1="\n\[[hs:\033[1;32m\]\W\[\033[0m\]]> " + ''; + }