Merge pull request #285138 from michaelBelsanti/espanso

nixos/espanso: add wayland and package option
This commit is contained in:
Sandro 2024-05-19 19:15:22 +02:00 committed by GitHub
commit 8036f1ffa7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,19 +6,25 @@ in {
meta = { maintainers = with lib.maintainers; [ numkem ]; };
options = {
services.espanso = { enable = options.mkEnableOption "Espanso"; };
services.espanso = {
enable = mkEnableOption "Espanso";
package = mkPackageOption pkgs "espanso" {
example = "pkgs.espanso-wayland";
};
};
};
config = mkIf cfg.enable {
services.espanso.package = mkIf cfg.wayland pkgs.espanso-wayland;
systemd.user.services.espanso = {
description = "Espanso daemon";
serviceConfig = {
ExecStart = "${pkgs.espanso}/bin/espanso daemon";
ExecStart = "${lib.getExe cfg.package} daemon";
Restart = "on-failure";
};
wantedBy = [ "default.target" ];
};
environment.systemPackages = [ pkgs.espanso ];
environment.systemPackages = [ cfg.package ];
};
}