Repository navigation
feat(wrapperModules.ashell): add systemd integration - #665
Conversation
| builder = ''${pkgs.remarshal}/bin/json2toml "$1" "$2"''; | ||
| }; | ||
| config.systemd.user.service.ashell = { | ||
| overwrite = true; |
There was a problem hiding this comment.
So, overwrite isn't technically necessary here, as the ashell derivation does not already offer an existing service named ashell.
That being said, if they do decide to offer one at some point, using overwrite = true here would prevent unexpected effects from happening as a result of that. But it would also mean that if they add extra useful fields you won't get those too as part of your service definition. The ones you define here would be defined after theirs and would thus win, but who knows what they add to be fair.
Honestly I am fine with either way, just letting you know the difference.
There was a problem hiding this comment.
Thanks for letting me know. I think I'd prefer to keep it set to true, to avoid problems if people at nixpkgs decide to add this service themselves.
You add yourself to the maintainers list if you are A, the person who submitted the module, or B, you would be ok with being added to the list of people I ping when an issue is found with the module or a PR is made to improve it that I do not immediately understand or is difficult for me to quickly test. Actually, on that note, I do think I understand this just fine, but @aliaslion what do you think? |
| ''; | ||
| }; | ||
| systemdTarget = lib.mkOption { | ||
| type = lib.types.str; |
There was a problem hiding this comment.
We should probably make this lib.types.nullOr lib.types.str and not generate the service if null? There is a chance there are some people who are installing it via the install module, who would also like to be able to more easily disable this behavior to run it directly from an exec in their window manager config without going into the install.systemd option. Also there are even more likely to be people doing that because we didn't have this feature before now.
Otherwise I like it.
graphical-session.target is meant to be fired once the window manager is ready, which is when you would want to spawn your shell, so this is the correct target.
It does not always do this correctly on x11 on nixos? Sometimes it fires right before the window manager starts up? But ashell is a wayland thing, so it should do this correctly, and if not they can always change what service it fires on.
There was a problem hiding this comment.
Thanks for the review. I changed the type and now I only generate systemd service, if it's not null.
There was a problem hiding this comment.
Oh, also, the reason it was extra important that it have a way to disable it is that it has Install.WantedBy, which actually enables the thing.
nix-wrapper-modules creates the .wants .upholds and .requires links itself which when added to the systemd unit path act as if you have enabled the service (or, at least, once you restart anyway... and subsequent changes or starting it manually don't need the restart, just to enable a service of that name the first time)
There are some other services in this repository that you have to start yourself, and those do not usually have a mkIf on them.
I should probably add that to the contributing docs somewhere. Most of that is described in the systemd docs as it pertains to how it works, but I do not include that this would mean that for submitted modules it would be a good idea to make it optional if it includes things that can automatically enable it.
makes it easier to autostart ashell after entering graphical session
f60f408 to
f597534
Compare
|
The macos tests randomly started taking twice as long to run recently... I am not super amused about this and might need to start thinking about how to make it only run the relevant tests per PR. Locally it is still just as fast, something happened on github's end. |
|
Great change, didn't even know that was possible. Thank you! |
Makes it easier to autostart ashell after entering graphical session.
I'm not sure if I should add myself to the maintainers list, since It's my first PR to a nix repo and I'm only adding a small functionality, so as of now I haven't. If I should, please let me know