HNHacker News
TopNewBestAskShowJobs

jonringer117

127 karma · joined April 9, 2021

submissionscomments
jonringer117··on The Curse of NixOS
Glad someone found them useful :)
jonringer117··on NixOS 21.11 Has Been Released
NixOS is BestOS :)
jonringer117··on macOS Nix setup: an alternative to Homebrew (2020)
Release channels.

If you follow one for nixpkgs, it means that the infrastructure has at least attempted all possible builds. If you're starting to build something, it's likely broken. However, that's usually not the case. https://hydra.nixos.org/jobset/nixos/release-21.05

jonringer117··on macOS Nix setup: an alternative to Homebrew (2020)
Outside of configuring your system, almost everything from NixOS is applicable to other distro's. The only notable exception I can think of are video drivers, and you will need nixGL for that.

Otherwise, I would recommend looking at home-manager, it's essentially NixOS but for any linux distro, or even darwin with nix-darwin. https://github.com/nix-community/home-manager

jonringer117··on macOS Nix setup: an alternative to Homebrew (2020)
Nix+NixOS can also be used to describe iso's, installation iso, vm images, ami images, azure images, sd-card images, pxe-boot images, shell environments, and others.

Not to mention that nix can be used (with varying levels of success) on windows, intel macs, m1 macs, redoxOS, and others.

In general, it's write once, use anywhere.

jonringer117··on macOS Nix setup: an alternative to Homebrew (2020)
What you're looking for is `(python3Packages.withPackages (ps: with ps; [ pync ... ]))`

This will create a python which has pync and other packages in the sitePackages already.

jonringer117··on Nixos-unstable’s ISO_minimal.x86_64-Linux is 100% reproducible
Some of the issues were really difficult to tackle, like the linux kernel generating random hashes.

The last mile was done by removing the use of ruby (which uses some random tmp directories) from the final image. Asciidoctor (ruby) was replaced with asciidoc (python).

jonringer117··on “Please don't add any of my stuff to this project”
Generally if the patch is not-specific to nixpkgs, we ask the contributor to upstream the patch, and then we have a `fetchpatch` utility which makes it easy to pull from an upstream source.
jonringer117··on “Please don't add any of my stuff to this project”
Related context:

https://github.com/NixOS/nixpkgs/pull/126319

In response to "not having the latest": Generally we (nixpkgs) lag behind a bit, as managing ~60-100k packages takes some time. But as long as the process to build a package hasn't changed, we will have a bot which automatically attempts to update packages based on metadata from pypi, github, and repology.

jonringer117··on NixOS 21.05 has been Released
What is NixOS?

NixOS is a linux distribution with a focus on reproducibility. It's built upon the Nix package manager, making system configuration declarative, reproducible, and atomic.

Learn more at: https://nixos.org/

jonringer117··on “Shared libraries are not a good thing in general”
Nix doesn't really "wrap" anything besides compilers, or when it's absolutely necessary for an application. And the wrapping is only done so that there's a way to shoehorn certain CFLAGS, some nix-specific behavior, and other configuration options which an upstream may not have a great way to configure.

But for most mature build systems we largely just use the toolchain as-is. CMake, pkg-config, autotools, and other toolchains or technologies generally allow enough flexibility to enable non-FHS builds to be done in a consistent and easy manner. Actually, creating nix packages for upstreams which have good release management discipline is trivial once you're familiar with nix.

What makes nix special is that you when you go to build the package, you reference the dependencies through their canonical name, but nix translates these dependencies to a unique paths which are hashed to capture all inputs (including configuration flags) used to create the dependency. So you can use multiple conflicting versions of a dependency in a package's dependency tree without issue. Dependencies can be shared if a dependency matches exactly, but can differ if needed. And that's something that FHS distros cannot do.

Actually, since nix never makes any assumptions about what's installed on the system, you're free to use it on any distro. And it's hermetic, so the host system wouldn't be changed outside of the `/nix` directory. You can even use is it even on macOS, although it's not as well supported, but should work fine for common packages.

> A middle ground could be distros can keep control over the version that's being statically linked at build time.

Nixpkgs already does this, even if the dependency is dynamically linked. So there's no additional overhead with switching it out to the static variants; other than upstreams may not support that scenario as well as "traditional" dynamic linking.

jonringer117··on Nix is the ultimate DevOps toolkit
It's content addressable. If you use the old hash, it will just use the "old" contents happily (unless they don't exist). So you have to alter it slightly to get a "cache miss" to see what should have been produced.

This can be address by adding the version to the dependencies store path. This has been done for rust builds, not sure about go.

jonringer117··on Nix is the ultimate DevOps toolkit
It's still in development. But swapping a language is possible, as it's only needed for evaluation. Building the package (realization) just needs the derivation.
jonringer117··on Nix is the ultimate DevOps toolkit
I made a few videos, https://www.youtube.com/channel/UC-cY3DcYladGdFQWIKL90SQ . However, I need to produce more and of higher quality.
jonringer117··on Nix is the ultimate DevOps toolkit
The issue with `nix-env` is how it tries to decide a later version. Python also has this issue, because it will see that python3.7 has a newer version called `python3.10a3`, and installs the alpha/dev version, instead of the expected python3.7.x

Honestly, if people just used nix for `shell.nix` in projects, it's still major value added

jonringer117··on Nix is the ultimate DevOps toolkit
at least now, people get recommend to use `nix-shell -p <pkg>` when something is missing in NixOS
← PreviousPage 2 of 2