pbgopy: add service
This commit is contained in:
parent
e3828769e8
commit
e6a58a7e71
7 changed files with 76 additions and 0 deletions
|
|
@ -1767,6 +1767,14 @@ in
|
|||
A new module is available: 'services.wlsunset'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-12-09T22:34:33+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.pbgopy'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@ let
|
|||
(loadModule ./services/parcellite.nix { })
|
||||
(loadModule ./services/password-store-sync.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/pasystray.nix { })
|
||||
(loadModule ./services/pbgopy.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/picom.nix { })
|
||||
(loadModule ./services/polybar.nix { })
|
||||
(loadModule ./services/pulseeffects.nix { condition = hostPlatform.isLinux; })
|
||||
|
|
|
|||
40
modules/services/pbgopy.nix
Normal file
40
modules/services/pbgopy.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.pbgopy;
|
||||
package = pkgs.pbgopy;
|
||||
in {
|
||||
meta.maintainers = [ maintainers.ivar ];
|
||||
|
||||
options.services.pbgopy = {
|
||||
enable = mkEnableOption "pbgopy";
|
||||
|
||||
cache.ttl = mkOption {
|
||||
type = types.str;
|
||||
default = "24h";
|
||||
example = "10m";
|
||||
description = ''
|
||||
The TTL for the cache. Use <literal>"0s"</literal> to disable it.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ package ];
|
||||
|
||||
systemd.user.services.pbgopy = {
|
||||
Unit = {
|
||||
Description = "pbgopy server for sharing the clipboard between devices";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${package}/bin/pbgopy serve --ttl ${cfg.cache.ttl}";
|
||||
Restart = "on-abort";
|
||||
};
|
||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue