-
Notifications
You must be signed in to change notification settings - Fork 87
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 .#
in workspace doesn't work unless version =
is set
#224
Comments
Code examples (the fix: crev-dev/cargo-crev@3d24846) |
This is interesting. It seems Nix automatically strips version numbers, but fails (understandably) for the "unknown" suffix. We can either:
|
Hmmm.... I'm running into a similar problem where instead of trying to run |
In case a little more info is useful, my working {
inputs = {
naersk.url = "github:nmattia/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils, naersk }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
nativeBuildInputs = with pkgs; [ gtk4 pkg-config ];
in {
defaultPackage = naersk-lib.buildPackage {
root = ./.;
inherit nativeBuildInputs;
};
defaultApp = let
drv = self.defaultPackage."${system}";
name = pkgs.lib.strings.removeSuffix ("-" + drv.version) drv.name;
in utils.lib.mkApp {
inherit drv;
# TODO: https://github.com/nix-community/naersk/issues/224
exePath = "/bin/${name}";
};
devShell = with pkgs;
mkShell {
buildInputs =
[ cargo rust-analyzer rustc rustfmt rustPackages.clippy ];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
inherit nativeBuildInputs;
};
});
} |
I just stumbled upon this issue myself. |
Without
version =
the binary will be/nix/store/0xdfyy5fsl4pisiqki0slc2ajr62jdfg-<name>-unknown/bin/<name>
butnix run
will try to execute/nix/store/0xdfyy5fsl4pisiqki0slc2ajr62jdfg-<name>-unknown/bin/<name>-unknown
The text was updated successfully, but these errors were encountered: