What is the equivalent of `configuration.nix` for just the Nix package manager?

I’m using Nix on Fedora Silverblue, but I simply cannot find anything on how to declare your configuration outside of NixOS. Does it even exist?

1 Like

It does, there are a variety of potential options depending on what your actual use case is. NixOS configuration specifically is not possible though, that’s like asking if you can install debian on your ubuntu (and yes, you can do it in a VM, but I don’t think that’s what you’re asking).

This gist was recently shared around here and summarizes your options pretty well: Expression for a buildEnv-based declarative user environment. · GitHub. If you want “NixOS but without using the distro” home-manager is probably the closest match today. It’s limited to only configuring things for the scope of your user, but for typical desktop single-user systems that’s almost everything.


There are also some initial discussions to support a limited set of system services (and therefore configuration options) on other distros (and even other operating systems), but no such thing currently exists.

Ultimately it’d be infeasible to port over the entire set of services (and therefore configuration options) in NixOS, because of how differently all the various distros manage services. It’d be impossible to get a generic implementation of services.cups or hardware.opengl, for example, those things are just tied too fundamentally to how the distro operates. Stuff like services.nginx may one day be feasible though.

1 Like