Hacker News new | ask | show | jobs
by r14c 592 days ago
nixos-anywhere and some flakes is all i need! sometimes for new setups I'll run nixos-anywhere and write the config directly on the machine, but that's usually just for sketching out ideas. I'll reprovision with a module after I've worked out the kinks.
1 comments

I just transitioned my home and homelab PCs to nixos+anywhere+flakes and I can't imagine going back to ansible or puppet or even docker compose.

you know that it won't drift. you can generate images from the same config you apply to a host. you can stamp out the same config across N hosts. you can completely reconfigure a host without reprovisioning it from scratch. you can run slim VMs by mounting the nix store as read only.

it would be great to run an entire company off nixos this way

I recently started using devbox over homebrew for package installs on my Mac and this has gotten me more interested in nix - however, neither of the VPS providers we use offer NixOS as an OS option, is there a way to achieve that declarative setup on Ubuntu?
the magic of nixos-anywhere is that you can start with a common OS base image and overwrite it with nixos.

you can also run nix as a service on other operating systems. https://lix.systems/install/#on-any-other-linuxmacos-system

I had high hopes, but it's obviously designed for less paranoid consumers since executing the verb "plan" is all "ya, fam, but I'm gonna need to be root to tell you what I'm gonna do"

  `lix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
  TRACE execute:execute: lix_installer::cli: Execvp'ing `"sudo"` with args `["sudo", "env", "SHELL=/usr/local/bin/bash", "./lix-installer", "-vvvv", "--logger=full", "plan"]`
I guess I'll have to patch the source to have it tell me why it wants unrestricted access just to tell me what it is going to do
Excellent, thanks. I'll do some reading!