1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-01 00:39:45 +01:00

cliphist: support images in clipboard history

This commit is contained in:
Maciej Zwoliński 2024-04-28 23:51:59 +02:00 committed by GitHub
parent 02002a08b4
commit c002bc08c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,6 +9,14 @@ in {
package = lib.mkPackageOption pkgs "cliphist" { }; package = lib.mkPackageOption pkgs "cliphist" { };
allowImages = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Store images in clipboard history.
'';
};
systemdTarget = lib.mkOption { systemdTarget = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = "graphical-session.target"; default = "graphical-session.target";
@ -46,5 +54,21 @@ in {
Install = { WantedBy = [ cfg.systemdTarget ]; }; Install = { WantedBy = [ cfg.systemdTarget ]; };
}; };
systemd.user.services.cliphist-images = lib.mkIf cfg.allowImages {
Unit = {
Description = "Clipboard management daemon - images";
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart =
"${pkgs.wl-clipboard}/bin/wl-paste --type image --watch ${cfg.package}/bin/cliphist store";
Restart = "on-failure";
};
Install = { WantedBy = [ cfg.systemdTarget ]; };
};
}; };
} }