Repository navigation
Add a matrix of stdenvs to the flake - #4996
Conversation
cd656ea to
1dcb30e
Compare
| defaultPackage = forAllSystems (system: self.packages.${system}.nix); | ||
|
|
||
| devShell = forAllSystems (system: | ||
| devShell = forAllSystemsAndStdenvs (system: stdenv: |
There was a problem hiding this comment.
I don't think we should make devShell an attrset of derivations/shells. It's assumed to be a single derivation, like defaultPackage. So e.g. nix flake check won't check these. Maybe to enforce uniformity we should disallow attributes deeper than the expected level in the CLI...
Instead we probably should add a devShells flake output (and maybe rename devShell to defaultDevShell). That would also be less verbose since it can be searched by default, so instead of
nix develop .#devShell.x86_64-linux.clang11StdenvPackages
you could do
nix develop .#clang11StdenvPackages
There was a problem hiding this comment.
Oh indeed, devShells is much nicer. I’ve changed that in 6378f36, and I’ll probably open another PR shortly to make nix develop and the various nix flake commands aware of it
There was a problem hiding this comment.
I tried to use nix develop .#clang11StdenvPackages with this PR, and I get an error:
nix --experimental-features "nix-command flakes" develop .#clang11StdenvPackages
warning: Git tree '/src/nix' is dirty
error: flake 'git+file:///src/nix?shallow=1' does not provide attribute 'devShells.x86_64-linuxclang11StdenvPackages', 'packages.x86_64-linux.clang11StdenvPackages', 'legacyPackages.x86_64-linux.clang11StdenvPackages' or 'clang11StdenvPackages'
nix --version
nix (Nix) 2.4pre20210805_d64f967Also, completion gives other attributes:
.#defaultPackage .#checks .#
.#hydraJobs .#devShells .#devShell
.#nix-armv7l-linux .#nix-armv6l-linux .#nix
.#nix-clang11Stdenv .#nix-clangStdenv .#nix-gccStdenv
.#nix-stdenv .#nix-static .#overlay
It should be nix develop .#nix-clang11Stdenv .
Ericson2314
left a comment
There was a problem hiding this comment.
I do like this. I will build on this to duplicate the cross / static stuff.
(It was only ever the is only the way it use because there used to be an issue with nix being overridden in https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/static.nix, but it no longer is overridden there.)
6378f36 to
e7fa154
Compare
| or if you have a flake-enabled nix: | ||
|
|
||
| ```console | ||
| $ nix develop .#devShell.x86_64-linux.clang11StdenvPackages |
There was a problem hiding this comment.
This should be .#clang11StdenvPackages now right?
There was a problem hiding this comment.
Indeed, thanks. And actually the flake search path was broken (was missing a trailing .), so I fixed it.
I’ve also fixed the command above to use devShells and not devShell
e7fa154 to
2b1d251
Compare
|
Also, it seems that the Example: $ nix develop .#nix-clang11Stdenv
warning: Git tree '/home/pamplemousse/Workspace/tools/nix' is dirty
$ echo $MANPATH
$ nix develop
warning: Git tree '/home/pamplemousse/Workspace/tools/nix' is dirty
$ echo $MANPATH
/home/pamplemousse/Workspace/tools/nix/outputs/out/share/man: |
|
Ah, nevermind! Now, I use |
|
This is blocking for google/oss-fuzz#6317, as they require good upstream integration (they won't merge as long as I use my fork of Is there anything blocking the merge? |
|
Can we get this in before 2.4? I think it is decently important, and I would like to delete the duplicate |
|
We would make something like |
2b1d251 to
c28c9d9
Compare
For a (currently hardcoded and limited) list of stdenvs,
make `.#$nix-${stdenvName}` correspond to a Nix built with the
corresponding stdenv.
For example, `.#nix-${clang11Stdenv}` is Nix built with clang11.
Likewise, `devShells.x86_64-linux.clang11StdenvPackages` is a development
shell for Nix with clang11, that can be used with
```shell
nix develop .#clang11StdenvPackages
```
Fix #4129
/cc @Pamplemousse
Signed-off-by: Pamplemousse <[email protected]>
c28c9d9 to
288c252
Compare
|
Rebased on top of latest master. @edolstra care to have a look? |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
For a (currently hardcoded and limited) list of stdenvs,
make
.#$nix-${stdenvName}correspond to a Nix built with thecorresponding stdenv.
For example,
.#nix-${clang11Stdenv}is Nix built with clang11.Likewise,
devShell.x86_64-linux.clang11StdenvPackagesis a development shell for Nix with clang11Fix #4129
/cc @Pamplemousse