2020-09-25 04:45:31 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let cfg = config.services.espanso;
|
|
|
|
in {
|
|
|
|
meta = { maintainers = with lib.maintainers; [ numkem ]; };
|
|
|
|
|
|
|
|
options = {
|
2024-06-05 15:53:02 +00:00
|
|
|
services.espanso = {
|
|
|
|
enable = mkEnableOption "Espanso";
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|