New desktop OS install: done! 🚀

You can find more details about this PC build’s hardware at https://michael.stapelberg.ch/posts/2025-05-15-my-2025-high-end-linux-pc/ if you’re curious :)

Let’s see how this goes :D And yes, before you ask, of course I’ll blog about my experiences.

#NixOS

Another boss fight done:

Successfully configured my printer! 🥳

I’m making life a little harder for myself because I use systemd-resolved (which Tailscale recommends), so I needed to add MulticastDNS=yes settings until `resolvectl` shows +mDNS on my ethernet interface.

Also, I needed `services.avahi.enable = true;` in addition, only then did mDNS resolution start to work.

Lastly, I had to un-pause the printer in the CUPS web interface (not sure why it’s discovered paused…?)

Today’s boss fight was upgrading the nVidia driver to the beta version, to see if I will encounter a different (less annoying) set of bugs with the newer version :)

This involved cherry-picking commit https://github.com/NixOS/nixpkgs/pull/412157/files because I also need a recent Linux kernel version for the hardware in this machine.

The next boss fight seems to be getting a cross-compilation environment for aarch64 set up that supports static linking (aarch64-unknown-linux-gnu-gcc -o hello hello.c -static)

#NixOS

linuxPackages.nvidiaPackages.latest: 565.77 -> 575.57.08 by Kiskae · Pull Request #412157 · NixOS/nixpkgs

Highlights since R575 Beta Release, 575.51.02 Fixed a bug that led to increasing memory usage in X11 OpenGL and Vulkan applications after suspend/resume cycles. Fixed a bug that could cause OpenGL...

GitHub
@zekjur `pkgsCross.aarch64-multiplatform.pkgsStatic.stdenv`? (Also surprised to see my own avatar show up here)

@Kiskae Doesn’t seem to work for me:

% nix shell nixpkgs#pkgsCross.aarch64-multiplatform.pkgsStatic.stdenv

% cat > hello.c <<'EOT'
#include <stdio.h>
int main() { printf("hello"); }
EOT

% aarch64-unknown-linux-gnu-gcc -o hello hello.c -static
/nix/store/4bm6qshwzvbwa03svi1zkk13z20s5cm5-aarch64-unknown-linux-gnu-binutils-2.44/bin/aarch64-unknown-linux-gnu-ld: cannot find -lc: No such file or directory

@Kiskae I wonder if glibc just doesn’t support static linking in nixpkgs? Seems like with musl, this works works:

% nix shell \
nixpkgs#pkgsCross.aarch64-multiplatform.pkgsStatic.stdenv.cc \
nixpkgs#pkgsCross.aarch64-multiplatform.pkgsStatic.musl
% aarch64-unknown-linux-musl-gcc -o hello hello.c -static

@zekjur I think you need `glibc.static` as a buildInput when compiling static executables with glibc. `pkgsStatic` defaults to musl because of gotchas like that: https://github.com/NixOS/nixpkgs/issues/196329#issuecomment-1280215829
`pkgsStatic` shouldn't imply musl. · Issue #196329 · NixOS/nixpkgs

Describe the bug pkgsStatic switches the libc from the default glibc to musl. But musl has its own pkgs overlay, that should compose with pkgsStatic. Currently it does not: #114510. See also #13654...

GitHub
@Kiskae Thanks for the link, I’ll poke around a little more…

@Kiskae

Figured out a flake.nix that gets me a working build:

{
inputs.nixpkgs.url = "github:NixOS/nixpkgs";

outputs =
{ self, nixpkgs }:
{
devShells.x86_64-linux.default =
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
crossPkgs = pkgs.pkgsCross.aarch64-multiplatform;
in
pkgs.mkShell {
buildInputs = [
crossPkgs.stdenv.cc
crossPkgs.glibc.static
];
};
};
}

Thanks!

#NixOS