Skip to content

Support nix flake show --option allow-import-from-derivation false #95

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

Open
roberth opened this issue Feb 26, 2023 · 2 comments
Open

Support nix flake show --option allow-import-from-derivation false #95

roberth opened this issue Feb 26, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@roberth
Copy link
Collaborator

roberth commented Feb 26, 2023

This will allow inclusion of haskell-flake based projects into the NixOS flakes search.

I believe it can be done, but we'll have to make the set of attributes less dynamic, in particular we have to predict outputs, the names of the outputs.

lib.lazyDerivation NixOS/nixpkgs@fce8b01 produces an attrset that is a valid "derivation attrset" but only needs to evaluate the argument derivation for attributes that really need it, like drvPath, outPath, etc.

Our package definitions would have to look somewhat like

fix (pkg:
  lazyDerivation {
    derivation = callCabal2nix ...;
    meta = ... hardcoded or perhaps some `readFile` on `.cabal` sources if we dare ...;
    passthru = {
      inherit (pkg)
        overrideCabal
        overrideAttrs
        # ... any useful unconditional attributes
        ;
    };
  }
)

I can add multi-output support to lazyDerivation.

@roberth roberth added the enhancement New feature or request label Feb 26, 2023
@srid
Copy link
Owner

srid commented Feb 27, 2023

This would be good to have (though nix flake show would still not work if systems has other platforms).

I can add multi-output support to lazyDerivation.

Not sure what this means?

@roberth
Copy link
Collaborator Author

roberth commented Feb 27, 2023

though nix flake show would still not work if systems has other platforms

Why wouldn't it? The goal is to remove IFD from the attribute paths queried by that command. That should be sufficient to make it work for any system.

I can add multi-output support to lazyDerivation.

It doesn't handle derivations with multiple outputs correctly. Haskell packages do use multiple outputs by default, so I guess this issue is blocked on this.

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

No branches or pull requests

2 participants