Skip to content
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

Recommend use of haskellLib.packagesFromDirectory #55

Open
langston-barrett opened this issue Jul 17, 2018 · 4 comments
Open

Recommend use of haskellLib.packagesFromDirectory #55

langston-barrett opened this issue Jul 17, 2018 · 4 comments

Comments

@langston-barrett
Copy link

This function seems to do the same work as some of the code here: https://github.com/Gabriel439/haskell-nix/blob/master/project4/README.md. Is there overlap that could be reduced here?

@Gabriella439
Copy link
Owner

Yes, I added that function :)

I was planning to reuse it in this guide once I updated it to use (and pin to) a newer nixpkgs revision

@langston-barrett
Copy link
Author

Oh, I see you in the commit history 😄

I think this function doesn't drop in as I expected, can I ask for your advice? I have the following

  config = {
    packageOverrides = pkgs: rec {
        haskellPackages =
        let
          generatedOverrides = pkgs.haskell.lib.packagesFromDirectory { directory = "./nix"; };
          manualOverrides = haskellPackagesNew: haskellPackagesOld: {};
        in
          pkgs.haskellPackages.override {
            overrides =
              pkgs.lib.composeExtensions generatedOverrides manualOverrides;
          };
    };
  };

but it generates the error

error: string './nix' doesn't represent an absolute path, at /nix/store/y83nlg83yv3glcj7hjwcrngmxxzxkl9g-source/pkgs/development/haskell-modules/lib.nix:394:44

How can I get it to accept a relative path, like generatedOverrides does now?

@Gabriella439
Copy link
Owner

@siddharthist: I believe you need to remove the quotes around "./nix". i.e.: { directory = ./nix; }

@langston-barrett
Copy link
Author

Ah, as it says in the nixpkgs manual, such paths are made absolute at parse time: https://nixos.org/nix/manual/#idm140737318050944

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants