Live data from Hacker News

NixOS: Declarative Builds and Deployments

nixos.org

51–60 of 83 posts

Re: NixOS: Declarative Builds and Deployments

#51
post #39
post #35

Earlier quoted context omitted.

nix is so powerful precisely because it takes a pure functional approach. You don’t get that level of reproducibility if you allow side effects.

Avoiding side effects does not require inventing a brand new purely functional language programming language.

Is your issue with the fact the language is functional, or that it's a DSL specific to Nix?

Re: NixOS: Declarative Builds and Deployments

#52
post #37
post #22

I think the idea is good but execution is poor to reach mass adoption because: 1. It tries to replace ALL package managers due its extreme philosophy. I had a lot of issues when it tries to replace Cargo for example 2. It uses a functional language, which will lose 95% of users 3. It never had a great user experience especially if you’re new and trying to learn or if you’re not using linux or if you bring your own to…

I need to do some reading up on Nix, because I don't think I understand it. I thought NixOS was an operating system and Nix an operating system-level package manager, so why is it trying to replace Cargo, a package manager for a specific programming language in Rust?

For the same reason debian's APT manages rust dependencies for its packages - an OS-level package manager needs to support all its languages. Language-specific package managers fall short as they don't (and often can't) consider cross-language dependencies.

Re: NixOS: Declarative Builds and Deployments

#53
post #6

I like the idea of nixos. Having one file responsible for all packages installed on the system is way better than what traditional distro use. I just don't like the quality of the packages. It would be nice if someone could do something like a os wide packages.json but for a mature packages repository like Debian.

Alpine linux has a /etc/apk/world which is just a full list of all the packages currently installed I'm not a fan of nix but I'd say the nixos repository is fairly mature.

And gentoo has /var/lib/portage/world, and pacman has "pacman -Qe", and apt has "apt-mark showmanual".

...I sometimes wonder how the world would be if the "explicitly installed packages" functionality was better exposed and advertised. I never see any guide for "installing development dependencies" use things like "pacman -S --asdeps" so you can clean them up later.

Re: NixOS: Declarative Builds and Deployments

#54
I am not a (current) developer, though I have more dev experience than most laypeople. I have enough experience with languages to pick up a new one relatively easily but I’ve never done anything with a functional language. I installed NixOS after playing around with nix (the package manager) in Fedora.

1. While the WHAT of NixOS was obvious from the start, I have never had a more difficult time understanding HOW to get there with a piece of technology. The documentation is hilariously inconsistent.

2. I have also never encountered a more satisfying, useful, and time-saving piece of technology. I had a computer crash and it took me 15 minutes to be back to where I was on a completely different machine with about 2 commands.

3. Time-saving other than the vast learning curve anyway.

4. Unlike some tech projects, it’s not hard because it’s incomplete or poorly structured. It’s hard because it’s doing something different. (It’s arguable how different it is in 2024, but that’s a different conversation.)

5. To create my child’s account, I spent about 10 minutes editing a copy of my config to pick and choose the packages he needs, and it deployed (on the first go) in about 10 minutes, fully configured.

Projects like fleek that put a simplified face on nix are incredibly valuable, because they can unlock 65% of the benefit of the platform with almost zero effort. I can’t tell you if the time investment for the extra 35% is worth it for someone managing family computers, but, y’all, I spend less time fiddling with them now and they break less often. That’s a … plus?

Re: NixOS: Declarative Builds and Deployments

#55

I first looked at nix-shell which you can use to create ephemeral environments just like Docker, with the difference that they are 100% reproducible and you don't need containerd or like. It is awesome to create scripts which run the same on EVERY system. Then looked at NixOS. I geht the point of having a deklarative like OS which you can rebuild in a couple of minutes, BUT the nix language is kind of unituitive and…

> I first looked at nix-shell which you can use to create ephemeral environments just like Docker, with the difference that they are 100% reproducible and you don't need containerd or like.

Sounds like podman. What is the big differentiator from it?

Re: NixOS: Declarative Builds and Deployments

#56
post #48

I work on Nix and think this paradigm has already impacted and will continue to influence software devopment in general. I want to make it easier for organizations/companies/groups to adopt it. Ideas and questions are welcome.

I run NixOS on a VPS at work. It currently hosts a noVNC dashboard for monitoring. I didn’t nixify the app yet. I allocated a Debian and ran nixos-infect on it and started from scratch, even though I have done this for two other machines, because I’m still experimenting with the basic setup. I do commit changes to git and fork it on company git. But I don’t redeploy remotely: https://discourse.nixos.org/t/deploy-nixo…

If Hetzner allows custom images, then this tool may help: https://github.com/nix-community/nixos-generators

Cloud-init can be clumsy to get going, but it’s possible.

Re: NixOS: Declarative Builds and Deployments

#57

Earlier quoted context omitted.

Which package did you have issues with?

I think I remember having issues with the Kate package. There might have been others but that's the one that stuck for me.

it could be a myriad of things. Getting some features working requires searching around the internet, like getting spell checking working was... interesting.

Re: NixOS: Declarative Builds and Deployments

#58
post #48

I work on Nix and think this paradigm has already impacted and will continue to influence software devopment in general. I want to make it easier for organizations/companies/groups to adopt it. Ideas and questions are welcome.

I run NixOS on a VPS at work. It currently hosts a noVNC dashboard for monitoring. I didn’t nixify the app yet. I allocated a Debian and ran nixos-infect on it and started from scratch, even though I have done this for two other machines, because I’m still experimenting with the basic setup. I do commit changes to git and fork it on company git. But I don’t redeploy remotely: https://discourse.nixos.org/t/deploy-nixo…

I have step-by-step video guides (with accompanying git repos) for booting NixOS from zero on both Hetzner VPS instances[1] and bare metal Robot instances[2] with nixos-anywhere[3]. I used to use nixos-infect but now I'm 100% sold on nixos-anywhere.

[1]: https://www.youtube.com/watch?v=wr22CyoyRo4

[2]: https://www.youtube.com/watch?v=nlX8g0NXW1M&t=952s

[3]: https://github.com/nix-community/nixos-anywhere

Re: NixOS: Declarative Builds and Deployments

#59
post #48

Earlier quoted context omitted.

I run NixOS on a VPS at work. It currently hosts a noVNC dashboard for monitoring. I didn’t nixify the app yet. I allocated a Debian and ran nixos-infect on it and started from scratch, even though I have done this for two other machines, because I’m still experimenting with the basic setup. I do commit changes to git and fork it on company git. But I don’t redeploy remotely: https://discourse.nixos.org/t/deploy-nixo…

If Hetzner allows custom images, then this tool may help: https://github.com/nix-community/nixos-generators Cloud-init can be clumsy to get going, but it’s possible.

I used kexec into nixos installer image from hetzner recovery, using nixos-generators to make the image.

1. Boot with hetzner recovery OS

2. Install Nix in it (not nixos!)

3. Install nixos-generators

4. Generate kexec-bundle image

5. run the result of 4 and continue installation from it.

Re: NixOS: Declarative Builds and Deployments

#60

Earlier quoted context omitted.

You can pin versions with apt-get install...

What's the model of the pinning? Is it an arbitrary semver? Is it a sha256 calculated by the content of the package (Content Addressed)? Is it a checksum calculated from all the inputs that were used to create the package install spec (Input Addressed)?

[deleted]
Post reply on HN