Install on small disks < 10 GB

Hi, would like to install nixos on a thinclient with a 8GB flashdisk, first test for choosing the DE on a virt.system with a 10GB virt disk. But…

Does it need to install by hand by using the mininal iso? tnx…

Btw. The thinclient needs only a webbrowser and this python tool to easy start vdi desktops…

https://github.com/joshpatten/PVE-VDIClient

That does not matter for NixOS. You can use any ISO and install anything.

You probably want to have a bigger disk. I think using 40GB is way easier. When you only have 20GB (smallest hetzner cloud) you need to collect garbage after every deployment and can’t keep generations around. There are some tricks like nix-store --optimise but they fluctuate and you can end up with a fuller disk sometimes. Also disabling features you don’t need is key to keep the installation size small.

The thinclient has a buildtin flash disk with 8 GB… :wink:

I have (headless) VPS with NixOS that I deploy with nixinate from a multi-host flake (where I keep all my NixOS server configs). One of them (that only has the OS and not much data, it’s a nomad server) only has 2.5G in use currently.

I think the advantage of nixinate in this scenario is that if you build on your dev host it just copies over the final closures, that don’t need to include build-time dependencies, only run-time. That might save significant space.

Of course desktop stuff is bloaty, so YMMV, but I guess it’s worth a try, also because it will likely improve your update experience.

1 Like

Is this thin client deployed in a managed network space? If so, you might want to look into netbooting it instead of installing, if it has enough RAM. You can add some services/scripts to set up a local filesystem to cache things as well.

If you actually want to install it, I’d recommend first preparing a config for it locally, building it and checking closure size with something like nix path-info -Sh ./result to make sure that it’ll actually fit. You can test this config in a VM while you’re developing it to make sure everything works fine. To save space you might want to disable documentation, remove Perl, and maybe even remove Nix itself. You’ll have to manage the system externally then, but you’ll save some megabytes.

Just now i tried to run the manual install from the small iso… This seems to work in a small virt disk for 1st tests…and installed xfce desktop…
Maybe tomorrow i will put on real hardware and report it…

[wolf@vdi-tk-218-1:~]$ sudo nix-env -p /nix/var/nix/profiles/system --list-generations
   4   2024-06-05 16:07:32   (current)

[wolf@vdi-tk-218-1:~]$ df -h
Dateisystem    Größe Benutzt Verf. Verw% Eingehängt auf
devtmpfs        197M       0  197M    0% /dev
tmpfs           2,0G       0  2,0G    0% /dev/shm
tmpfs           981M    3,2M  978M    1% /run
tmpfs           2,0G    1,1M  2,0G    1% /run/wrappers
/dev/sda1       7,2G    3,8G  3,1G   56% /
tmpfs           393M     40K  393M    1% /run/user/1000

[wolf@vdi-tk-218-1:~]$ 

I’d also recommend looking into something like cage for “Kiosk” mode environment where DM runs just one application on full screen, without any usual DE bloat.

OK, thanks. I will give it a try today with the manual install. But it would be nice if there would be a simple textmode installer available. But for me it is ok…