Skip to content

Instantly share code, notes, and snippets.

@toonn
Last active December 10, 2020 22:47
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toonn/80378b4f174527270af9180706e4f65d to your computer and use it in GitHub Desktop.
Save toonn/80378b4f174527270af9180706e4f65d to your computer and use it in GitHub Desktop.
Nix+lorri setup for haskell
eval "$(lorri direnv)"
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 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