| 19 May 2024 |
lassulus | Yes | 11:43:41 |
matthewcroughan | You wouldn't like to have a compressImage = true which just does this for the user on a per-disk basis/ | 11:44:55 |
matthewcroughan | * You wouldn't like to have a compressImage = true which just does this for the user on a per-disk basis? | 11:44:56 |
matthewcroughan | I suppose that wouldn't really be in line with rfc42.. making an option for everything is bad, but this is pure nix and not a "we should use the upstream configuration" problem | 11:45:29 |
lassulus | There are so many different compressions | 11:45:49 |
matthewcroughan | yeah systemd-repart in nixpkgs has a string option for this | 11:46:00 |
matthewcroughan | https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/image/repart.nix#L108-L123 | 11:46:22 |
matthewcroughan | just an enum for xz or zstd | 11:46:28 |
lassulus | But a script option is more powerful | 11:46:51 |
matthewcroughan | Well yeah, I guess.. you're copying the mkDerivation pattern, but there are still tons of options you can set inside of mkDerivation, I'm constantly learning about them | 11:47:38 |
matthewcroughan | Though they're not set in the module system, they're just vars interpreted by the stdenv bash scripts, which may have been a mistake, hence why drv-parts exists | 11:48:13 |
matthewcroughan | the module option compressImage would just set up the extraPostVM. When you think about what people really want to do with a disk image builder, this is definitely nice to just have be there by default | 11:49:44 |
matthewcroughan | Although I do agree it's difficult to decide what should and shouldn't be available, as this option might just annoy others | 11:50:08 |
matthewcroughan | If disko remains simple and as a matter of policy does not add these helper options, then I can just make a flake based on disko that ties all of this up, like disko-utils | 11:51:07 |
matthewcroughan | * If disko remains simple and as a matter of policy does not add these helper options, then I can just make a flake based on disko that ties all of the loose ends up, like disko-utils | 11:51:20 |
matthewcroughan | https://sourcegraph.com/search?q=context:global+lang:Nix+extraPostVM&patternType=keyword&sm=0 | 11:58:56 |
matthewcroughan | Damn, no examples on the internet :D | 11:59:00 |
lassulus | I guess keeping things simple would be better | 11:59:08 |
matthewcroughan | Since I'm not importing the make-disk-image function directly, I'm just setting disko options in my config, I am not able to specify extraPostVM right? | 11:59:32 |
lassulus | Uh hmm | 11:59:58 |
lassulus | Probably not | 12:00:03 |
lassulus | Maybe add an option for that | 12:00:12 |
matthewcroughan | And that'll be a toplevel one right?
| 12:01:46 |
matthewcroughan | nixosConfig.config.disko.extraPostVM ? | 12:02:03 |
matthewcroughan | https://github.com/nix-community/disko/pull/640 | 12:12:22 |
matthewcroughan | Just testing it out now | 12:12:33 |
matthewcroughan | passes all the existing tests | 12:12:43 |
matthewcroughan | corpo-disko-images> + mount /dev/disk/by-partlabel/disk-disk1-firmware /mnt/firmware -t vfat -o defaults -o X-mount.mkdir
corpo-disko-images> + /nix/store/gc39rhvazg28s7y80c4c0a24x3hsv92p-postMountHook.sh
corpo-disko-images> + rm -rf /tmp/tmp.5zqSsB08B1
corpo-disko-images> warning: the group 'nixbld' specified in 'build-users-group' does not exist
corpo-disko-images> cp: cannot access '/nix/store/1xx8c0x5lwrdz83xlc2b7ii3vgc290g3-gtk4-4.14.3/share/gtk-4.0/valgrind': Cannot allocate memory
corpo-disko-images> cp: cannot access '/nix/store/1xx8c0x5lwrdz83xlc2b7ii3vgc290g3-gtk4-4.14.3/share/icons': Cannot allocate memory
corpo-disko-images> cp: cannot access '/nix/store/1xx8c0x5lwrdz83xlc2b7ii3vgc290g3-gtk4-4.14.3/share/locale': Cannot allocate memory
corpo-disko-images> cp: cannot access '/nix/store/1xx8c0x5lwrdz83xlc2b7ii3vgc290g3-gtk4-4.14.3/share/metainfo': Cannot allocate memory
corpo-disko-images> [ 134.223748] reboot: Power down
error: builder for '/nix/store/pl396syvybgp4rdg22q0cw6ynb2jsk1c-corpo-disko-images.drv' failed with exit code 123;
last 10 log lines:
> + findmnt /dev/disk/by-partlabel/disk-disk1-firmware /mnt/firmware
> + mount /dev/disk/by-partlabel/disk-disk1-firmware /mnt/firmware -t vfat -o defaults -o X-mount.mkdir
> + /nix/store/gc39rhvazg28s7y80c4c0a24x3hsv92p-postMountHook.sh
> + rm -rf /tmp/tmp.5zqSsB08B1
> warning: the group 'nixbld' specified in 'build-users-group' does not exist
> cp: cannot access '/nix/store/1xx8c0x5lwrdz83xlc2b7ii3vgc290g3-gtk4-4.14.3/share/gtk-4.0/valgrind': Cannot allocate memory
> cp: cannot access '/nix/store/1xx8c0x5lwrdz83xlc2b7ii3vgc290g3-gtk4-4.14.3/share/icons': Cannot allocate memory
> cp: cannot access '/nix/store/1xx8c0x5lwrdz83xlc2b7ii3vgc290g3-gtk4-4.14.3/share/locale': Cannot allocate memory
> cp: cannot access '/nix/store/1xx8c0x5lwrdz83xlc2b7ii3vgc290g3-gtk4-4.14.3/share/metainfo': Cannot allocate memory
> [ 134.223748] reboot: Power down
For full logs, run 'nix log /nix/store/pl396syvybgp4rdg22q0cw6ynb2jsk1c-corpo-disko-images.drv'.
| 12:28:52 |
matthewcroughan | more memory errors! | 12:28:54 |
matthewcroughan | it is just so spurious | 12:29:04 |