HackerTrans
トップ新着トレンドコメント過去質問紹介求人

pushtheenvelope

no profile record

投稿

Upgrade Your Development Environments with Devbox

alan.norbauer.com
6 ポイント·投稿者 pushtheenvelope·3 年前·2 コメント

Why did Nix adopt Flakes?

jetpack.io
121 ポイント·投稿者 pushtheenvelope·3 年前·67 コメント

コメント

pushtheenvelope
·2 年前·議論
Devbox aims to solve this very problem: https://www.jetify.com/devbox
pushtheenvelope
·3 年前·議論
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 年前·議論
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 年前·議論
idk, someone (moderator?) changed it back ...
pushtheenvelope
·3 年前·議論
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 年前·議論
ah, yeah, we have a cheeky workaround for this in Devbox ;-)

https://github.com/jetpack-io/devbox/blob/main/internal/impl...
pushtheenvelope
·3 年前·議論
s/adopt/introduce

done :)
pushtheenvelope
·3 年前·議論
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 年前·議論
would you mind elaborating on the difference?