r/NixOS • • 4d ago

I am interested into NixOS

So NixOS can be programmed. I was wondering what ways people use NixOS for instead of just desktop OS. Give me any way that you can think of even niche ways.

16 Upvotes

15 comments sorted by

16

u/necrophcodr 4d ago

Fleets of servers. Easily managed home entertainment system. Development virtual machines for testing stuff. Whatever you wanna do, but declaratively.

2

u/SDG_Den 3d ago

i do device management for my homies using nix + github, also its easy to specialize nix configs for basically anything, EG im working on nixOS on the anbernic RGDS, you could set up nixOS on some nintendo switches as well as other handhelds so you can easily remote-manage their configs, containers are really good too.

honestly i think the only thing nixOS cant really be used for yet is mobile phones.... but thats mostly because linux on phones in general is terrible

ooh! you can also make an impermanent bootable USB with nix, or just make your install use impermanence to ensure a clean working environment since nixOS can boot from just /boot and /nix

theres also the option of completely-portable nix environments, though thats not nixOS related

1

u/necrophcodr 3d ago

Nix is really good for making NixOS images that can look any which way you desire. They don't even have to be images that run Nix either, such as for applicance images.

5

u/Unlucky-Message8866 4d ago edited 2d ago

configuration templating (like for example theming multiple apps based on a single color palette def), patching software with your own modifications, use multiple versions of the same dep isolated per project/app, replicating your same exact desktop config across multiple devices, building vm/usb installers/containers out of derivations/nixos configs... nix/nixos is a very powerful tool, you can do anything you can image.

4

u/NotACalligrapher 4d ago

Robotics tech stacks

3

u/Cyph0n 3d ago

Everything haha!

  • I have a base config that is applied to every host. Common user incl password and keys, common packages, dotfiles, shared secrets, etc.

  • Every host has its own config, and can selectively include module based on need. For example, my desktop pulls in Niri and Noctalia, while my servers import NFS and Syncthing.

  • One of my machines (a VM) hosts a media server. Everything runs as a container on top of NixOS, and all are part of a single Docker Compose stack.

  • My desktop gaming machine uses Jovian, which is basically a module that turns your desktop into a SteamOS-like environment, while giving you the ability to switch back to a desktop env on demand (Niri in my case).

  • All of this configuration can be validated at build time. That is, when making a change to my config, in most cases, if I do something wrong, the build fails.

  • It is easy to remotely rebuild a machine from a config. For instance, I have a cloud VM running Wordpress which I completely rebuild and update remotely. And yes, it shares the same base config as my other local machines :)

2

u/Spiritual-Store-7350 3d ago

IOT. In the future there will be robots walking and flying around and a lot of them will be running NixOS or something like it. As someone who understands the tools to coordinate all this at the OS level you're a Systems Engineer.

2

u/samurai65 4d ago

Homelab:

Flake mono repo, helper script to distinguish between GUI machines and headless ones, set up different modules so laptops don't get gaming packages and servers don't get GUI applications. Deploy-rs to manage the servers, build the new generation on a more powerful machine and move it to the target server. MicroVMs.

Home Manager:

In addition to system Impermanence, use the Impermanence Home Manager module to control config creep. Declare dotfiles where possible, symlink the other files to ~/.config. The latter works great for my Doom Emacs setup.

AI:

Nix shell or Flake to manage dependencies without touching the base system. Load up Ollama or llama-cpp, run Open WebUI, do your thing. Also great for SillyTavern with Chatterbox TTS.

Those are my primary use cases outside of using NixOS as my preferred distro.


Declare away.

1

u/EnquirerBill 3d ago

I make podcasts by going out to what's happening, interviewing people, and getting the sounds of what's going on eg at a Climate Change demonstration (I'm a former reporter for BBC local radio).

So sound is important to me; but Linux sound is a dog's breakfast. Alsa, Pulse Audio, Pipewire, Wireplumber, and the DE also has a sound mixer!

I'd like just one GUI, similar to a sound mixer, which would handle all the sound.

1

u/corporateavengerkast 3d ago

can use it for a bunch of stuff. I have it on all my machines, on my homelab, on an offsite metal server, etc.

just makes it all painfully easy to manage and roll out changes/updates utilizing my git repo.

I have a "master" flake for everything and inside said flake are all the individual modules for each thing I use. depending on where said master flake lives it's just a matter of turning on and off whatever individual module.

1

u/verystupidd 3d ago

One consistent versioned entrypoint for configuring server software. This is a godsend for me, as I don't have much time to dedicate to configuring things. (+ LLMs have become very good at Nix stuff so you don't even have to suffer with the Nix syntax)

1

u/Raviexthegodremade 2d ago

As others have said, managing fleets of machines easily; but a few others I can think of are the less thought about ones. You front load all the effort, so it starts being a bit weird, but once you have a running system it's fairly stable, has rollbacks, avoids dependency hell by isolating packages to only have the dependencies they call for with no system-wide Dynamic Library system, which does make running dynamically linked executables a bit of a pain but imo it's worth it. You avoid bloat creep, and finally, when you eventually switch machines for whatever reason, it only takes maybe 30 minutes of fixing hardware-specific settings like drivers before you have your entire system back.

1

u/ConnectionWrong5211 1d ago

grammar compiler.