Last active
December 10, 2020 22:47
-
-
Save toonn/80378b4f174527270af9180706e4f65d to your computer and use it in GitHub Desktop.
Nix+lorri setup for haskell
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
eval "$(lorri direnv)" |
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 | |
pkgs = import <nixpkgs> {}; | |
haskellPackages = pkgs.haskell.packages.ghc881; | |
in | |
pkgs.stdenv.mkDerivation { | |
name = "hs-881"; | |
buildInputs = with haskellPackages; [ | |
cabal-install | |
ghcid | |
fast-tags | |
(ghcWithPackages (ps: with ps; [ | |
text | |
optparse-applicative | |
])) | |
]; | |
} |
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
# This uses haskell.nix rather than the nixpkgs haskell infrastructure. | |
let | |
hs-nix = builtins.fetchTarball | |
( "https://github.com/input-output-hk/haskell.nix/archive/" | |
+ "2e7a9925f5922ec785b0782e6b1457166dcb127c.tar.gz" | |
); | |
nixpkgs = builtins.fetchTarball | |
( "https://github.com/input-output-hk/nixpkgs/archive/" | |
+ "a8f81dc037a5977414a356dd068f2621b3c89b60.tar.gz" | |
); | |
pkgs = import nixpkgs (import hs-nix); | |
haskell-nix = pkgs.haskell-nix; | |
hackage-package = haskell-nix.hackage-package; | |
in | |
pkgs.stdenv.mkDerivation { | |
name = "hs-dev"; | |
buildInputs = | |
(with pkgs; # Packages that don't work from hsPkgs for some reason | |
[ cabal-install | |
] | |
) ++ (with haskell-nix.haskellPackages; # Packages in the overlay | |
[ ghcid.components.exes.ghcid | |
(ghcWithPackages (ps: with ps; [ ])) | |
] | |
) ++ ( # Packages not in stackage-lts | |
[ (hackage-package { name = "fast-tags"; | |
version = "2.0.0"; }).components.exes.fast-tags | |
]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment