feat(home): Set copy/paste cmd from apps mod

This commit is contained in:
punkfairie 2025-02-28 19:20:41 -08:00
parent b138bc03b2
commit df532edf02
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6
3 changed files with 53 additions and 11 deletions

View file

@ -16,15 +16,57 @@ in {
description = "The pinentry package to use.";
};
clipboard = lib.mkOption {
clipboard = let
isXorg = config.marleyos.xorg.xsession.enable;
defaultXorg = {
package = pkgs.clipboard-jh;
copy-command = "${lib.getExe pkgs.clipboard-jh} copy";
paste-command = "${lib.getExe pkgs.clipboard-jh} paste";
};
defaultWayland = {
package = pkgs.wl-clipboard;
copy-command = lib.getExe' pkgs.wl-clipboard "wl-copy";
paste-command = lib.getExe' pkgs.wl-clipboard "wl-paste";
};
in
lib.mkOption {
type = lib.types.submodule {
options = {
package = lib.mkOption {
type = lib.types.package;
default =
if config.marleyos.xorg.xsession.enable
then pkgs.clipboard-jh
else pkgs.wl-clipboard;
if isXorg
then defaultXorg.package
else defaultWayland.package;
description = "The clipboard manager to use.";
};
copy-command = lib.mkOption {
type = lib.types.str;
default =
if isXorg
then defaultXorg.copy-command
else defaultWayland.copy-command;
description = "The command, including binary, to use for copying.";
};
paste-command = lib.mkOption {
type = lib.types.str;
default =
if isXorg
then defaultXorg.paste-command
else defaultWayland.paste-command;
description = "The command, including binary, to use for pasting.";
};
};
};
default =
if isXorg
then defaultXorg
else defaultWayland;
};
terminal = lib.mkOption {
type = lib.types.package;
default = config.programs.wezterm.package;
@ -63,7 +105,7 @@ in {
config = lib.mkIf (is-linux system) {
home.packages = [
cfg.pinentry
cfg.clipboard
cfg.clipboard.package
];
programs.rbw = lib.mkDefault {

View file

@ -161,7 +161,7 @@ in {
open = lib.mkIf (config.programs.fish.enable && (fish_fns ? git_open)) "!fish -c git_open";
chash = "!git log --oneline | gum filter --height 10 | cut -d' ' -f1 | ${config.marleyos.apps.clipboard} &>/dev/null";
chash = "!git log --oneline | gum filter --height 10 | cut -d' ' -f1 | ${config.marleyos.apps.clipboard.copy-command} &>/dev/null";
};
};
}

View file

@ -15,7 +15,7 @@ in {
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
gum
config.marleyos.apps.clipboard
config.marleyos.apps.clipboard.package
];
# ██████╗ ██╗████████╗