-
-
Save rajivr/6d89527939213d8b4c0794e49805506c to your computer and use it in GitHub Desktop.
nix-buffer example
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
let | |
compiler = "ghc884"; | |
currentFlake = builtins.getFlake (builtins.toString ./.); | |
pkgs = currentFlake.inputs.nixpkgs.legacyPackages.x86_64-linux; | |
in | |
with pkgs; | |
nixBufferBuilders.withPackages [ | |
haskell.compiler.${compiler} | |
haskell.packages.${compiler}.cabal-install | |
haskell.packages.${compiler}.haskell-language-server | |
] |
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
{ | |
description = "Chapter-02 Universal constructions and the algebra of types"; | |
inputs.nixpkgs.url = "nixpkgs/nixos-20.09"; | |
outputs = { self, nixpkgs }: { | |
devShell.x86_64-linux = | |
let | |
compiler = "ghc884"; | |
pkgs = nixpkgs.legacyPackages.x86_64-linux; | |
gitignore = pkgs.nix-gitignore.gitignoreSourcePure [ ./.gitignore ]; | |
myHaskellPackages = pkgs.haskell.packages.${compiler}.override { | |
overrides = hself: hsuper: { | |
Chapter02 = | |
hself.callCabal2nix | |
"Chapter02" | |
(gitignore ./.) | |
{ }; | |
}; | |
}; | |
myHaskellPackagesShell = myHaskellPackages.shellFor { | |
packages = p: [ | |
p.Chapter02 | |
]; | |
buildInputs = [ | |
pkgs.haskell.packages.${compiler}.cabal-install | |
pkgs.haskell.packages.${compiler}.haskell-language-server | |
pkgs.haskell.packages.${compiler}.ormolu | |
]; | |
withHoogle = false; | |
}; | |
in | |
myHaskellPackagesShell; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment