fenix icon indicating copy to clipboard operation
fenix copied to clipboard

packages output supposed to only contain derivations

Open kanashimia opened this issue 4 years ago • 5 comments

When you run nix flake check it complains that flake attribute 'packages.i686-linux.default' is not a derivation Same with nix flake show:

$ nix flake show github:nix-community/fenix 
github:nix-community/fenix/e9dcb2bf01b002ccc05edf7ddcc5bbf09c9a8cd0
├───overlay: Nixpkgs overlay
└───packages
    ├───aarch64-darwin
error: expected a derivation

At this moment packages.<system> is supposed to be an attrset of derivations, it can't contain functions, nested attrsets, etc. For the functionality of the above there is legacyPackages attribute, which nixpkgs uses, so can just switch to it.

Note: flakes are unstable, and their outputs aren't very though-out.

kanashimia avatar Nov 28 '21 00:11 kanashimia

In a similar vein, I was also a bit surprised to find inputs.fenix.packages.x86_64-linux.fromToolchainFile instead of fenix.fromToolchainFile.

(it took me literally 1/2 hour to figure that out)

EDIT: nvm, I now am surprised what fromToolchainFile does but not anymore why it's system spaced. I may have assumed that fromToolchainFile is composable with makeRustPlatform instead of wrapping it.

blaggacao avatar Dec 17 '21 17:12 blaggacao

I also frequently use nix flake show to get an idea about what a flake is offering. I can very much relate to @blaggacao; it's sometimes hard to start using specific fenix features.

veehaitch avatar Dec 20 '21 11:12 veehaitch

I haven't found a good way to fix the nix flake show or nix flake check issue, for now the readme have some type signatures and examples

figsoda avatar Aug 05 '22 12:08 figsoda

I opened #87 to try to fix this issue. It doesn't restructure the outputs but it does pass nix flake check and make nix flake show much more useful

figsoda avatar Oct 26 '22 21:10 figsoda

This can be closed, I think. nix flake show works. I was surprised that it's possible to put dots in names of derivations and even

nix build github:nix-community/fenix#packages.x86_64-linux.targets.wasm32-unknown-unknown.stable.rust-std

works.

dpc avatar Sep 28 '23 02:09 dpc