Hello NixOS team,
I’ve been using NixOS for a couple of years and appreciate its reproducibility, atomic upgrades, and rollback capabilities. Over time I’ve noticed a consistent gap: support for legacy binaries, proprietary drivers, and other software that fundamentally assumes a traditional FHS layout or mutable global paths.
Existing approaches like buildFHSUserEnv, nix‑ld, or containers/sandboxes help to some degree, but they are limited:
-
They are not first‑class config constructs.
-
They don’t integrate with NixOS’s activation/rollback model.
-
They don’t make it smooth or declarative to include legacy components in a system config.
At the same time, many users — especially those coming from distributions like Arch — want a middle ground:
an explicit, opt‑in impurity layer that provides a host‑integrated FHS‑like environment that:
-
Is declared in NixOS config.
-
Can contain packages or drivers that assume traditional paths (
/bin,/usr/lib,/etc). -
Is tracked and participates in rollbacks.
-
Doesn’t dilute the purity of the rest of the system.
One way to express this would be a new config construct, e.g.:
impure {
name = "legacy-printer";
packages = with pkgs; [ cups hplip legacy-driver ];
fhsRoot = "/var/impure/legacy-printer";
allowMutableEtc = true;
}
This would be conceptually similar to Rust’s unsafe { … } blocks: clearly marked zones of impurity, used only when necessary.
I believe this could address long‑standing pain points such as:
-
Legacy printer/scanner drivers that only ship for Debian/Fedora.
-
Vendor blobs or drivers that cannot be repackaged in a pure Nix way.
-
Tools or binaries that fundamentally rely on global mutable locations.
Importantly, this proposal doesn’t remove or weaken NixOS’s guarantees for the rest of the system — it simply provides a declared escape hatch that remains rollback‑aware and manageable.
I’ve searched upstream documentation and discussions, and while there are tools and techniques to approximate parts of this idea, there is no upstream support for a concept like this today. I think a well‑designed solution here could significantly broaden the practicality of NixOS for more users.
Happy to help with prototyping, documentation, or implementation discussion!
Thank you for your work on NixOS — it’s a unique and powerful system.
Best,
XanderTheDev