home-manager
home-manager copied to clipboard
espanso: add wayland support
Tested on kde plasma x11 and wayland sessions. and inside niri wm (wayland). works ok
One thing is clear, for it to work seamlessly without explicitly requiring user to choose wayland or x11 the only solution is the upstream espanso package should provide a fat binary (not possible currently).
In this pr the fat binary is package-bin which brings in both the verisons of espanso (x11, wayland) into the store. If and only if both are enabled.
But I guess on darwin there is no such thing as wayland and thus the pkgs.espanso should be chosen always. (edit: made the change, someone with darwin system can try it out)
more things to consider
- [x] tty (using espanso makes no sense in a tty, I think)
- [x] override wayland package fix
- [x] ~shell completions, for the 'fat' binary~ idk how to do that
- [x] update news.nix
so I've tried espanso-wayland = callPackage ../applications/office/espanso { ...; x11 = false; wayland = true; }; in own nixpkgs instance instead of using override and got
$ nix build .#test-espanso-basic-configuration
> --- actual
> +++ expected
> @@ -2,7 +2,7 @@
> WantedBy=default.target
>
> [Service]
> -ExecStart=/nix/store/nq21hfj3v74hd640ggzvmdd2zgmqv51y-espanso/bin/espanso daemon
> +ExecStart=@espanso@/bin/espanso daemon
> Restart=on-failure
nq21hfj3v74hd640ggzvmdd2zgmqv51y-espanso/bin/espanso here is the package-bin script, and @espanso@ seems to be the pkgs.espanso?
Fixed the test (with the @espanso@ stub) but I don't know how to fix the espanso.override attribute missing error.
@rycee I need some help, please have a look at it when you're free.
$ nix build .#test-espanso-basic-configuration
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:34:12:
33|
34| strict = derivationStrict drvAttrs;
| ^
35|
… while evaluating derivation 'nmt-test-espanso-basic-configuration'
whose name attribute is located at /nix/store/riqkpszjqk02bi1wppfg8ip5xvh102qd-source/pkgs/stdenv/generic/make-derivation.nix:336:7
… while evaluating attribute 'buildCommand' of derivation 'nmt-test-espanso-basic-configuration'
at /nix/store/riqkpszjqk02bi1wppfg8ip5xvh102qd-source/pkgs/build-support/trivial-builders/default.nix:59:17:
58| enableParallelBuilding = true;
59| inherit buildCommand name;
| ^
60| passAsFile = [ "buildCommand" ]
… while evaluating the option `home.activation.installPackages.data':
… while evaluating definitions from `/nix/store/vv3xqpi8hwcciy7labjysw3s6qwafch4-source/modules/home-environment.nix':
… while evaluating the option `services.espanso.package-wayland':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: attribute 'override' missing
at /nix/store/riqkpszjqk02bi1wppfg8ip5xvh102qd-source/pkgs/top-level/all-packages.nix:4857:21:
4856| };
4857| espanso-wayland = espanso.override {
| ^
4858| x11Support = false;
Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.
If you are the original author of the PR
- GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
- If it is unfinished but you plan to finish it, please mark it as a draft.
- If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
- To get things rolling again, rebase the PR against the target branch and address valid comments.
If you are not the original author of the PR
- If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.
still plan to work on this, but need some help with the above.
The eval error was fixed in 7a3f0b3b8df1b913890f5fad04d34f2af91da858 no clue where in that commit exactly (git bisect on home-manger)
@n8henrie @lucasew @liyangau @bobvanderlinden
this is how the UX looks like as of now.
services.espanso.enable = true;
services.espanso = {
enable = true;
waylandSupport = false;
};
services.espanso = {
enable = true;
x11Support = false;
};
Let me know if I misunderstood something but you're suggesting it to be
services.espanso.enable = true; # UNCHANGED
services.espanso = {
enable = true;
package = null;
};
services.espanso = {
enable = true;
package-wayland = null;
};
is that right?
if so I'd prefer the first one because I can tell right away what's happening. (and those support option names are the same in espanso package derivation in nixpkgs)
Alright, sounds good. Annoying you have to do all this just because of their packaging/runtime issues.