about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/services/misc/greenclip.nix
blob: d92cd1854877f34febf1dc9a343889cda76ff6ea (plain) (blame)
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, ... }:

with lib;

let
  cfg = config.services.greenclip;
in {

  options.services.greenclip = {
    enable = mkEnableOption "Greenclip, a clipboard manager";

    package = mkPackageOption pkgs [ "haskellPackages" "greenclip" ] { };
  };

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

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