Conversation

I might regret asking this but -- is there a guide out there to nix for human beings?

I like the idea of nix in theory but every time I look at any nix documentation or configuration files my eyes glaze over after about 12 seconds and I give up.

(really what's happening is that I’m using a Mac right now, I miss Linux package managers, I'm mad at homebrew, I'm somewhat hopeful that nix can help me manage my packages more sanely, but I'm unwilling to spend a million hours learning nix)

7
0
1

@b0rk Have you tried macports on macOS? I find it's much more well-behaved

1
0
0

the way I'm currently using nix is to:
1. just replace `brew install graphviz` with `nix-env -iA nixpkgs.graphviz`
2. put /Users/bork/.nix-profile/bin in my PATH
3. that's it

and it works pretty well but it's so different from the Correct Way to use nix that it's very hard to learn how to do new things like define my own custom packages

(no need to tell me this is Wrong Way to use nix, I promise I know that :))

1
1
0

@b0rk you've summarized a want of mine (but on @elementary which might be me doing it on hard mode)

1
0
0

@jalcine i get the impression that everything with nix is on hard mode anyway

0
0
0

@b0rk not so much a suggestion as a piece of advice, but try not to get hung up on all the stuff telling you the “right” way to use nix. You can get pretty far with just nix-env -i and don’t need to jump straight into flakes, or home-manager.

1
0
0

@iaz thanks! that's what I've been doing already (I literally just use nix-env -i and that's it) but I've been struggling with figuring out how to do other things (like remove packages, or define my own custom packages for things that aren't in nixpkgs)

0
0
0

@paul_ipv6 nix as in https://nixos.org/, not unix :)

1
0
0

@b0rk

yup. noticed after reading too quickly and deleted my post.

*nix != *nix... :)

0
0
0

@cadey @b0rk

That's how I've encouraged others to take it up, no need to complicate package management unless you have the want/need.

1
0
0

@newplagiarist @cadey thank you! it's actually super helpful to know that this is a normal thing to do, when I read about nix online all I ever see is people explaining why using nix-env in this way is Not The Nix Way

1
0
0

@b0rk I’m curious: What’s wrong with Homebrew? I used Fink in the early days of OS X, and that was always a nightmare after major OS upgrades, but I haven’t had any issues with Homebrew that I can remember.

1
0
0

@hagedose68 i got mad at it because sometimes when I install new packages it updates a million other packages and it takes forever

0
0
0

@b0rk @newplagiarist Do you want me to mint you a certificate that says you're using it correctly?

0
0
0

@b0rk an old colleague of mine put together a series of videos on Nix that I found really helpful: https://youtube.com/playlist?list=PLRGI9KQ3_HP_OFRG6R-p4iFgMSK1t5BHs

@cadey’s blog is also a treasure trove: https://xeiaso.net/blog/series/nix-flakes

1
0
0

@b0rk I also found https://nixcloud.io/tour/?id=1 to be a good way to build a basic understanding of the Nix language.

1
0
0

@dc thank you! my plan is to avoid learning the nix language forever though :)

0
0
0

Hm, maybe I should give nix another look…

RE: https://social.jvns.ca/users/b0rk/statuses/109944259361119274

1
0
0

@alpha I’m slowly moving my dev setup from homebrew to nix & nix flakes and it’s been really nice.

1
0
1

@swindsor I’m still not sure it’s really worth it, sigh.

1
0
0

@alpha probably more benefit for me right now given the role. I have to jump in/out of many projects with various versions of languages. Running all the various language version manager hooks got to a point where my shell was unusable for normal tasks. Fighting over lib dependencies for those also became a struggle. But it’s not a normal dev flow.

1
0
1

@swindsor I’ve moved most of the language version manager stuff (except for Ruby) into direnv, so it’s per-project (well, directory), which has actually been pretty nice. But solving lib dependencies would be pretty nice…

Do you have a nice way of integrating with package managers? That was one of the main obstacles that I couldn’t iron out in a satisfying way last time I gave nix a try.

1
0
0

@alpha direnv has both nix shell and flake integration and it works really nice. Nix thinks very differently wrt version, which takes a bit of getting used to. The shorter answer use using a package, then overlay to specific version, then if you use flakes, you can lock it. But it really depends on the pkg & language.

1
0
0

@swindsor I know, I’ve used several different kinds of direnv+nix integration. 😛

That’s the thing though, I don’t want to manage language-specific dependencies through nix when there’s already tooling for that purpose already. It might not be as technically reproducible as nix would prefer, but I don’t really care and would rather use the language ecosystem conventions.

0
0
1

@b0rk I found this conversation via your blog. When I saw your reaction to the lack of conceptual clarity in most presentations of nix, it resonated strongly. Then, I immediately thought — if only @b0rk would create yet another brilliant zine!!!

1
0
0

@IPmonger i’m unlikely to write a zine but as you probably saw i wrote a couple of blog posts!

0
0
0