I used to have a VPS running a traditional OS (CentOS) that I eventually got rid of. One of the reasons I tried to migrate away from it was from the sysadmin perspective, I felt like the server once everything was configured was a bit of a snowflake.

Obviously configuring everything through nix and being able to easily rollback changes sound very compelling.

Have folks used nix as a server OS? How’s your experience been?

  • chayleaf
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    I absolutely love Nix as a server OS. In fact I started using it as a server OS before over a year before setting it up on my desktop.

    I live in Russia, and I started using it before 24.02.2022 on free Oracle VPS (I had to do some magic to create a BTRFS Nix image, but if you’re fine with ext4 you can just use nixos-infect). Later, Oracle stopped working in Russia (although I couldn’t log in, the server was still accessible, and might be accessible still - I haven’t checked), so I copied /var/lib and /etc/nixos to a spare laptop I had lying around - and it just worked! Before that I used Oracle Linux (RHEL derivative), and it was frankly a pain to deal with - I had to manually update some parts, I had to manually deal with configuration files, I had to remember what exactly I changed, etc; now I could simply copy everything over and it worked (with the exception of Nextcloud plugins, which are sometimes arch-dependent and not supported by NixOS).

    Now I have my config for all systems in a single flake (personal laptop, server, and TODO router, before this I ran the server in a container on the router but that was less than ideal so I bought separate hardware for the router and am in process of revamping the config at the moment) and it’s even more convenient as I can share stuff between configs, and I switched to using home-manager to have all the same benefits apply to dotfiles.

    That said, I wouldn’t recommend going all in on Nix like me if you aren’t familiar with functional programming/aren’t willing to learn. While Nix has some less-than-ideal parts, in my opinion the language is very very good for its age, but it isn’t a C-family language.