-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Talk about how to use GHC-specific tools (e.g. ghc-mod) #30
Comments
I think this is as simple as adding For example, if you had a project like this one from the tutorial: let
config = {
packageOverrides = pkgs: rec {
haskellPackages = pkgs.haskellPackages.override {
overrides = haskellPackagesNew: haskellPackagesOld: rec {
optparse-applicative =
haskellPackagesNew.callPackage ./optparse-applicative-2.nix { };
project1 =
haskellPackagesNew.callPackage ./default.nix { };
turtle =
haskellPackagesNew.callPackage ./turtle.nix { };
};
};
};
};
pkgs = import <nixpkgs> { inherit config; };
in
{ project1 = pkgs.haskellPackages.project1;
} ... then I think you can just add let
config = {
packageOverrides = pkgs: rec {
haskellPackages = pkgs.haskellPackages.override {
overrides = haskellPackagesNew: haskellPackagesOld: rec {
optparse-applicative =
haskellPackagesNew.callPackage ./optparse-applicative-2.nix { };
project1 =
haskellPackagesNew.callPackage ./default.nix { };
turtle =
haskellPackagesNew.callPackage ./turtle.nix { };
};
};
};
};
pkgs = import <nixpkgs> { inherit config; };
in
{ project1 = pkgs.haskellPackages.project1;
ghc-mod = pkgs.haskellPackages.ghc-mod;
} ... and then you can install the $ nix-env --install --attr ghc-mod --file release.nix @adelbertc: Could you try that out and let me know if it works for you? If it does, then I can add this to the tutorial |
Hmm wouldn't that globally install ghc-mod? For something like ghc-mod where the version of GHC it's compiled against matters, you'd want to do it on a per project basis right? At work we have it available once we drop into a project-specific |
The problem is that |
Right, so I guess if possible you would need a |
Have you tried indeed simply adding ghc-mod to your buildDepends/buildTools? If not, you might want to verify that it allows you to have a working ghc-mod that's aware of your project. Then you can automate that by maybe overriding your project's derivation at the last minute, right before calling |
Tools like ghc-mod, as far as I understand, need to be built with the same version of GHC as the project you intend to use it in. Curious how you handle it with the setup described in this tutorial.
The text was updated successfully, but these errors were encountered: