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

Include dependency from GitHub #8

Open
Burtannia opened this issue Sep 19, 2024 · 2 comments
Open

Include dependency from GitHub #8

Burtannia opened this issue Sep 19, 2024 · 2 comments

Comments

@Burtannia
Copy link

Burtannia commented Sep 19, 2024

Hey, I'm relatively new to nix and hix, I've been trying to include a library from GitHub but so far haven't managed to get it working.

I'd like to do something like the following:

{
  description = "A Haskell project";
  
  inputs = {
    hix.url = "github:tek/hix?ref=0.7.1";
    sem-log.url = "github:Functional-Core/sem-log";
  };

  outputs = {hix, sem-log, ...}: hix.lib.flake {
    overrides = { hackage, unbreak, notest, jailbreak, source, ... }: {
      polysemy-test = unbreak jailbreak;
      polysemy-conc = jailbreak;
      polysemy-log = jailbreak;
      servant-auth-server = unbreak;
      sem-log = sem-log;
    };
...

I've read through the Hix documentation and couldn't find any reference to GitHub deps, only to hackage and source.

@tek
Copy link
Owner

tek commented Sep 19, 2024

Hey! Github flake inputs are equivalent to directories, so you should be able to simply use sem-log = source.root sem-log; there (if the Cabal project is at the root, otherwise it's source.sub).

Since sem-log also uses hix, you could even use a more convenient method:

{
  outputs = {hix, sem-log, ...}: hix.lib.flake {
    depsFull = [sem-log];
  };
}

That will include the overrides defined in sem-log's flake (also described in the docs, probably a bit too terse).

I should probably include a comprehensive example like this in the manual. Thanks for the feedback!

@tek
Copy link
Owner

tek commented Sep 19, 2024

Actually, it would be best if it just worked the way you tried it, using sem-log = sem-log – if the value is a path, it could default to source.root!

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