!tCyGickeVqkHsYjWnh:nixos.org

NixOS Networking

903 Members
Declaratively manage your switching, routing, wireless, tunneling and more.263 Servers

Load older messages


SenderMessageTime
29 Jul 2025
@emilazy:matrix.orgemilyI might be wrong about the work it'd take to split things up! but my prediction is that using the normal closure mechanisms and just splitting up packages where relevant is not going to look more complex than what we do instead right now17:45:50
@elvishjerricco:matrix.orgElvishJerriccowhich leaves me believing this^17:45:53
@emilazy:matrix.orgemily there aren't that many things in initrd 17:45:57
@emilazy:matrix.orgemily and if we have checks for initrd size (which seems good in general to stop it growing accidentally for other reasons) then it seems like the burden would be appropriately distributed to maintainers of core packages with passthru.tests 17:46:56
@elvishjerricco:matrix.orgElvishJerriccoI'm just not convinced it's worth the effort, or sustainable17:47:15
@emilazy:matrix.orgemilywell, that's why I was asking if you have any examples in mind of things that would make it hard :)17:47:42
@elvishjerricco:matrix.orgElvishJerriccoif someone wants to proof-of-concept it, that would be cool17:47:43
@emilazy:matrix.orgemilyI'd be open to poking at it, but it'd of course be nice to start with the hardest thing first to not waste effort on easier stuff17:48:09
@elvishjerricco:matrix.orgElvishJerriccoI don't think any specific things are difficult. It's just a lot of things and its a burden that remains forever17:48:15
@emilazy:matrix.orgemilyI think that probably putting a program in a separate output doesn't incur repeated ongoing maintenance costs in most cases17:48:46
@emilazy:matrix.orgemily same way that make-initrd-ng itself doesn't much 17:48:53
@emilazy:matrix.orgemilypeople do closure size minimization work for other reasons, so it's not like it would be burden solely for initrd17:49:18
@elvishjerricco:matrix.orgElvishJerricco Well if you want to give it a try, it shouldn't be too hard to swap makeInitrdNG for makeInitrd and start slashing away 17:50:32
@elvishjerricco:matrix.orgElvishJerricco(oof, a stock systemd initrd is 21M. not great, but acceptable)17:52:20
@emilazy:matrix.orgemilyyeah I might18:04:03
@emilazy:matrix.orgemilyeven just looking at the diff of the closure would probably make it obvious where to start18:04:16
@emilazy:matrix.orgemily (I thought makeInitrd screws up the store paths or something though) 18:05:04
@elvishjerricco:matrix.orgElvishJerricco no, makeInitrd just does plain ole closures 18:05:41
@elvishjerricco:matrix.orgElvishJerricco it's the extraUtils derivation that does the screwing with binaries so the closure is small 18:05:58
@emilazy:matrix.orgemilyah18:07:49
@marcel:envs.netMarcel

Is this a crime?

storePaths =
            let
              closure = pkgs.closureInfo { rootPaths = [ initrdCfg.package ]; };
              closurePaths = lib.filter (path: path != "") (lib.splitString "\n" (builtins.readFile "${closure}/store-paths")) ;
            in
            closurePaths ++
            [
              config.environment.etc."ifstate/config.initrd.yml".source
            ];

now i only have to work on reducing the closure size.

19:57:37
@marcel:envs.netMarcel *

Is this a crime?

storePaths =
  let
    closure = pkgs.closureInfo { rootPaths = [ initrdCfg.package ]; };
    closurePaths = lib.filter (path: path != "") (lib.splitString "\n" (builtins.readFile "${closure}/store-paths")) ;
  in
  closurePaths ++
  [
    config.environment.etc."ifstate/config.initrd.yml".source
  ];

now i only have to work on reducing the closure size.

19:58:08
@emilazy:matrix.orgemilyIFD19:58:51
@emilazy:matrix.orgemilyso criminal we have a name and a flag for the specific type of crime :)19:59:17
@emilazy:matrix.orgemilyit would break on Hydra19:59:19
@marcel:envs.netMarcelahh ok19:59:56
@marcel:envs.netMarcelat least my vm test works now ;D20:00:47
@elvishjerricco:matrix.orgElvishJerricco

Marcel: yea if you want to do closureinfo stuff to get full closures into systemd initrd I was thinking of something like this:

{
  boot.initrd.systemd.storePaths = [
    (runCommand "x"
      {
        info = closureInfo { rootPaths = [ hello ]; };
      }
      ''
        mkdir $out
        cat "$info"/store-paths | while read path; do
          ln -s "$path" "$out/$(basename "$path")"
        done
      ''
    )
  ];
}
20:03:53
@elvishjerricco:matrix.orgElvishJerricco *

Marcel: yea if you want to do closureinfo stuff to get full closures into systemd initrd I was thinking of something like this:

{
  boot.initrd.systemd.storePaths = [
    (runCommand "x"
      {
        info = closureInfo { rootPaths = [ hello ]; };
      }
      ''
        mkdir $out
        cat "$info"/store-paths | while read path; do
          ln -s "$path" "$out/$(basename "$path")"
        done
      ''
    )
  ];
}
20:03:57
@elvishjerricco:matrix.orgElvishJerricco but it'd probably be better to just have a make-initrd-ng feature for this 20:04:21

Show newer messages


Back to Room ListRoom Version: 6