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

nix-shell: any way to access checks from flake.nix? #7

Open
bbigras opened this issue Mar 17, 2022 · 1 comment
Open

nix-shell: any way to access checks from flake.nix? #7

bbigras opened this issue Mar 17, 2022 · 1 comment
Labels
question Further information is requested

Comments

@bbigras
Copy link
Contributor

bbigras commented Mar 17, 2022

I'm trying to port my shell.nix to Nickel and I can't figure out how to use checks from my flake.

{
  shellHook = ''
    ${self.checks.${system}.pre-commit-check.shellHook}
  '';
}

https://github.com/bbigras/nix-config/blob/e9531626e39a88a17c5aa888498418083b953243/nix/dev-shell.nix#L26-L28

My dev-shell.ncl so far is:
https://github.com/bbigras/nix-config/blob/9cd66da961cd4e8a03b48d2a16a3318cc2d82604/nix/dev-shell.ncl

@thufschmitt
Copy link
Member

Looks like packages (or legacyPackages) is hardcoded here. It would be nice to make this a bit more generic (maybe replicating the search logic of Nix which also searches at the toplevel? Or just getting rid of this search logic at all maybe).

You can also probably work around it by hacking something like devShell = importNcl ./nix/dev-shell.ncl (inputs // { myChecks.packages = self.checks; };, although that’s not really pretty 🙃

@thufschmitt thufschmitt added the question Further information is requested label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants