this post was submitted on 17 Jul 2023
8 points (100.0% liked)

nixos

1467 readers
1 users here now

All about NixOS - https://nixos.org/

founded 5 years ago
 

I've been hopping around Gentoo and Void the past few days with musl on both, and I'll be going back to NixOS in a bit due to not having enough time to set up either of them. I've realised how little RAM either systems use on musl, though, and I was wondering if there is any chance of replacing glibc with musl on NixOS?

top 2 comments
sorted by: hot top controversial new old
[โ€“] hallettj@beehaw.org 2 points 2 years ago* (last edited 2 years ago) (1 children)

Nixpkgs includes packages compiled for musl under the pkgsMusl prefix. For example, pkgs.pkgsMusl.hello. IIUC these only exist on a Linux system.

Maybe you can use those packages for everything by setting pkgsMusl as your package set. For example if you are using Home Manager with a flake config you normally have a line like,

let pkgs = nixpkgs.legacyPackages.${system};

Maybe you could change that to

let pkgs = nixpkgs.legacyPackages.${system}.pkgsMusl;
[โ€“] ck_@discuss.tchncs.de 7 points 2 years ago

This technically exists but practically #musl is a third class citizen on #NixOS. They don't run a hydra test set for package builds so core packages break all the time, dragging down the whole system. Until there is an actual musl community forming in the NixOS space, I doubt anyone will have a good time using it for a complex system build. Also keep in mind that there is no binary cache for musl builds (as far as I know), so if a core package gets an update, there goes your weekend. Due to the concepts of #Nix you basically run an emerge --empty-tree on a regular basis.