mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 19:49:45 +01:00
e8b5f8f9b3
PR #3747 renamed the option wayland.windowManager.sway.systemdIntegration to wayland.windowManager.sway.systemd.enable. This commit simply updates documentation to reference the new format.
53 lines
1.5 KiB
Nix
53 lines
1.5 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
with lib;
|
|
let cfg = config.services.clipman;
|
|
in {
|
|
meta.maintainers = [ maintainers.jwygoda ];
|
|
|
|
options.services.clipman = {
|
|
enable = mkEnableOption "clipman, a simple clipboard manager for Wayland";
|
|
|
|
package = mkPackageOption pkgs "clipman" { };
|
|
|
|
systemdTarget = mkOption {
|
|
type = types.str;
|
|
default = "graphical-session.target";
|
|
example = "sway-session.target";
|
|
description = ''
|
|
The systemd target that will automatically start the clipman service.
|
|
</para>
|
|
<para>
|
|
When setting this value to <literal>"sway-session.target"</literal>,
|
|
make sure to also enable <option>wayland.windowManager.sway.systemd.enable</option>,
|
|
otherwise the service may never be started.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
assertions = [
|
|
(lib.hm.assertions.assertPlatform "services.clipman" pkgs
|
|
lib.platforms.linux)
|
|
];
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
systemd.user.services.clipman = {
|
|
Unit = {
|
|
Description = "Clipboard management daemon";
|
|
PartOf = [ "graphical-session.target" ];
|
|
After = [ "graphical-session.target" ];
|
|
};
|
|
|
|
Service = {
|
|
ExecStart =
|
|
"${pkgs.wl-clipboard}/bin/wl-paste -t text --watch ${cfg.package}/bin/clipman store";
|
|
ExecReload = "${pkgs.coreutils}/bin/kill -SIGUSR2 $MAINPID";
|
|
Restart = "on-failure";
|
|
KillMode = "mixed";
|
|
};
|
|
|
|
Install = { WantedBy = [ cfg.systemdTarget ]; };
|
|
};
|
|
};
|
|
}
|