NixOS Deployments | 1291 Members | |
| NixOS Deployment tooling | 310 Servers |
| Sender | Message | Time |
|---|---|---|
| 22 Nov 2024 | ||
| 512MB disk | 08:40:11 | |
| Or 512MB memory | 08:40:13 | |
| If it's 512MB disk, and you have a network, just netboot? | 08:40:26 | |
| It's disk and I want this to be a self sufficient NAS for backups which won't have a network drive available to boot from that. | 08:56:10 | |
| Memory is 2GB | 08:56:27 | |
| Uhh | 08:58:02 | |
| And you can't use anything bigger than 512MB? | 08:58:08 | |
| Maybe you can do some sort of squashfs thing then | 08:58:14 | |
| Because like, if you're going to be updating it, ever, you'll need double the disk space in case of staging merges | 08:58:31 | |
| Which means 256MB per config | 08:58:40 | |
| Not accounting for any data | 08:58:44 | |
| data would live on 2 hdds. It's just the OS and the services required for it that would live on that drive. I'm guessing someone has done something like this before. My duckduckfoo is just to week to find it :) And yes you are right. I guess the best approach would be:
Not sure how to achieve all that seems quite daunting as I haven't dabbled in doing something this complex. I guess I need to start at step 1. and first figure out how to make the size as small as possible. Let's for now just say that is my objective. How to change configuration.nix to use as little space as possible. | 09:04:46 | |
| It really depends on how badly you want to fuck things up | 09:06:41 | |
| You can override basically anything | 09:06:45 | |
| But the more you override, the further from a supported configuration you are | 09:07:40 | |
| There's even things like liminix that fit in tens of megabytes | 09:08:13 | |
| But they're not really NixOS anymore | 09:08:17 | |
| And barely even nixpkgs | 09:08:22 | |
hm, I'm starting with this config for now: https://github.com/khartahk/nixos-minimal/blob/main/etc/nixos/configuration.nix the hardware-configuration.nix just has the partitions specified and imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; | 09:27:53 | |
| I'm willing to break things or remove stuff that I don't need. I'm really trying first to create as small image as I can. And in doing so i can that build on top of it by re-adding stuff that i need. I guess first thing is to know what I need ... kernel wise etc ... or can I just remove some other bloat that's just obvious and not required to run the OS? | 09:31:08 | |
| There's no turnkey solution for this | 09:47:50 | |
| You'll have to experiment | 09:47:57 | |
| any suggestion, pointer, especially examples to remove non-essential things that you may perhaps know would be greatly appreciated. | 10:07:03 | |
| https://github.com/NixOS/nixpkgs/blob/1f8150661e78f70bda0b51893344326fc2ca264c/nixos/modules/profiles/minimal.nix#L4 could be a good start | 10:07:52 | |
| But that's still very far from how low you could push it if you wanted to | 10:08:15 | |
added that, and updated git repo, removed a couple of MB still at 2.1GB curretnly. I'm testing it using nixos-enter command on a USB drive that I know it boots so I can do it live on 1 computer - really nice and easy to chroot to nixos ... | 10:18:52 | |
| As I said, there is no easy way to get the size reduction you want | 10:19:21 | |
| You'll just have to start digging yourself | 10:19:25 | |
In reply to @khartahk:matrix.orgYou probably want to start digging with nix-tree and nix-diff trying to identify the big packages attempting to then get rid of them or overriding to make them smaller. Youll have to do a lot of rebuilding though | 11:05:09 | |
| And at the end youll end up with something which wont be nixos and barely nixpkgs anymore :) | 11:05:40 | |