News for hackers. Stuff that matters.
Re:Ask HN: Please recommend how to manage personal serverss by talldayo on Saturday April 20, 2024 @03:00PM (#40099975)
I was going to suggest NixOS. It's a bit of a climb to learn it, but having a modular setup that works with all my devices is absolutely a killer-app. My desktop, laptop, VPS and Raspberry Pi all share the same terminal configuration from the same Git repo.

Waxing poetic about NixOS on HN is a horse well-beaten. Just try it, if you've got an extra machine laying around and a few hours to spare. I think it's a great halfway option for people that want complex server composition software without the Kubernetes built-in.

Re:Ask HN: Please recommend how to manage personal serverss by anon291 on Saturday April 20, 2024 @04:10PM (#40100604)
I will echo you. I use nix and kubernetes and have achieved great success. I have my configuration as nixos modules. Making a host a kubernetes controller is just a false -> true flip.

All my images are built and stored and served via tftp and a remote nix store for the servers to boot. Very easy to build the system and then do atomic upgrades. Best part is ... Rollbacks if the config is bad are easy and fool proof.

I would never use mutable distributions in production. Too scary.

My nix boxes need very little minding.

Re:Ask HN: Please recommend how to manage personal serverss by kevincox on Saturday April 20, 2024 @04:29PM (#40100746)
I strongly agree. NixOS is a league above things like Ansible that are highly mutable. Also getting started with NixOS really isn't that bad. Just read the wiki and set a few options. https://search.nixos.org/options

The hard part about NixOS is when you need to package something yourself. That can have a bit of a learning curve but since nixpkgs is the largest package repository you rarely need to do it.

If you are running custom stuff you can always start by just using NixOS to run a Docker container. At least that will be a reproducable OS and if you pin a specific image it will be fully reproducible. Then when you want to you can dip your toes into native Nix packages. (It really isn't that bad, just an extra thing to learn that you can defer to start)

Re:Ask HN: Please recommend how to manage personal serverss by talldayo on Saturday April 20, 2024 @08:19PM (#40102205)
Agreed fully! Just got finished packaging up a few desktop apps for the first time on NixOS and it wasn't as bad as I expected.

My biggest issue with Nix (as is everyone's I hear) is the mediocre documentation. It takes a lot of wheel-spinning to get up-to-speed with PKGBUILD or makefile knowledge. A lot of that difficulty curve could be remediated with better, flake-focused packaging tutorials. Surely though, that too will be Coming Soon™.

Re:Ask HN: Please recommend how to manage personal serverss by _dain_ on Saturday April 20, 2024 @05:01PM (#40100981)
>Just read the wiki

note, there are two wikis now.

Re:Ask HN: Please recommend how to manage personal serverss by exe34 on Saturday April 20, 2024 @03:43PM (#40100374)
Oh and if you don't want to go full nixos, you can just install whatever the base image for your server from the provider and run nix as a separate install for your applications.
Re:Ask HN: Please recommend how to manage personal serverss by scott01 on Saturday April 20, 2024 @05:13PM (#40101053)
This is quite interesting, thanks for recommendation, I'll investigate this. Are you aware of any edge cases or inconveniences of this approach I can keep in mind while experimenting?
Re:Ask HN: Please recommend how to manage personal serverss by exe34 on Sunday April 21, 2024 @03:24AM (#40103814)
Well nixos is really great if your package and options are already thought through by the maintainers, although you might have to read through nixpkgs for options. It's more painful if you need X compiled with Y enabled and it needs to rebuild (might be slow on vps), and if your package isn't included at all, it can be a pain to add a new one and get all the dependencies included.

Once it works though, it basically never breaks - you can always pick an older working version.

Oh and it eats disk space like there's no tomorrow if you have multiple generations retained.

Re:Ask HN: Please recommend how to manage personal serverss by scott01 on Saturday April 20, 2024 @04:50PM (#40100903)
Most cloud providers don't provide NixOS, e.g. I use OVH Cloud. IIUC, there is a way to run a script that will delete my OS and install Nix, but I think there might be side effects like cloud-specific network setup which will probably be too much for me :)

Edit: But NixOS looks really good, I have to agree. I guess 'immutability' will let me just install and forget about it.

Re:Ask HN: Please recommend how to manage personal serverss by talldayo on Saturday April 20, 2024 @08:22PM (#40102213)
> IIUC, there is a way to run a script that will delete my OS and install Nix

There is! It's a fucking nightmare: https://xiaoyehua.dev/posts/nixos-on-oracle-arm-machine

It works though, and thanks to the genius that wrote this script I've got a 4 core 24gb Oracle Always Free instance loaded up with NixOS at all hours of the day. I feel spoiled.

Re:Ask HN: Please recommend how to manage personal serverss by pxc on Thursday April 25, 2024 @10:18AM (#40157905)
I think they're referring to this implementation: https://github.com/nix-community/nixos-anywhere

but cleverca22's work is solid as well

there's also the earlier https://github.com/elitak/nixos-infect

and the built-in NIXOS_LUSTRATE: https://nixos.org/manual/nixos/stable/#sec-installing-from-o...

I'd go with nixos-anywhere, personally

Re:Ask HN: Please recommend how to manage personal serverss by eh8 on Wednesday April 24, 2024 @11:21PM (#40153027)
Late to the party but this is my configuration that I use for my home servers:

https://github.com/eh8/chenglab

I was a complete Nix beginner three months ago and thought Nix was terribly complicated and unnecessary. Glad to say I was wholly wrong and the transition was not that bad.

NixOS me provision my servers from scratch to functional file/media/home automation server in about 15 minutes using an entirely automated Nix installation process. It’s a beautiful OS for servers