Code Monkey home page Code Monkey logo

Comments (5)

zimbatm avatar zimbatm commented on June 11, 2024 1

The whole apps and mkApp has become somewhat redundant. Historically, nix run was relying on that construct to run things. Since then It has acquired its own heuristic and can lookup the packages and legacyPackages. You can try this out by running nix run nixpkgs#hello. So I would just expose the packages and let deal with resolving the right one.

One case where I think mkApp is still useful, is when a derivation output contains multiple binaries. For example, you might have yourflake#coreutils and also want to expose yourflake#ls and yourflake#mkdir`. In that case, I expect the correspondence to be drawn manually.

from flake-utils.

nrdxp avatar nrdxp commented on June 11, 2024

Without an app declaration, nix run seems to call the value of name by default to evoke the binary, which in a lot of cases is "${name}-{pname}". There is an effort to standardize this. NixOS/nixpkgs#103997. In particular, it fails for me.

We should probably call a package by its pname instead. NixOS/nix#4422

from flake-utils.

zimbatm avatar zimbatm commented on June 11, 2024

Do you want to do something about this? I think the conclusion of NixOS/nix#4422 (comment) might apply here as well.

from flake-utils.

blaggacao avatar blaggacao commented on June 11, 2024

It seems I'm just hitting this:

$ nix run .#CashBoxy:exe:Main
warning: Git tree '/home/blaggacao/ghq/git.p1.rocks/SideProjects/CashBoxy' is dirty
trace: gitSource.nix: /nix/store/bbln8w5gf3fainh1206f42q4zry0gmgi-source does not seem to be a git repository,
assuming it is a clean checkout.
trace: To materialize project.plan-nix for CashBoxy entirely, pass a writable path as the `materialized` argument and run the 'updateMaterialized' script in 'passthru'.
error: --- SysError ----------------------------------------------------------------------------------- nix
unable to execute '/nix/store/baskvl2ay7mrprgjaq75w5ndclxp39m5-CashBoxy-exe-Main-0.1.0.0/bin/CashBoxy-exe-Main': No such file or directory

But

$ ls /nix/store/baskvl2ay7mrprgjaq75w5ndclxp39m5-CashBoxy-exe-Main-0.1.0.0/bin
Main

so its /bin/Main vs bin/CashBoxy-exe-Main

It's all new to me, but I conclude that program = v.exePath still has it's validity?

from flake-utils.

nrdxp avatar nrdxp commented on June 11, 2024

If any similar issues arise in the future, they should be routed to upstream nix to improve the hueristic for launching packages.

from flake-utils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.