nixos/modules: add greenclip user service

This commit is contained in:
steve-chavez 2019-01-29 20:38:47 -05:00 committed by Matthieu Coudron
parent 290cfc767c
commit 5ccfa0c816
2 changed files with 32 additions and 0 deletions

View File

@ -422,6 +422,7 @@
./services/misc/gollum.nix ./services/misc/gollum.nix
./services/misc/gpsd.nix ./services/misc/gpsd.nix
./services/misc/headphones.nix ./services/misc/headphones.nix
./services/misc/greenclip.nix
./services/misc/home-assistant.nix ./services/misc/home-assistant.nix
./services/misc/ihaskell.nix ./services/misc/ihaskell.nix
./services/misc/irkerd.nix ./services/misc/irkerd.nix

View File

@ -0,0 +1,31 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.greenclip;
in {
options.services.greenclip = {
enable = mkEnableOption "Whether to enable the greenclip daemon that will listen to selections";
package = mkOption {
type = types.package;
default = pkgs.haskellPackages.greenclip;
defaultText = "pkgs.haskellPackages.greenclip";
description = "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 ];
};
}