36 lines
1.3 KiB
Nix
36 lines
1.3 KiB
Nix
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }:
|
|
|
|
let
|
|
hmConfig = config.home-manager.users.${user.name};
|
|
in
|
|
{
|
|
home-manager.users.${user.name} = {
|
|
home = {
|
|
packages = with pkgs; [ wl-clipboard cliphist ];
|
|
persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/cliphist" ];
|
|
};
|
|
|
|
wayland.windowManager.hyprland = {
|
|
initExtraConfig = ''
|
|
${lib.meta.getExe (pkgs.writeShellApplication {
|
|
name = "init-cliphist-text";
|
|
runtimeInputs = with pkgs; [ wl-clipboard cliphist ];
|
|
text = "wl-paste --type text --watch cliphist store";
|
|
})} &
|
|
|
|
${lib.meta.getExe (pkgs.writeShellApplication {
|
|
name = "init-cliphist-image";
|
|
runtimeInputs = with pkgs; [ wl-clipboard cliphist ];
|
|
text = "wl-paste --type image --watch cliphist store";
|
|
})} &
|
|
'';
|
|
|
|
settings.bind = [
|
|
"$mod, v, exec, cliphist list | ${lib.meta.getExe pkgs.rofi-wayland} -cache-dir ${hmConfig.xdg.cacheHome}/rofi -dmenu -display-columns 2 | cliphist decode | wl-copy"
|
|
"$mod_CTRL, v, exec, cliphist list | ${lib.meta.getExe pkgs.rofi-wayland} -cache-dir ${hmConfig.xdg.cacheHome}/rofi -dmenu -display-columns 2 | cliphist delete"
|
|
"$mod_CTRL_SHIFT, v, exec, cliphist wipe"
|
|
];
|
|
};
|
|
};
|
|
}
|