HackerTrans
TopNewTrendsCommentsPastAskShowJobs

pushtheenvelope

no profile record

Submissions

Upgrade Your Development Environments with Devbox

alan.norbauer.com
6 points·by pushtheenvelope·3 वर्ष पहले·2 comments

Why did Nix adopt Flakes?

jetpack.io
121 points·by pushtheenvelope·3 वर्ष पहले·67 comments

comments

pushtheenvelope
·2 वर्ष पहले·discuss
Devbox aims to solve this very problem: https://www.jetify.com/devbox
pushtheenvelope
·3 वर्ष पहले·discuss
blackr, if you'd allow a small plug: we develop https://jetpack.io/devbox for this very scenario.

Devbox will give you the same project environment (packages, env-vars) on your work and home laptop. It leverages nix, and uses your native file-system avoiding the overhead and complexity of using Docker.
pushtheenvelope
·3 वर्ष पहले·discuss
yikes! thanks for pointing that out. The blog's renderer is confused too and renders the `#cowsay -- flakes are neat` as a comment.

To explain what's happening:

- The example above is running `nix run <flake output attribute> -- <arguments to pass to the flake output's binary>`.

- The `<flake output attribute>` here is `.#cowsay`, which is to be read as: `<flake reference>#<attribute path>`. The # is a separator here.

- The `<flake reference>` being `.` implies its a local flake at the current directory. The `<attribute path>` in this case is the output from the flake i.e. the `cowsay` program.

further fun to be found at: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix....

As a meta-comment, yeah, this is kinda non-trivial for most of us. This is why we build devbox which provides a more familiar UX like `devbox add cowsay && devbox run -- cowsay "flakes are neat"`
pushtheenvelope
·3 वर्ष पहले·discuss
idk, someone (moderator?) changed it back ...
pushtheenvelope
·3 वर्ष पहले·discuss
I love the analogy!

I think this is a great strength of flakes. Packaging an application can sometimes have nuances that external folks may not be fully aware of and so having the packaging instructions (i.e. flake.nix) defined in the core repository can narrow that knowledge gap.
pushtheenvelope
·3 वर्ष पहले·discuss
ah, yeah, we have a cheeky workaround for this in Devbox ;-)

https://github.com/jetpack-io/devbox/blob/main/internal/impl...
pushtheenvelope
·3 वर्ष पहले·discuss
s/adopt/introduce

done :)
pushtheenvelope
·3 वर्ष पहले·discuss
Oh, it isn't intended to be provocative.

The title is simply literally the question that I was thinking about a few months ago when working on Devbox, and wrote a version of this post internally to answer the question for myself!
pushtheenvelope
·3 वर्ष पहले·discuss
would you mind elaborating on the difference?