nixpkgs/nixos/modules/services/misc/greenclip.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
796 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.greenclip;
in {
options.services.greenclip = {
2019-07-23 00:50:21 +00:00
enable = mkEnableOption (lib.mdDoc "Greenclip daemon");
package = mkOption {
type = types.package;
default = pkgs.haskellPackages.greenclip;
defaultText = literalExpression "pkgs.haskellPackages.greenclip";
description = lib.mdDoc "greenclip derivation to use.";
};
};
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";
};
environment.systemPackages = [ cfg.package ];
};
}