From f6832333dcc7c156099764d12a3bca090164dbda Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 24 Jun 2024 00:03:23 +0200 Subject: [PATCH] Add wl-clip-persist --- home/services/default.nix | 1 + home/services/wl-clip-persist.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 home/services/wl-clip-persist.nix diff --git a/home/services/default.nix b/home/services/default.nix index 9799edc..68ec314 100644 --- a/home/services/default.nix +++ b/home/services/default.nix @@ -1,5 +1,6 @@ _: { imports = [ ./dunst.nix + ./wl-clip-persist.nix ]; } diff --git a/home/services/wl-clip-persist.nix b/home/services/wl-clip-persist.nix new file mode 100644 index 0000000..fa15668 --- /dev/null +++ b/home/services/wl-clip-persist.nix @@ -0,0 +1,28 @@ +{ + osConfig, + pkgs, + lib, + ... +}: let + inherit (lib) mkIf; + + cfgIsWayland = osConfig.myOptions.home-manager.wms.isWayland; +in { + config = mkIf cfgIsWayland { + systemd.user.services."wl-clip-persist" = { + Unit = { + Description = "wl-clip-persist (Persist clipboard entries on wayland even after the application gets closed.)"; + After = [ "graphical-session.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Service = { + Type = "simple"; + Restart = "on-failure"; + ExecStart = "${pkgs.wl-clip-persist}/bin/wl-clip-persist --clipboard regular --reconnect-tries 1 --selection-size-limit 1048576"; + }; + + Install.WantedBy = [ "graphical-session.target" ]; + }; + }; +}