Skip to content

Instantly share code, notes, and snippets.

@numkem
Created June 7, 2020 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save numkem/f12406e9a646a7582e3aa8709d82d037 to your computer and use it in GitHub Desktop.
Save numkem/f12406e9a646a7582e3aa8709d82d037 to your computer and use it in GitHub Desktop.
NixOS module for espanso
{ 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