Created
March 31, 2019 21:21
-
-
Save countoren/42af62938691c9089ba0801e64dbaafe to your computer and use it in GitHub Desktop.
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
with import ./nixpkgs.nix; | |
let | |
hie = (import (fetchFromGitHub { | |
owner="domenkozar"; | |
repo="hie-nix"; | |
rev="6794005"; | |
sha256="0pc90ns0xcsa6b630d8kkq5zg8yzszbgd7qmnylkqpa0l58zvnpn"; | |
}) { }); | |
hieWrapper = writeShellScriptBin "hie" '' | |
argv=( "$@" ) | |
exec nix-shell --pure --run "${hie.hie84}/bin/hie ''${argv[*]}" | |
''; | |
vscode = vscode-with-extensions.override { | |
# When the extension is already available in the default extensions set. | |
vscodeExtensions = with vscode-extensions; [ | |
bbenoist.Nix | |
] | |
# Concise version from the vscode market place when not available in the default set. | |
++ vscode-utils.extensionsFromVscodeMarketplace [ | |
{ | |
name = "vim"; | |
publisher = "vscodevim"; | |
version = "1.0.8"; | |
sha256 = "0yqfn8b2jfrijzf731sggyvik2immlx9hfgmsgp1mx01hpyisd9r"; | |
} | |
{ | |
name = "vscode-hie-server"; | |
publisher = "alanz"; | |
version = "0.0.24"; | |
sha256 = "06dm6x6jnqgraims38qzf06yk9acr0ws2hx8i9fsrilv99pc9ryr"; | |
} | |
]; | |
}; | |
code = runCommand "${vscode.name}" { nativeBuildInputs = [ makeWrapper ]; } '' | |
mkdir -p $out/bin | |
makeWrapper \ | |
${vscode}/bin/code \ | |
$out/bin/code \ | |
--prefix PATH : ${lib.makeBinPath [ myghc cabal-install hieWrapper ]} | |
''; | |
myghc = pkgs.haskellPackages.ghcWithHoogle (ps: with ps; [ | |
split | |
parsec | |
vector | |
cabal-install | |
]); | |
in | |
stdenv.mkDerivation rec { | |
name = "hieTest"; | |
buildInputs = [ | |
figlet | |
git | |
code | |
myghc | |
]; | |
shellHook = '' | |
figlet "Wellcome to Coding Gym" | |
ghci kata.hs | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment