nixos/modules: add greenclip user service
This commit is contained in:
parent
290cfc767c
commit
5ccfa0c816
@ -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
|
||||||
|
31
nixos/modules/services/misc/greenclip.nix
Normal file
31
nixos/modules/services/misc/greenclip.nix
Normal 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 ];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user