Live data from Hacker News

Ditch your version manager

juliu.is

121–130 of 155 posts

Re: Ditch your version manager

#121

Earlier quoted context omitted.

You can do version pinning with flakes: https://nixos.wiki/wiki/Flakes

> You can do version pinning with flakes: https://nixos.wiki/wiki/Flakes 1. How ? You'd think such a simple thing, especially in the context of "ditch version managers" would be easy and warrant at least an example. So far I've had: - ignoring the question or avoiding the answer - one answer "just use overlays" with no example - one answer "just use flakes" with no example 2. It's a separate, unstable feature It amaz…

Looks like you are right. Relevant issue: https://github.com/NixOS/nixpkgs/issues/93327

Re: Ditch your version manager

#122
post #48

Earlier quoted context omitted.

Are there any examples of people doing this? Sounds interesting

$ VER=$(dpkg -s alsa-oss | grep -m1 '^Version: ' | sed -e 's/^Version: //g') $ cat > Dockerfile That's a complicated example. All you need to do is get a working system, specify the base image tag, run dpkg -l and write down all the versions, then pass them to apt-get install . It's super easy. It's much more complicated to do something like download a static Go app from a specific URL, import a GPG key, validate the…

I may be wrong, but I believe one caveat here is apt may not always have some version of packages available. I believe only the latest one in each `deb-src` is available.

This is not an issue with nix as nix has the ability to build the entire system from source forever in a single command.

Re: Ditch your version manager

#123

Earlier quoted context omitted.

> Reading your linked post, it seems you are wrestling with how Nix works. Not only me. > That's because it's solving slightly different problems than package managers currently do. We keep hearing this claim, and hardly any proof of that. > As the overriding example shows, the versions are pinned by hash and are stored in a file. What about it is not maintainable or scalable? 1. Commit hashes are not versions 2. Hun…

> Hunting down every commit hash of every package to pin down the exact version is neither maintainable nor scalable I believe flakes will make this a lot easier, but it's not quite here yet.

In terms of version pinning, flakes are essentially just an in-tree equivalent of niv, I will say.

Re: Ditch your version manager

#124
post #97

The problem I have with Nix (and Guix) is that you're shit out of luck if you need it to work together with some network based package manager or existing project that someone didn't add to it yet. It gets really complicated really fast, and things that "just work" with other packages managers and projects, because they are opinionated and linux-y, most of the time don't work well with Nix or have to be shoehorned in…

> you need it to work together with some network based package manager

Well, you can disable sandboxing if you want, although it's not recommended. This lets you run a package manager that requires networking in a derivation.

Re: Ditch your version manager

#125
post #80

Earlier quoted context omitted.

First, dependency manager vs package manager. Potayto potatoh. Second. The reason I recommend direnv is because of ergonomics, so you don't have to remember to reload your shell. Most current version managers either do it themselves through shell hooks or ask you to install direnv. Point taken on using brew: I've changed it to use nix-env. Third. Yep. Sort of like having to learn English before you can learn programm…

> No other package manager can freeze the complete dependency set you are using I don't know if you realise that your post makes a poor case for that, and for imagined reproducibility of nix builds? 1. Direct quote from your post: "if you tried to follow this article step by step, you’ll have noticed that the versions of ruby and node you installed are probably slightly different from the ones above". The "solution"…

Here is an example if you absolutely want to pin Ruby to 2.6.7 while pulling all other packages from a more recent set of packages https://gist.github.com/Arkham/31297c1d75fc59f723a50063bc0f5...

I found the nixpkgs version using this tool: https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable...

Note that Ruby 2.6.8 fixes three severe vulnerabilities present in Ruby 2.6.7, while being backward compatible, so I don't see why you'd want that.

Re: Ditch your version manager

#126
post #87

Earlier quoted context omitted.

> First, you want a "dependency manager". That's not what Nix is, clearly. Nix is a package manager. This is not true. The defining point about Nix is that it allows to define all dependencies explicitly. Every derivation in it is built inside of a sandbox with no access to network and restricted filesystem. This ensures that nothing is accidentally missed. Package management is just one of features. > Second, to use…

> Because the starting state and all dependencies are known it can always create the same result, that's the biggest selling point of Nix to me. And you can do that with the package manager of any Linux distro today. It sounds like Nix's biggest selling point is it does something we can already do.

There are implicit dependencies and explicit ones. Build dependencies and runtime ones.

Other package managers typically handle the last one and completely ignore implicit dependencies.

Re: Ditch your version manager

#127

Earlier quoted context omitted.

You can do version pinning with flakes: https://nixos.wiki/wiki/Flakes

> You can do version pinning with flakes: https://nixos.wiki/wiki/Flakes 1. How ? You'd think such a simple thing, especially in the context of "ditch version managers" would be easy and warrant at least an example. So far I've had: - ignoring the question or avoiding the answer - one answer "just use overlays" with no example - one answer "just use flakes" with no example 2. It's a separate, unstable feature It amaz…

Here's an example https://gist.github.com/Arkham/31297c1d75fc59f723a50063bc0f5...

I used this tool to find the specific nixpkgs version https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable...

Re: Ditch your version manager

#128

Earlier quoted context omitted.

It's not about what is possible, it is about ergonomics. We could have used email for conversations online, yet we use Slack. Other tool require lots of thought and carefull execution for what Nix gives you for free.

> Other tool require lots of thought and carefull execution for what Nix gives you for free. How do I pin ruby version to 2.6.3 in Nix? This is given to me for free in other tools. As are reproducible builds because all modern package/dependency managers lock versions.

Here is an example if you absolutely want to pin Ruby to 2.6.7 while pulling all other packages from a more recent set of packages https://gist.github.com/Arkham/31297c1d75fc59f723a50063bc0f5...

I found the nixpkgs version using this tool: https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable...

Re: Ditch your version manager

#129

Earlier quoted context omitted.

> If that commit is still available. Why wouldn't it be available? Nix packages are on github. [1] > And that's on top the fact that "if you tried to follow this article step by step, you’ll have noticed that the versions of ruby and node you installed are probably slightly different from the ones above" That's the same as on any other host. If I write about installing ruby on ubuntu today and you read the blog post…

> Why wouldn't it be available? Nix packages are on github. [1] 1. Git history can be re-written. 2. Nix packages still point to some specific versions that may or not may be available [1] So how exactly is nix so much different from "a problem with our CI/CD pipeline because an old package that's a sub dependency wouldn't install anymore"? > That's the same as on any other host. If I write about installing ruby on u…

Here is an example of doing what you want https://gist.github.com/Arkham/31297c1d75fc59f723a50063bc0f5...

I found the nixpkgs versions using this tool: https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable...

Re: Ditch your version manager

#130
post #127

Earlier quoted context omitted.

> You can do version pinning with flakes: https://nixos.wiki/wiki/Flakes 1. How ? You'd think such a simple thing, especially in the context of "ditch version managers" would be easy and warrant at least an example. So far I've had: - ignoring the question or avoiding the answer - one answer "just use overlays" with no example - one answer "just use flakes" with no example 2. It's a separate, unstable feature It amaz…

Here's an example https://gist.github.com/Arkham/31297c1d75fc59f723a50063bc0f5... I used this tool to find the specific nixpkgs version https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable...

Thanks. What if we want `ruby 2.3.1` not in any nixpkgs channel?
Post reply on HN