diff --git a/flake.lock b/flake.lock index ab73217..6e383d8 100644 --- a/flake.lock +++ b/flake.lock @@ -117,6 +117,24 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "friendly-snippets": { "flake": false, "locked": { @@ -409,6 +427,22 @@ "type": "github" } }, + "nixpkgs_4": { + "locked": { + "lastModified": 1701174899, + "narHash": "sha256-1W+FMe8mWsJKXoBc+QgKmEeRj33kTFnPq7XCjU+bfnA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "010c7296f3b19a58b206fdf7d68d75a5b0a09e9e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixvim": { "inputs": { "flake-parts": "flake-parts_2", @@ -483,7 +517,33 @@ "home-manager": "home-manager_2", "hyprland": "hyprland", "hyprland-hyprfocus": "hyprland-hyprfocus", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_3", + "yazi": "yazi" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "yazi", + "flake-utils" + ], + "nixpkgs": [ + "yazi", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701224160, + "narHash": "sha256-qnMmxNMKmd6Soel0cfauyMJ+LzuZbvmiDQPSIuTbQ+M=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "4a080e26d55eaedb95ab1bf8eeaeb84149c10f12", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } }, "rustaceanvim": { @@ -548,6 +608,21 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "transparent-nvim": { "flake": false, "locked": { @@ -612,6 +687,26 @@ "repo": "xdg-desktop-portal-hyprland", "type": "github" } + }, + "yazi": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_4", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1707187677, + "narHash": "sha256-2IXAbgOLcNotmiWOXUTR+Tzp4ZO1xiwQKvpFD7OqW7Q=", + "owner": "sxyazi", + "repo": "yazi", + "rev": "19791d8328c798157b3d75d35b955541a0f5f7c9", + "type": "github" + }, + "original": { + "owner": "sxyazi", + "repo": "yazi", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index b0a06c7..5fdf5bd 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,9 @@ # My neovim configuration using nixvim. custom-neovim.url = "github:wizardlink/neovim"; + + # CLI file manager. + yazi.url = "github:sxyazi/yazi"; }; outputs = @@ -33,6 +36,7 @@ nixosConfigurations.nixos = let system = "x86_64-linux"; + specialArgs = inputs; modules = [ ./nixos.nix @@ -51,7 +55,7 @@ } ]; in - nixpkgs.lib.nixosSystem { inherit system modules; }; + nixpkgs.lib.nixosSystem { inherit system specialArgs modules; }; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; }; diff --git a/home-manager.nix b/home-manager.nix index 5f92c8f..5a10731 100644 --- a/home-manager.nix +++ b/home-manager.nix @@ -15,6 +15,7 @@ ./programs/rofi ./programs/waybar.nix ./programs/wezterm + ./programs/yazi ]; # Home Manager needs a bit of information about you and the paths it should @@ -84,6 +85,7 @@ # Editing krita libreoffice + logseq shotcut ## Entertainment @@ -108,7 +110,6 @@ ## Development lazygit neofetch - custom-neovim.packages.${system}.default vscode-extensions.vadimcn.vscode-lldb ## Desktop environment @@ -119,9 +120,6 @@ polkit-kde-agent slurp swww - # File manager - ark - dolphin ## Theming (nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) diff --git a/nixos.nix b/nixos.nix index 6e38ff4..ce9d543 100644 --- a/nixos.nix +++ b/nixos.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, pkgs, custom-neovim, ... }: { ## @@ -291,6 +291,8 @@ xclip zip zoxide + # Development + custom-neovim.packages.${system}.default ## Libraries libsForQt5.qt5.qtgraphicaleffects diff --git a/programs/fish/default.nix b/programs/fish/default.nix index bbb55d7..1f3f0df 100644 --- a/programs/fish/default.nix +++ b/programs/fish/default.nix @@ -46,6 +46,15 @@ trash_file.body = '' mv $argv ~/.local/share/Trash ''; + + ya.body = '' + set tmp (mktemp -t "yazi-cwd.XXXXX") + yazi $argv --cwd-file="$tmp" + if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + cd -- "$cwd" + end + rm -f -- "$tmp" + ''; }; }; } diff --git a/programs/yazi/default.nix b/programs/yazi/default.nix new file mode 100644 index 0000000..3ea4bb7 --- /dev/null +++ b/programs/yazi/default.nix @@ -0,0 +1,19 @@ +{ pkgs, yazi, ... }: + +{ + programs.yazi = { + enable = true; + package = yazi.packages.${pkgs.system}.default; + + settings = { + opener = { + text = [{ + block = true; + exec = "nvim \"$@\""; + }]; + }; + + theme = builtins.readFile ./theme.toml; + }; + }; +} diff --git a/programs/yazi/theme.toml b/programs/yazi/theme.toml new file mode 100644 index 0000000..6c959c5 --- /dev/null +++ b/programs/yazi/theme.toml @@ -0,0 +1,145 @@ +# vim:fileencoding=utf-8:foldmethod=marker + +# : Manager {{{ + +[manager] +cwd = { fg = "#81c8be" } + +# Hovered +hovered = { fg = "#303446", bg = "#8caaee" } +preview_hovered = { underline = true } + +# Find +find_keyword = { fg = "#e5c890", italic = true } +find_position = { fg = "#f4b8e4", bg = "reset", italic = true } + +# Marker +marker_selected = { fg = "#a6d189", bg = "#a6d189" } +marker_copied = { fg = "#e5c890", bg = "#e5c890" } +marker_cut = { fg = "#e78284", bg = "#e78284" } + +# Tab +tab_active = { fg = "#303446", bg = "#8caaee" } +tab_inactive = { fg = "#c6d0f5", bg = "#51576d" } +tab_width = 1 + +# Border +border_symbol = "│" +border_style = { fg = "#838ba7" } + +# Highlighting +syntect_theme = "~/.config/yazi/Catppuccin-frappe.tmTheme" + +# : }}} + + +# : Status {{{ + +[status] +separator_open = "" +separator_close = "" +separator_style = { fg = "#51576d", bg = "#51576d" } + +# Mode +mode_normal = { fg = "#303446", bg = "#8caaee", bold = true } +mode_select = { fg = "#303446", bg = "#a6d189", bold = true } +mode_unset = { fg = "#303446", bg = "#eebebe", bold = true } + +# Progress +progress_label = { fg = "#ffffff", bold = true } +progress_normal = { fg = "#8caaee", bg = "#51576d" } +progress_error = { fg = "#e78284", bg = "#51576d" } + +# Permissions +permissions_t = { fg = "#8caaee" } +permissions_r = { fg = "#e5c890" } +permissions_w = { fg = "#e78284" } +permissions_x = { fg = "#a6d189" } +permissions_s = { fg = "#838ba7" } + +# : }}} + + +# : Input {{{ + +[input] +border = { fg = "#8caaee" } +title = {} +value = {} +selected = { reversed = true } + +# : }}} + + +# : Select {{{ + +[select] +border = { fg = "#8caaee" } +active = { fg = "#f4b8e4" } +inactive = {} + +# : }}} + + +# : Tasks {{{ + +[tasks] +border = { fg = "#8caaee" } +title = {} +hovered = { underline = true } + +# : }}} + + +# : Which {{{ + +[which] +mask = { bg = "#414559" } +cand = { fg = "#81c8be" } +rest = { fg = "#949cbb" } +desc = { fg = "#f4b8e4" } +separator = "  " +separator_style = { fg = "#626880" } + +# : }}} + + +# : Help {{{ + +[help] +on = { fg = "#f4b8e4" } +exec = { fg = "#81c8be" } +desc = { fg = "#949cbb" } +hovered = { bg = "#626880", bold = true } +footer = { fg = "#51576d", bg = "#c6d0f5" } + +# : }}} + + +# : File-specific styles {{{ + +[filetype] + +rules = [ + # Images + { mime = "image/*", fg = "#81c8be" }, + + # Videos + { mime = "video/*", fg = "#e5c890" }, + { mime = "audio/*", fg = "#e5c890" }, + + # Archives + { mime = "application/zip", fg = "#f4b8e4" }, + { mime = "application/gzip", fg = "#f4b8e4" }, + { mime = "application/x-tar", fg = "#f4b8e4" }, + { mime = "application/x-bzip", fg = "#f4b8e4" }, + { mime = "application/x-bzip2", fg = "#f4b8e4" }, + { mime = "application/x-7z-compressed", fg = "#f4b8e4" }, + { mime = "application/x-rar", fg = "#f4b8e4" }, + + # Fallback + { name = "*", fg = "#c6d0f5" }, + { name = "*/", fg = "#8caaee" } +] + +# : }}}