diff --git a/hosts/common/configs/user/console/bashmount/default.nix b/hosts/common/configs/user/console/bashmount/default.nix deleted file mode 100644 index 93b5b11..0000000 --- a/hosts/common/configs/user/console/bashmount/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - user ? throw "user argument is required", - home ? throw "home argument is required", -}: -{ lib, pkgs, ... }: -{ - home-manager.users.${user}.programs.bashmount.enable = true; -} diff --git a/hosts/common/configs/user/console/ffmpeg/default.nix b/hosts/common/configs/user/console/ffmpeg/default.nix index 40c99ab..f561fc0 100644 --- a/hosts/common/configs/user/console/ffmpeg/default.nix +++ b/hosts/common/configs/user/console/ffmpeg/default.nix @@ -4,5 +4,8 @@ }: { pkgs, ... }: { - home-manager.users.${user}.home.packages = with pkgs; [ ffmpeg ]; + home-manager.users.${user}.home.packages = with pkgs; [ + ffmpeg + mediainfo + ]; } diff --git a/hosts/common/configs/user/console/unzip/default.nix b/hosts/common/configs/user/console/ouch/default.nix similarity index 62% rename from hosts/common/configs/user/console/unzip/default.nix rename to hosts/common/configs/user/console/ouch/default.nix index 9a7c7c7..4b1cbfc 100644 --- a/hosts/common/configs/user/console/unzip/default.nix +++ b/hosts/common/configs/user/console/ouch/default.nix @@ -4,5 +4,5 @@ }: { pkgs, ... }: { - home-manager.users.${user}.home.packages = with pkgs; [ unzip ]; + home-manager.users.${user}.home.packages = with pkgs; [ ouch ]; } diff --git a/hosts/common/configs/user/console/ranger/default.nix b/hosts/common/configs/user/console/ranger/default.nix deleted file mode 100644 index 9858cae..0000000 --- a/hosts/common/configs/user/console/ranger/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - user ? throw "user argument is required", - home ? throw "home argument is required", -}: -{ ... }: -{ - environment.persistence."/persist/cache"."${home}/.cache/ranger" = { }; - - home-manager.users.${user}.programs = { - ranger = { - enable = true; - - settings = { - preview_images = true; - preview_images_method = "kitty"; - }; - }; - - zsh.p10k.extraRightPromptElements = [ "ranger" ]; - }; -} diff --git a/hosts/common/configs/user/console/yazi/default.nix b/hosts/common/configs/user/console/yazi/default.nix new file mode 100644 index 0000000..64b1908 --- /dev/null +++ b/hosts/common/configs/user/console/yazi/default.nix @@ -0,0 +1,193 @@ +{ + user ? throw "user argument is required", + home ? throw "home argument is required", +}: +{ + config, + lib, + pkgs, + ... +}: +let + hmConfig = config.home-manager.users.${user}; +in +{ + home-manager.users.${user} = { + programs = { + yazi = { + enable = true; + enableZshIntegration = true; + + settings = { + mgr = { + show_hidden = true; + }; + + opener = { + edit = + [ + { + run = "${hmConfig.programs.neovim.finalPackage}/bin/nvim \"$@\""; + desc = "nvim"; + block = true; + } + ] + ++ lib.lists.optional hmConfig.programs.vscode.enable { + run = "${hmConfig.programs.vscode.package}/bin/code \"$@\""; + desc = "code"; + orphan = true; + }; + open = [ + { + run = "xdg-open \"$1\""; + desc = "Open"; + } + ]; + reveal = [ + { + run = "xdg-open \"$(dirname \"$1\")\""; + desc = "Reveal"; + } + ]; + extract = [ + { + run = "ouch d -y \"$@\""; + desc = "Extract here with ouch"; + } + ]; + play = [ + { + run = "mpv \"$@\""; + orphan = true; + } + ]; + }; + + plugin = { + prepend_preloaders = [ + { + mime = "{audio,video,image}/*"; + run = "mediainfo"; + } + { + mime = "application/subrip"; + run = "mediainfo"; + } + ]; + + prepend_previewers = [ + { + mime = "{audio,video,image}/*"; + run = "mediainfo"; + } + { + mime = "application/subrip"; + run = "mediainfo"; + } + { + mime = "application/*zip"; + run = "ouch"; + } + { + mime = "application/x-tar"; + run = "ouch"; + } + { + mime = "application/x-bzip2"; + run = "ouch"; + } + { + mime = "application/x-7z-compressed"; + run = "ouch"; + } + { + mime = "application/x-rar"; + run = "ouch"; + } + { + mime = "application/x-xz"; + run = "ouch"; + } + { + mime = "application/xz"; + run = "ouch"; + } + ]; + }; + }; + + keymap = { + mgr.prepend_keymap = [ + { + on = ""; + run = "plugin smart-enter"; + desc = "Enter the child directory, or open the file"; + } + { + on = "!"; + run = "shell \"$SHELL\" --block"; + desc = "Open $SHELL here"; + } + { + on = "C"; + run = "plugin ouch"; + desc = "Compress"; + } + { + on = "M"; + run = "plugin chmod"; + desc = "Chmod on selected files"; + } + { + on = ""; + run = "plugin mount"; + desc = "Open the mount menu"; + } + ]; + }; + + initLua = '' + Status:children_add(function(self) + local h = self._current.hovered + if not h or not h.link_to then + return "" + end + + return " -> " .. tostring(h.link_to) + end, 3300, Status.LEFT) + + Status:children_add(function() + local h = cx.active.current.hovered + if not h then + return "" + end + + return ui.Line { + ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)), + ":", + ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)), + " ", + } + end, 500, Status.RIGHT) + ''; + + plugins = with pkgs.yaziPlugins; { + inherit + smart-enter + chmod + ouch + mount + mediainfo + ; + }; + }; + + zsh = { + shellAliases.y = "yazi"; + p10k.extraRightPromptElements = [ "yazi" ]; + }; + }; + + theme.template.".config/yazi/theme.toml".source = ./theme.toml; + }; +} diff --git a/hosts/common/configs/user/console/yazi/theme.toml b/hosts/common/configs/user/console/yazi/theme.toml new file mode 100644 index 0000000..8d715eb --- /dev/null +++ b/hosts/common/configs/user/console/yazi/theme.toml @@ -0,0 +1,101 @@ +[mgr] +cwd = { fg = "{{colors.primary.default.hex}}" } + +preview_hovered = { underline = false } + +find_keyword = { fg = "{{colors.error.default.hex}}", bold = true, italic = true, underline = true } +find_position = { fg = "{{colors.error.default.hex}}", bg = "reset", bold = true, italic = true } + +marker_copied = { fg = "{{colors.secondary.default.hex}}", bg = "{{colors.secondary.default.hex}}" } +marker_cut = { fg = "{{colors.warning.default.hex}}", bg = "{{colors.warning.default.hex}}" } +marker_marked = { fg = "{{colors.error.default.hex}}", bg = "{{colors.error.default.hex}}" } +marker_selected = { fg = "{{colors.primary.default.hex}}", bg = "{{colors.primary.default.hex}}" } + +count_copied = { fg = "{{colors.on_secondary.default.hex}}", bg = "{{colors.secondary.default.hex}}" } +count_cut = { fg = "{{colors.on_warning.default.hex}}", bg = "{{colors.warning.default.hex}}" } +count_selected = { fg = "{{colors.on_primary.default.hex}}", bg = "{{colors.primary.default.hex}}" } + +border_style = { fg = "{{colors.outline.default.hex}}" } + +[tabs] +active = { fg = "{{colors.on_primary.default.hex}}", bg = "{{colors.primary.default.hex}}", bold = true } +inactive = { fg = "{{colors.on_surface_variant.default.hex}}", bg = "{{colors.surface_dim.default.hex}}" } + +sep_inner = { open = "", close = "" } +sep_outer = { open = "", close = "" } + +[mode] +normal_main = { fg = "{{colors.on_primary.default.hex}}", bg = "{{colors.primary.default.hex}}", bold = true } +normal_alt = { fg = "{{colors.on_primary_container.default.hex}}", bg = "{{colors.primary_container.default.hex}}" } + +select_main = { fg = "{{colors.on_secondary.default.hex}}", bg = "{{colors.secondary.default.hex}}", bold = true } +select_alt = { fg = "{{colors.on_secondary_container.default.hex}}", bg = "{{colors.secondary_container.default.hex}}" } + +unset_main = { fg = "{{colors.on_tertiary.default.hex}}", bg = "{{colors.tertiary.default.hex}}", bold = true } +unset_alt = { fg = "{{colors.on_tertiary_container.default.hex}}", bg = "{{colors.tertiary_container.default.hex}}" } + +[status] +sep_left = { open = "", close = "" } +sep_right = { open = "", close = "" } + +perm_sep = { fg = "{{colors.scrim.default.hex}}" } +perm_type = { fg = "{{colors.primary.default.hex}}" } +perm_read = { fg = "{{colors.primary.default.hex}}" } +perm_write = { fg = "{{colors.secondary.default.hex}}" } +perm_exec = { fg = "{{colors.tertiary.default.hex}}" } + +progress_label = { bold = true } +progress_normal = { fg = "{{colors.primary.default.hex}}", bg = "{{colors.primary_container.default.hex}}" } +progress_error = { fg = "{{colors.error.default.hex}}", bg = "{{colors.error_container.default.hex}}" } + +[which] +mask = { bg = "{{colors.surface.default.hex}}" } +cand = { fg = "{{colors.primary.default.hex}}" } +rest = { fg = "{{colors.primary_container.default.hex}}" } +desc = { fg = "{{colors.on_surface.default.hex}}" } +separator_style = { fg = "{{colors.scrim.default.hex}}" } + +[confirm] +border = { fg = "{{colors.primary.default.hex}}" } +title = { fg = "{{colors.primary.default.hex}}" } + +[spot] +border = { fg = "{{colors.primary.default.hex}}" } +title = { fg = "{{colors.primary.default.hex}}" } + +tbl_col = { fg = "{{colors.primary.default.hex}}" } +tbl_cell = { fg = "{{colors.secondary.default.hex}}", reversed = true } + +[notify] +title_info = { fg = "{{colors.info.default.hex}}" } +title_warn = { fg = "{{colors.warning.default.hex}}" } +title_error = { fg = "{{colors.error.default.hex}}" } + +[pick] +border = { fg = "{{colors.primary.default.hex}}" } +active = { fg = "{{colors.secondary.default.hex}}", bold = true } + +[input] +border = { fg = "{{colors.primary.default.hex}}" } + +[cmp] +border = { fg = "{{colors.primary.default.hex}}" } + +[tasks] +border = { fg = "{{colors.primary.default.hex}}" } +hovered = { fg = "{{colors.secondary.default.hex}}", bold = true } + +[help] +on = { fg = "{{colors.primary.default.hex}}" } +run = { fg = "{{colors.secondary.default.hex}}" } +footer = { fg = "{{colors.surface.default.hex}}", bg = "{{colors.on_surface.default.hex}}" } + +[icon] +prepend_dirs = [ + { name = ".cache", text = "" }, + { name = ".local", text = "󱋣" }, + { name = "Games", text = "" }, + { name = "git", text = "" }, + { name = "Templates", text = "" }, + { name = "VMs", text = "" }, +] diff --git a/hosts/common/configs/user/console/zoxide/default.nix b/hosts/common/configs/user/console/zoxide/default.nix new file mode 100644 index 0000000..1108859 --- /dev/null +++ b/hosts/common/configs/user/console/zoxide/default.nix @@ -0,0 +1,13 @@ +{ + user ? throw "user argument is required", + home ? throw "home argument is required", +}: +{ ... }: +{ + environment.persistence."/persist/state"."${home}/.local/share/zoxide" = { }; + + home-manager.users.${user}.programs.zoxide = { + enable = true; + enableZshIntegration = true; + }; +} diff --git a/hosts/elara/users/nikara/default.nix b/hosts/elara/users/nikara/default.nix index a0d5b47..943ea70 100644 --- a/hosts/elara/users/nikara/default.nix +++ b/hosts/elara/users/nikara/default.nix @@ -9,11 +9,12 @@ in imports = [ ../../../common/configs/user/options.nix - (import ../../../common/configs/user/console/bashmount { inherit user home; }) + (import ../../../common/configs/user/console/android { inherit user home; }) (import ../../../common/configs/user/console/brightnessctl { inherit user home; }) (import ../../../common/configs/user/console/btop { inherit user home; }) (import ../../../common/configs/user/console/dive { inherit user home; }) (import ../../../common/configs/user/console/fastfetch { inherit user home; }) + (import ../../../common/configs/user/console/ffmpeg { inherit user home; }) (import ../../../common/configs/user/console/git { inherit user home; }) (import ../../../common/configs/user/console/gpg-agent { inherit user home; }) (import ../../../common/configs/user/console/home-manager { inherit user home; }) @@ -30,18 +31,20 @@ in (import ../../../common/configs/user/console/nix-cleanup { inherit user home; }) (import ../../../common/configs/user/console/nix-develop { inherit user home; }) (import ../../../common/configs/user/console/nix-direnv { inherit user home; }) + (import ../../../common/configs/user/console/ouch { inherit user home; }) (import ../../../common/configs/user/console/pipewire { inherit user home; }) (import ../../../common/configs/user/console/podman { inherit user home; }) - (import ../../../common/configs/user/console/ranger { inherit user home; }) (import ../../../common/configs/user/console/sops { inherit user home; }) (import ../../../common/configs/user/console/ssh { inherit user home; }) (import ../../../common/configs/user/console/ssh-agent { inherit user home; }) (import ../../../common/configs/user/console/syncthing { inherit user home; }) (import ../../../common/configs/user/console/tmux { inherit user home; }) (import ../../../common/configs/user/console/tree { inherit user home; }) - (import ../../../common/configs/user/console/unzip { inherit user home; }) (import ../../../common/configs/user/console/wget { inherit user home; }) (import ../../../common/configs/user/console/xdg { inherit user home; }) + (import ../../../common/configs/user/console/yazi { inherit user home; }) + (import ../../../common/configs/user/console/yt-dlp { inherit user home; }) + (import ../../../common/configs/user/console/zoxide { inherit user home; }) (import ../../../common/configs/user/console/zsh { inherit user home; }) (import ../../../common/configs/user/gui/astal { inherit user home; }) diff --git a/hosts/himalia/users/nick/default.nix b/hosts/himalia/users/nick/default.nix index 07f8111..c91929b 100644 --- a/hosts/himalia/users/nick/default.nix +++ b/hosts/himalia/users/nick/default.nix @@ -10,7 +10,6 @@ in ../../../common/configs/user/options.nix (import ../../../common/configs/user/console/android { inherit user home; }) - (import ../../../common/configs/user/console/bashmount { inherit user home; }) (import ../../../common/configs/user/console/brightnessctl { inherit user home; }) (import ../../../common/configs/user/console/btop { inherit user home; }) (import ../../../common/configs/user/console/dive { inherit user home; }) @@ -31,19 +30,20 @@ in (import ../../../common/configs/user/console/nix-cleanup { inherit user home; }) (import ../../../common/configs/user/console/nix-develop { inherit user home; }) (import ../../../common/configs/user/console/nix-direnv { inherit user home; }) + (import ../../../common/configs/user/console/ouch { inherit user home; }) (import ../../../common/configs/user/console/pipewire { inherit user home; }) (import ../../../common/configs/user/console/podman { inherit user home; }) - (import ../../../common/configs/user/console/ranger { inherit user home; }) (import ../../../common/configs/user/console/sops { inherit user home; }) (import ../../../common/configs/user/console/ssh { inherit user home; }) (import ../../../common/configs/user/console/ssh-agent { inherit user home; }) (import ../../../common/configs/user/console/syncthing { inherit user home; }) (import ../../../common/configs/user/console/tmux { inherit user home; }) (import ../../../common/configs/user/console/tree { inherit user home; }) - (import ../../../common/configs/user/console/unzip { inherit user home; }) (import ../../../common/configs/user/console/wget { inherit user home; }) (import ../../../common/configs/user/console/xdg { inherit user home; }) + (import ../../../common/configs/user/console/yazi { inherit user home; }) (import ../../../common/configs/user/console/yt-dlp { inherit user home; }) + (import ../../../common/configs/user/console/zoxide { inherit user home; }) (import ../../../common/configs/user/console/zsh { inherit user home; }) (import ../../../common/configs/user/gui/astal { inherit user home; }) diff --git a/hosts/installer/users/nick/default.nix b/hosts/installer/users/nick/default.nix index f3885e7..98f4bd5 100644 --- a/hosts/installer/users/nick/default.nix +++ b/hosts/installer/users/nick/default.nix @@ -9,7 +9,6 @@ in imports = [ ../../../common/configs/user/options.nix - (import ../../../common/configs/user/console/bashmount { inherit user home; }) (import ../../../common/configs/user/console/btop { inherit user home; }) (import ../../../common/configs/user/console/fastfetch { inherit user home; }) (import ../../../common/configs/user/console/git { inherit user home; }) @@ -22,7 +21,7 @@ in (import ../../../common/configs/user/console/nix { inherit user home; }) (import ../../../common/configs/user/console/nix-develop { inherit user home; }) (import ../../../common/configs/user/console/nix-direnv { inherit user home; }) - (import ../../../common/configs/user/console/ranger { inherit user home; }) + (import ../../../common/configs/user/console/ouch { inherit user home; }) (import ../../../common/configs/user/console/sops { inherit user home; }) (import ../../../common/configs/user/console/ssh { inherit user home; }) (import ../../../common/configs/user/console/ssh-agent { inherit user home; }) @@ -30,6 +29,8 @@ in (import ../../../common/configs/user/console/tree { inherit user home; }) (import ../../../common/configs/user/console/wget { inherit user home; }) (import ../../../common/configs/user/console/xdg { inherit user home; }) + (import ../../../common/configs/user/console/yazi { inherit user home; }) + (import ../../../common/configs/user/console/zoxide { inherit user home; }) (import ../../../common/configs/user/console/zsh { inherit user home; }) (import ./configs/console/git { inherit user home; }) diff --git a/hosts/jupiter/users/nick/default.nix b/hosts/jupiter/users/nick/default.nix index 745748a..983f7f6 100644 --- a/hosts/jupiter/users/nick/default.nix +++ b/hosts/jupiter/users/nick/default.nix @@ -22,14 +22,15 @@ in (import ../../../common/configs/user/console/nix { inherit user home; }) (import ../../../common/configs/user/console/nix-cleanup { inherit user home; }) (import ../../../common/configs/user/console/nix-direnv { inherit user home; }) + (import ../../../common/configs/user/console/ouch { inherit user home; }) (import ../../../common/configs/user/console/podman { inherit user home; }) - (import ../../../common/configs/user/console/ranger { inherit user home; }) (import ../../../common/configs/user/console/sops { inherit user home; }) (import ../../../common/configs/user/console/tmux { inherit user home; }) (import ../../../common/configs/user/console/tree { inherit user home; }) - (import ../../../common/configs/user/console/unzip { inherit user home; }) (import ../../../common/configs/user/console/wget { inherit user home; }) (import ../../../common/configs/user/console/xdg { inherit user home; }) + (import ../../../common/configs/user/console/yazi { inherit user home; }) + (import ../../../common/configs/user/console/zoxide { inherit user home; }) (import ../../../common/configs/user/console/zsh { inherit user home; }) (import ./configs/console/podman { inherit user home; })