| 20 Mar 2022 |
@elvishjerricco:matrix.org | This is on top of your refactor branch | 03:10:47 |
@elvishjerricco:matrix.org | This is what I use to test it:
import ./nixos { configuration = { lib, config, pkgs, ... }: {
imports = [./nixos/modules/virtualisation/qemu-vm.nix];
boot.initrd.systemd = {
enable = true;
emergencyHashedPassword = "";
};
virtualisation = {
graphics = false;
memorySize = ;
cores = 4;
};
documentation.enable = false;
services.getty.autologinUser = "root";
}; }
Note that you currently have to format the nixos.qcow2 file manually for the qemu-vm
| 03:13:56 |
@elvishjerricco:matrix.org | * This is what I use to test it:
import ./nixos { configuration = { lib, config, pkgs, ... }: {
imports = [./nixos/modules/virtualisation/qemu-vm.nix];
boot.initrd.systemd = {
enable = true;
emergencyHashedPassword = "";
};
virtualisation = {
graphics = false;
memorySize = 4096;
cores = 4;
};
documentation.enable = false;
services.getty.autologinUser = "root";
}; }
Note that you currently have to format the nixos.qcow2 file manually for the qemu-vm
| 03:14:14 |
@elvishjerricco:matrix.org | Once I have the exec detection and udev stuff I want in there, I'll open a PR that I expect to be merge-worthy | 03:15:23 |
@elvishjerricco:matrix.org | (graphics = false isn't necessary, I just prefer it) | 03:47:49 |
@elvishjerricco:matrix.org | bobvanderlinden: I switched to your version of the dependencies program and managed to get initrd down to 9.1M, which is crazy! It does boot, but now the rescue mode doesn't work for some reason. | 06:02:24 |
@elvishjerricco:matrix.org | Aw, that decreased size was entirely because I switched to only including the necessities from util-linux instead of all of it, not because of the automatic dependency finder. And the finder didn't work well enough to actually function without significant help from manual inclusions :/
After staring at it and thinking for a while, I'm starting to think automatically finding Exec* stuff just isn't a problem worth solving. I imagine if a fresh set of eyes came to this project after this problem had been solved, they'd say any solution is way too jank to be worth it. If your unit file points to a program, then just include that program in objects... Adding services to initrd should be a fairly rare thing anyway.
| 06:56:48 |
@elvishjerricco:matrix.org | Sooo... I'm going to do another little review an then open a PR! | 06:57:07 |
@elvishjerricco:matrix.org | https://github.com/NixOS/nixpkgs/pull/164943 woot | 08:06:10 |
Arian | Will try it out right away! | 08:08:58 |
Arian | I wanted to say we probably need https://github.com/NixOS/nixpkgs/pull/121371 for the correct ordering of kmod-static-nodes and systemd-tmpfiles-setup-dev but it seems flokli merged it already! :D | 08:12:08 |
Arian | so you probably have those fixed already :P | 08:12:14 |
Arian | yay about forgetting about PRs and other people picking them up | 08:13:31 |
@elvishjerricco:matrix.org | Arian: Beware it's extremely minimal (on purpose), so it's only going to boot extremely simple things | 08:14:20 |
@elvishjerricco:matrix.org | But at least it has a good rescue shell when it fails :P | 08:14:34 |
Arian | that's fine. I have a "play with initrd" machine :P | 08:14:47 |
Arian | Another future work could be: Unified kernel images for the SecureBoot integration | 08:15:52 |
Arian | Adds to my own list | 08:15:56 |
@elvishjerricco:matrix.org | Bit out of scope I think :P | 08:17:00 |
Arian | yes =) | 08:17:04 |
Arian | follow-up. :P | 08:17:13 |
Arian | Another follow-up I'd want to do is evangelize https://systemd.io/DISCOVERABLE_PARTITIONS/ . I guess that could be part of adding repart support (as it uses it by default) | 08:17:38 |
Arian | it makes systemd initrd automatically discover LUKS partitions etc without cmdline or /etc/fstab hints | 08:17:58 |
@elvishjerricco:matrix.org | Yea I'm iffy on that. The systemd people seem to really like it, but it seems antithetical to NixOS's "declarative everything" approach | 08:18:26 |
Arian | yeh true | 08:18:40 |
Arian | my only gripe is whether having rust in the bootstrap path is a good idea... | 08:22:09 |
Arian | But given we were eager to add it to nix as well I think that ship has sailed. And rust bootstrapping is in sorta-ok shape | 08:22:35 |
Arian | (I think Guix people figured out bootstrapability of rust) | 08:22:51 |
Arian | Yeh actually not gripe at all. Go Rust | 08:23:14 |
@elvishjerricco:matrix.org | Arian: Rust has been in the bootstrap path for quite a while now because it's needed for spidermonkey which is needed for... polkit(?) or something | 08:25:16 |