New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Espanso: Fix broken module to be compatible with Espanso version 2.x #4066
Conversation
This module is currently broken. It does not create `config` and `match` folders which are required by espanso 2.x version. This PR fixed this issue and support creating multiple files under `config` and `match` folder.
This module is currently broken. It does not create `config` and `match` folders which are required by espanso 2.x version. This PR fixed this issue and support creating multiple files under `config` and `match` folder. Add descriptions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs
- a
mkRemovedOptionModule
for the removedsettings
option - an assertion that
versionAtLeast cfg.package.version "2"
type = yaml.type; | ||
default = { matches = [ ]; }; | ||
default = { default = { }; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am following previous config here. I guess there is no harm to set an empty default when the users do not provide anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, I was unclear. I meant: do we need a default
that's not just {}
? I.e., why the default
inside the default
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use default = { };
inside default is to create an empty ~/.config/espanso/config/default.yml
when it is not set.
Without it, Espanso will throw below error.
[ERROR] unable to load config
Caused by:
missing config directory
|
||
matches = mkOption { | ||
type = yaml.type; | ||
default = { default.matches = [ ]; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-to-override-service-espanso-module-for-home-manager/28551/11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tried to run this, but code looks good overal 👍 small suggestion.
Looks like pkgs.espanso does not |
The stubs don't have versions by default. I'm working on it. |
Should be fixed now if you rebase on master. |
Co-authored-by: Naïm Favier <n@monade.li>
…ix-community#4066) * Fix espanso module to work with 2.x version * espanso: fix espanso module This module is currently broken. It does not create `config` and `match` folders which are required by espanso 2.x version. This PR fixed this issue and support creating multiple files under `config` and `match` folder. * Espanso: fix espanso module This module is currently broken. It does not create `config` and `match` folders which are required by espanso 2.x version. This PR fixed this issue and support creating multiple files under `config` and `match` folder. Add descriptions * Add versionAtLeast and mkRemovedOptionModule * Correct maintainers list * remove config key from example * format basic-configuration.nix * Update modules/services/espanso.nix Co-authored-by: Naïm Favier <n@monade.li> * fix maintainers list --------- Co-authored-by: Naïm Favier <n@monade.li> (cherry picked from commit 1e5d741)
…ix-community#4066) * Fix espanso module to work with 2.x version * espanso: fix espanso module This module is currently broken. It does not create `config` and `match` folders which are required by espanso 2.x version. This PR fixed this issue and support creating multiple files under `config` and `match` folder. * Espanso: fix espanso module This module is currently broken. It does not create `config` and `match` folders which are required by espanso 2.x version. This PR fixed this issue and support creating multiple files under `config` and `match` folder. Add descriptions * Add versionAtLeast and mkRemovedOptionModule * Correct maintainers list * remove config key from example * format basic-configuration.nix * Update modules/services/espanso.nix Co-authored-by: Naïm Favier <n@monade.li> * fix maintainers list --------- Co-authored-by: Naïm Favier <n@monade.li> (cherry picked from commit 1e5d741)
* tests: `--show-trace` in CI (#4070) (cherry picked from commit f889ec0) * tests/stubs: inherit default versions from pkgs (#4069) * tests/stubs: inherit default versions from pkgs * tests/browserpass: temporarily disable on darwin The package currently fails to evaluate on darwin due to a nixpkgs problem: NixOS/nixpkgs#236258 (comment) (cherry picked from commit 69bdd6d) * Espanso: Fix broken module to be compatible with Espanso version 2.x (#4066) * Fix espanso module to work with 2.x version * espanso: fix espanso module This module is currently broken. It does not create `config` and `match` folders which are required by espanso 2.x version. This PR fixed this issue and support creating multiple files under `config` and `match` folder. * Espanso: fix espanso module This module is currently broken. It does not create `config` and `match` folders which are required by espanso 2.x version. This PR fixed this issue and support creating multiple files under `config` and `match` folder. Add descriptions * Add versionAtLeast and mkRemovedOptionModule * Correct maintainers list * remove config key from example * format basic-configuration.nix * Update modules/services/espanso.nix Co-authored-by: Naïm Favier <n@monade.li> * fix maintainers list --------- Co-authored-by: Naïm Favier <n@monade.li> (cherry picked from commit 1e5d741) --------- Co-authored-by: Li Yang <71299093+liyangau@users.noreply.github.com>
Description
Espanso module does not work with 2.x version. In the new version configuration and matches are put into different folders as below.
The updated module supports creating multiple files for both config and matches. Users have the full flexibility to create multiple files for different apps.
Checklist
Change is backwards compatible.
Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
ornix develop --ignore-environment .#all
using Flakes.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module