2020-09-25 04:45:31 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let cfg = config.services.espanso;
|
|
|
|
in {
|
2024-07-27 06:49:29 +00:00
|
|
|
meta = { maintainers = with lib.maintainers; [ n8henrie numkem ]; };
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
options = {
|
2024-06-05 15:53:02 +00:00
|
|
|
services.espanso = {
|
|
|
|
enable = mkEnableOption "Espanso";
|
2024-07-27 06:49:29 +00:00
|
|
|
wayland = mkEnableOption "use the Wayland compatible espanso package";
|
2024-06-05 15:53:02 +00:00
|
|
|
package = mkPackageOption pkgs "espanso" {
|
|
|
|
example = "pkgs.espanso-wayland";
|
|
|
|
};
|
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
systemd.user.services.espanso = {
|
|
|
|
description = "Espanso daemon";
|
|
|
|
serviceConfig = {
|
2024-06-05 15:53:02 +00:00
|
|
|
ExecStart = "${lib.getExe cfg.package} daemon";
|
2020-09-25 04:45:31 +00:00
|
|
|
Restart = "on-failure";
|
|
|
|
};
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
environment.systemPackages = [ cfg.package ];
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
}
|