22 Nov 2024 |
K900 | There's even things like liminix that fit in tens of megabytes | 09:08:13 |
K900 | But they're not really NixOS anymore | 09:08:17 |
K900 | And barely even nixpkgs | 09:08:22 |
khartahk | 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 |
khartahk | 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 |
K900 | There's no turnkey solution for this | 09:47:50 |
K900 | You'll have to experiment | 09:47:57 |
khartahk | any suggestion, pointer, especially examples to remove non-essential things that you may perhaps know would be greatly appreciated. | 10:07:03 |
K900 | https://github.com/NixOS/nixpkgs/blob/1f8150661e78f70bda0b51893344326fc2ca264c/nixos/modules/profiles/minimal.nix#L4 could be a good start | 10:07:52 |
K900 | But that's still very far from how low you could push it if you wanted to | 10:08:15 |
khartahk | 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 |
K900 | As I said, there is no easy way to get the size reduction you want | 10:19:21 |
K900 | You'll just have to start digging yourself | 10:19:25 |
magic_rb | In reply to @khartahk:matrix.org 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 ... You 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 |
magic_rb | And at the end youll end up with something which wont be nixos and barely nixpkgs anymore :) | 11:05:40 |
khartahk | OK, so would this then be a better route: https://github.com/NixOS/nixpkgs/blob/1f8150661e78f70bda0b51893344326fc2ca264c/nixos/modules/profiles/image-based-appliance.nix | 11:27:27 |
K900 | That will not get you much further | 11:28:28 |
K900 | You'll have to start overriding packages | 11:28:33 |
Gerd Flaig | Will the HDDs remain in the device? Could just put /boot on the tiny disk and put the rest of the system on a mirror across the HDDs. | 12:00:15 |
khartahk | I wan't to have the HDDs just for data, so that I don't have issues destroying the OS drive and recreating it on a new hardware. Guess this really looks like something that would degrade the NixOS experience to much if I started to rip out components. I just wish that I could find which "list" of packages in which variable I need to override to remove the unwanted ones - or however this is implemented in nix.
I think I'd need to understand quite some more how nix is built to be able to do this.
Is there a simple way I could set nix to run from memory, where it would unpack from some squasfs compressed file? I think Puppy Linux does this - not sure anymore as it's been a while since I've used it. | 15:56:21 |
K900 | There is no such list | 15:57:35 |
K900 | Because there are generally very few "unwanted" packages in the default install | 15:57:57 |
K900 | What you'll have to do is start modifying packages to remove features you don't want | 15:58:06 |
khartahk | Guess it's better for me to focus on getting all the feature I want working and just use a bit larger drive. Thanks for all the insights though. | 16:09:31 |
emily | In reply to @khartahk:matrix.org 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. can you not just boot off a USB stick or SD card | 16:11:48 |
khartahk | That's where I have the issue, the USB 3 ports on the device suddenly stopped working. The hub is visible if I do lsusb but no device is found to be attached. Then I only have 2 USB 2 ports available and the internal USB header which has the QNAP DOM module with 512MB of size. Right now I'm booting the device using a USB with Unraid on it and that work perfectly since Unraid boots to ram and does not use the drive a lot so the USB 2 speeds are not really a problem. And also the OS is quite small. I think arround 500MB or something like that. | 16:33:25 |
K900 | Are you sure it's not some sort of kernel bug? Have you tried booting NixOS from a USB? | 16:36:45 |
khartahk | I tried booting the NAS using Ubuntu and there is no USB device found when plugged into the USB 3 ports, then I booted the NAS from a Ubuntu disk attached to SATA ports and connected different devices to the USB 3 port but no device was found. Also looking in the BIOS no USB drive is detected from which I could boot but if I move the drive to USB2 then it's detected and works. And I know the ports worked coz at first I was able to boot from them the same drive that is no lo longer found. | 16:41:59 |
Gerd Flaig | In reply to @khartahk:matrix.org I wan't to have the HDDs just for data, so that I don't have issues destroying the OS drive and recreating it on a new hardware. Guess this really looks like something that would degrade the NixOS experience to much if I started to rip out components. I just wish that I could find which "list" of packages in which variable I need to override to remove the unwanted ones - or however this is implemented in nix.
I think I'd need to understand quite some more how nix is built to be able to do this.
Is there a simple way I could set nix to run from memory, where it would unpack from some squasfs compressed file? I think Puppy Linux does this - not sure anymore as it's been a while since I've used it. I'm not sure I understand the bit about issues recreating the OS. You want to be able to pull the drives and put them in a different NAS box? | 16:42:24 |
khartahk | yes, in case I needed to migrate coz the NAS would die or something and I want data to be decoupled from the OS. | 16:44:10 |