forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
espanso.nix
31 lines (27 loc) · 812 Bytes
/
espanso.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.services.espanso;
in {
meta = { maintainers = with lib.maintainers; [ numkem ]; };
options = {
services.espanso = {
enable = mkEnableOption "Espanso";
wayland = mkEnableOption "use the Wayland compatible espanso package";
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 = "${lib.getExe cfg.package} daemon";
Restart = "on-failure";
};
wantedBy = [ "default.target" ];
};
environment.systemPackages = [ cfg.package ];
};
}