Created
June 7, 2020 17:31
-
-
Save numkem/f12406e9a646a7582e3aa8709d82d037 to your computer and use it in GitHub Desktop.
NixOS module for espanso
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, lib, pkgs, ... }: | |
with lib; | |
let | |
cfg = config.services.espanso; | |
in { | |
options = { | |
services.espanso = { | |
enable = mkOption { | |
type = types.bool; | |
default = false; | |
description = '' | |
Enable espanso | |
''; | |
}; | |
package = mkOption { | |
type = types.package; | |
default = pkgs.espanso; | |
description = '' | |
Espanso package to use | |
''; | |
}; | |
}; | |
}; | |
config = mkIf cfg.enable { | |
systemd.user.services.espanso = { | |
description = "Espanso daemon"; | |
path = with pkgs; [ cfg.package libnotify xclip ]; | |
serviceConfig = { | |
ExecStart = "${cfg.package}/bin/espanso daemon"; | |
Restart = "on-failure"; | |
}; | |
}; | |
environment.systemPackages = [ cfg.package ]; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment