!BgJZHVOYkwVcEKLAyM:nixos.org

NixOS Deployments

1249 Members
NixOS Deployment tooling306 Servers

Load older messages


SenderMessageTime
22 Nov 2024
@k900:0upti.meK900Which means 256MB per config08:58:40
@k900:0upti.meK900Not accounting for any data08:58:44
@khartahk:matrix.orgkhartahk

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:

  • minize the install as much as possible
  • use squashfs to compress it
  • set it up to boot and uncompress that (perhaps even set it to me ran directly from memory)
  • ...

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
@k900:0upti.meK900It really depends on how badly you want to fuck things up 09:06:41
@k900:0upti.meK900You can override basically anything 09:06:45
@k900:0upti.meK900But the more you override, the further from a supported configuration you are 09:07:40
@k900:0upti.meK900There's even things like liminix that fit in tens of megabytes09:08:13
@k900:0upti.meK900But they're not really NixOS anymore09:08:17
@k900:0upti.meK900And barely even nixpkgs09:08:22
@khartahk:matrix.orgkhartahk 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:matrix.orgkhartahkI'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:0upti.meK900There's no turnkey solution for this 09:47:50
@k900:0upti.meK900You'll have to experiment 09:47:57
@khartahk:matrix.orgkhartahkany suggestion, pointer, especially examples to remove non-essential things that you may perhaps know would be greatly appreciated.10:07:03
@k900:0upti.meK900https://github.com/NixOS/nixpkgs/blob/1f8150661e78f70bda0b51893344326fc2ca264c/nixos/modules/profiles/minimal.nix#L4 could be a good start10:07:52
@k900:0upti.meK900But that's still very far from how low you could push it if you wanted to10:08:15
@khartahk:matrix.orgkhartahk 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:0upti.meK900As I said, there is no easy way to get the size reduction you want10:19:21
@k900:0upti.meK900You'll just have to start digging yourself10:19:25
@magic_rb:matrix.redalder.orgmagic_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:matrix.redalder.orgmagic_rbAnd at the end youll end up with something which wont be nixos and barely nixpkgs anymore :)11:05:40
@khartahk:matrix.orgkhartahkOK, so would this then be a better route: https://github.com/NixOS/nixpkgs/blob/1f8150661e78f70bda0b51893344326fc2ca264c/nixos/modules/profiles/image-based-appliance.nix11:27:27
@k900:0upti.meK900 That will not get you much further 11:28:28
@k900:0upti.meK900You'll have to start overriding packages11:28:33
@gefla:matrix.orgGerd FlaigWill 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:matrix.orgkhartahkI 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:0upti.meK900There is no such list15:57:35
@k900:0upti.meK900Because there are generally very few "unwanted" packages in the default install15:57:57
@k900:0upti.meK900 What you'll have to do is start modifying packages to remove features you don't want 15:58:06
@khartahk:matrix.orgkhartahkGuess 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

Show newer messages


Back to Room ListRoom Version: 6