summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/misc/clipcat.nix
blob: 4860f023c9e5edcd4426f7059b745512d1dd15ea (plain)
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
{
  config,
  lib,
  pkgs,
  ...
}:
let
  cfg = config.services.clipcat;
in
{

  options.services.clipcat = {
    enable = lib.mkEnableOption "Clipcat clipboard daemon";

    package = lib.mkPackageOption pkgs "clipcat" { };
  };

  config = lib.mkIf cfg.enable {
    systemd.user.services.clipcat = {
      enable = true;
      description = "clipcat daemon";
      wantedBy = [ "graphical-session.target" ];
      after = [ "graphical-session.target" ];
      serviceConfig.ExecStart = "${cfg.package}/bin/clipcatd --no-daemon";
    };

    environment.systemPackages = [ cfg.package ];
  };
}