39 lines
1.3 KiB
Nix
39 lines
1.3 KiB
Nix
{ lib, config, pkgs, inputs, ... }:
|
|
|
|
with lib;
|
|
let
|
|
cfg = config.modules.desktop.cliphist;
|
|
in {
|
|
options.modules.desktop.cliphist = {
|
|
enable = mkEnableOption "enable cliphist, a clipboard manager for wayland";
|
|
package = mkOption {
|
|
type = types.package;
|
|
default = pkgs.cliphist;
|
|
};
|
|
summonScript = mkOption {
|
|
type = types.package;
|
|
default = pkgs.writeShellScript "cliphist-summon" ''
|
|
set -euo pipefail
|
|
|
|
${lib.getExe cfg.package} list | ${lib.getExe config.modules.desktop.fuzzel.package} --dmenu | ${lib.getExe cfg.package} decode | wl-copy
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
hm.services.cliphist = {
|
|
enable = true;
|
|
allowImages = true;
|
|
package = cfg.package;
|
|
};
|
|
|
|
# home-manager recently did a huge upgrade and made it so wayland stuff doesn't break anymore
|
|
# however... they forgot to include cliphist
|
|
# https://github.com/nix-community/home-manager/pull/5785
|
|
# EDIT: i initially did this with `graphical-session-pre.target`, but that didn't work, pray this does
|
|
hm.systemd.user.services.cliphist.Unit.After = "graphical-session.target";
|
|
hm.systemd.user.services.cliphist-images.Unit.After = "graphical-session.target";
|
|
|
|
modules.desktop.rofi.enable = true;
|
|
};
|
|
}
|