This thought arise when I was looking at nix-fast-build. The flake itself is not important for the issue, only the fact that is not yet packaged on nixpkgs
.
Since its default package — packages."<system>".default
— is not packaged on nixpkgs
, one must set the installable to the git repo when using nix run
like so:
nix run github:Mic92/nix-fast-build
However, by doing so, one would always get the latest commit at its main
branch. To avoid this, a git ref could be added to the installable:
nix run github:Mic92/nix-fast-build/1ff0e1beb6ff70419a1269248325417eaae294a9 # latest commit at the time I've wrote this
But that ref would need to be manually updated, that is, one would not be able to use nix flake update
. For it to be possible, the nix-fast-build
flake would need to be added to the flake project’s inputs
.
By doing that, the following options are possible:
-
Make it available as either a
package
or anapp
. However, this causes a problem: if the flake project already provides packages or apps of its own, it will now also provide anix-fast-build
package or app. -
Add the package to one of the
devShells
packages
attribute, invoking it as:nix develop ".#<respective-devShell>" --command nix-fast-build
Would there be any more straightforward ways of achieving what the presented solutions do, preferably, without the mismatch of packages
or apps
like in the second one?