Hi everyone,
I’m a nix user who’s interested in working a bit more with Haskell. I’ve used stack in the past, but now that I’ve switched to NixOS, I’d rather use nix to manage my projects and dependencies than any language-specific tool.
To my understanding, cabal2nix and haskell.nix exist for helping users of cabal and stack integrate with nix. If I’m migrating an existing project, that seems awesome, but is there any reason to use those programs if I’m starting with nix from scratch? I’m tempted to put the following code in shell.nix like so:
let
customGhc = pkgs.haskellPackages.ghcWithPackages (pkgs: with pkgs; [
haskell-say
]);
in
pkgs.mkShell {
buildInputs = [
customGhc
# Other dependencies here
];
}
From there, I would just use a script to invoke ghc from the command line. Why is this a bad idea? I would appreciate any advice.