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 run should call a flake package by it's pname #4422

Closed
nrdxp opened this issue Jan 3, 2021 · 2 comments
Closed

nix run should call a flake package by it's pname #4422

nrdxp opened this issue Jan 3, 2021 · 2 comments

Comments

@nrdxp
Copy link

nrdxp commented Jan 3, 2021

contenxt numtide/flake-utils#17

When absent an app declaration, a binary in packages should be called by "$out/bin/${pname}". Currently this fails with nix run by attempting to call the binary: "$out/bin/${pname}-{version}".

@zimbatm
Copy link
Member

zimbatm commented Jan 4, 2021

The issue is that when it parses the name, it's not able to make out the version number:

nix-repl> builtins.parseDrvName "wii-u-gc-adapter-ae6b46d"
{ name = "wii-u-gc-adapter-ae6b46d"; version = ""; }

The version has to start with a number, that's why you often see an ISO date in nixpkgs for unstable versions.

nix-repl> builtins.parseDrvName "wii-u-gc-adapter-2021-01-01ae6b46d" 
{ name = "wii-u-gc-adapter"; version = "2021-01-01ae6b46d"; }

Here is where the conversation from derivation to app is happening:

.program = outPath + "/bin/" + DrvName(name).name,

@edolstra
Copy link
Member

edolstra commented Jan 4, 2021

Right, the issue in https://github.com/nrdxp/nixflk/blob/b7016c8d92a132c2e4d63861ac0357bc9f994a3a/pkgs/misc/drivers/wii-u-gc-adapter/default.nix is using a Git commit hash as a version, which is not supported by Nix (but unfortunately not checked by stdenv.mkDerivation).

@edolstra edolstra closed this as completed Jan 4, 2021
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

3 participants