Reorganize imports
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
85
hosts/common/configs/user/gui/cliphist/default.nix
Normal file
85
hosts/common/configs/user/gui/cliphist/default.nix
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache"."${home}/.cache/cliphist" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
home.packages = with pkgs; [
|
||||
wl-clipboard
|
||||
cliphist
|
||||
];
|
||||
|
||||
systemd.user.services = {
|
||||
cliphist = {
|
||||
Unit = {
|
||||
Description = "Clipboard manager";
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
After = [
|
||||
"graphical-session.target"
|
||||
config.environment.persistence."/cache"."${home}/.cache/cliphist".mount
|
||||
];
|
||||
};
|
||||
|
||||
Service.ExecStart = lib.meta.getExe (
|
||||
pkgs.writeShellApplication {
|
||||
name = "init-cliphist";
|
||||
runtimeInputs = with pkgs; [
|
||||
wl-clipboard
|
||||
cliphist
|
||||
];
|
||||
text = "exec wl-paste --watch cliphist store";
|
||||
}
|
||||
);
|
||||
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
cliphist-image = {
|
||||
Unit = {
|
||||
Description = "Clipboard manager (images)";
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
After = [
|
||||
"graphical-session.target"
|
||||
config.environment.persistence."/cache"."${home}/.cache/cliphist".mount
|
||||
];
|
||||
};
|
||||
|
||||
Service.ExecStart = lib.meta.getExe (
|
||||
pkgs.writeShellApplication {
|
||||
name = "init-cliphist-image";
|
||||
runtimeInputs = with pkgs; [
|
||||
wl-clipboard
|
||||
cliphist
|
||||
];
|
||||
text = "exec wl-paste --type image --watch cliphist store";
|
||||
}
|
||||
);
|
||||
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland.settings.bind =
|
||||
let
|
||||
cliphist-rofi = lib.meta.getExe (
|
||||
pkgs.callPackage ./rofi.nix { rofi = hmConfig.programs.rofi.finalPackage; }
|
||||
);
|
||||
cliphist = lib.meta.getExe pkgs.cliphist;
|
||||
in
|
||||
[
|
||||
"$mod, v, exec, ${cliphist-rofi}"
|
||||
"$mod_Ctrl, v, exec, ${cliphist} wipe"
|
||||
];
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user