| 19 Mar 2022 |
@janne.hess:helsinki-systems.de | That should work fine. There's typesMergable for that so that should do it | 10:56:20 |
@elvishjerricco:matrix.org | typesMergable? | 10:56:33 |
@janne.hess:helsinki-systems.de | Its somewhere in types.nix. I might have an example but I'm only on mobile | 10:56:55 |
bobvanderlinden | It seems we do something similar for timer's startAt:
https://github.com/nixos/nixpkgs/blob/9bc093b30a3ab38f9e5b30a132b08a9fd9b27ade/nixos/modules/system/boot/systemd.nix#L966-L972 | 10:57:04 |
@janne.hess:helsinki-systems.de | We have this:
options.systemd.services = lib.mkOption {
type = with lib.types; attrsOf (submodule ({ config, ... }: {
options.reloadTriggers = lib.mkOption {
default = [];
type = listOf unitOption;
description = ''
An arbitrary list of items such as derivations. If any item
in the list changes between reconfigurations, the service will
be reloaded. If anything but a reload trigger changes in the
unit file, the unit will be restarted instead.
'';
};
config = lib.mkIf (config.reloadTriggers != []) {
unitConfig.X-Reload-Triggers = toString config.reloadTriggers;
};
}));
};
| 10:57:47 |
@janne.hess:helsinki-systems.de | And this works | 10:57:57 |
@elvishjerricco:matrix.org | bobvanderlinden: That would be what I described before, where a different attrsOf is defined in terms of a different attrsOf | 10:58:13 |
@elvishjerricco:matrix.org | Janne HeΓ: Well cool. I could have sworn that didn't work anymore | 10:58:33 |
@elvishjerricco:matrix.org | I... might just use that | 10:58:38 |
@janne.hess:helsinki-systems.de | In reply to @elvishjerricco:matrix.org I... might just use that Oh nio π | 10:58:49 |
@janne.hess:helsinki-systems.de | * Oh no π | 10:58:58 |
bobvanderlinden | ElvishJerricco: oops you're right, it's creating timers for startAt in services | 10:59:03 |
bobvanderlinden | ElvishJerricco: is there a way to cooperate in parallel? | 11:09:29 |
@elvishjerricco:matrix.org | bobvanderlinden: How do you mean? | 11:11:55 |
bobvanderlinden | At the moment I feel like it's hard to work on my branch, because it'll conflict with changes you're working on | 11:13:10 |
bobvanderlinden | I was thinking, if the bare-bones version of boot.inird.systemd is there, I can look into one of plymouth, luks, cryptsetup, etc | 11:14:17 |
bobvanderlinden | I'll just ditch the pr-usable-systemd-modules branch, as I think it'll never get approved and I don't see a better way with the current module system | 11:15:03 |
bobvanderlinden | * I'll just ditch the pr-reusable-systemd-modules branch, as I think it'll never get approved and I don't see a better way with the current module system | 11:15:16 |
@elvishjerricco:matrix.org | bobvanderlinden: I think I need to get the very basic thing reconstructed before we can start to parallelize implementations of the various initrd features | 11:15:39 |
@elvishjerricco:matrix.org | Luckily, given that I've done this four times now, and I think I have a really solid foundation (with much thanks to your branch!), I think this could be fairly quick to construct | 11:16:12 |
bobvanderlinden | awesome ποΈ let me know when π | 11:16:26 |
@elvishjerricco:matrix.org | oh crap | 11:16:57 |
@elvishjerricco:matrix.org | generateUnits adds a bunch of crappy default units | 11:17:09 |
@elvishjerricco:matrix.org | like nix-daemon.service | 11:17:13 |
@elvishjerricco:matrix.org | that's gonna be a problem... | 11:17:17 |
@elvishjerricco:matrix.org | I was so excited "I'm just gonna call generateUnits, then either do my Exec* parsing or cherry-pick bobvanderlinden's change, and then it should boot!" | 11:17:56 |
@elvishjerricco:matrix.org | Of course it's not that simple... | 11:18:01 |
bobvanderlinden | is that because of it referring to config.systemd.packages? | 11:18:10 |
@elvishjerricco:matrix.org | Oh if it's doing that all on its own then I'm going to have to parameterize this thing... | 11:18:40 |
@elvishjerricco:matrix.org | Yea... yea it's doing that | 11:18:59 |