Create wl-clip-persist.nix

This commit is contained in:
Yash Raj 2024-07-08 18:46:19 +05:30 committed by GitHub
parent 6016441c22
commit c64fde6065
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,36 @@
{
lib,
pkgs,
config,
...
}: let
inherit (lib) mkIf mkEnableOption mkOption mkPackageOption;
cfg = config.services.wl-cilp-persist;
in {
meta.maintainers = []; # TODO: add maintainer
options.services.wl-clip-persist = {
enable = mkEnableOption "wl-clip-persist";
package = mkPackageOption pkgs "wl-clip-persist"; # TODO: make it global
systemd = mkEnableOption "systemd service for wl-clip-persist" // mkOption {default = true;};
};
config = mkIf cfg.enable {
systemd.user = mkIf cfg.systemd {
services.wl-clip-persist = {
Unit = {
Description = "Persistent clipboard for Wayland";
PartOf = ["graphical-session.target"];
After = ["graphical-session.target"];
};
Service = {
ExecStart = "${pkgs.wl-clip-persist}/bin/wl-clip-persist --clipboard both";
Restart = "always";
};
Install.WantedBy = ["graphical-session.target"];
};
};
};
}