espanos: add package option

This commit is contained in:
michaelBelsanti 2024-05-02 18:58:01 -04:00
parent 7d20c0c8ec
commit 2c9c781478
No known key found for this signature in database
GPG Key ID: 59B519DCB54BD92E

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 ];
};
}