From 03d35a039a2122d3636535de6c2968b1acfcc142 Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Wed, 28 Aug 2024 19:00:18 +0700 Subject: [PATCH] update yazi --- hardware-configuration/homeserver.nix | 11 ++++ home/modules/hyprland/hyprland.nix | 2 +- home/programs/yazi.nix | 88 ++++++++++++++++----------- system/modules/sway.nix | 4 +- system/modules/yazi.nix | 6 +- system/services/syncthing.nix | 20 ++++++ 6 files changed, 90 insertions(+), 41 deletions(-) diff --git a/hardware-configuration/homeserver.nix b/hardware-configuration/homeserver.nix index a5f5026..83c6cb2 100644 --- a/hardware-configuration/homeserver.nix +++ b/hardware-configuration/homeserver.nix @@ -41,6 +41,16 @@ "bind" ]; }; + fileSystems."/nas/public/Public" = { + device = "/nas/Syncthing/Sync/Public"; + fsType = "auto"; + options = [ + "defaults" + "nofail" + "nobootwait" + "bind" + ]; + }; swapDevices = [ ]; @@ -86,6 +96,7 @@ }; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.enableAllFirmware = true; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.opengl = { enable = true; diff --git a/home/modules/hyprland/hyprland.nix b/home/modules/hyprland/hyprland.nix index cc14b79..1978bfb 100644 --- a/home/modules/hyprland/hyprland.nix +++ b/home/modules/hyprland/hyprland.nix @@ -227,7 +227,7 @@ in ]; }; extraConfig = /*hyprlang*/ '' - exec-once=dbus-update-activation-enviroment --all + exec-once=dbus-update-activation-environment --all exec-once=${gnome-keyring.path} ${config.sops.secrets."gnome-keyring/${config.home.username}".path} exec-once=foot --server diff --git a/home/programs/yazi.nix b/home/programs/yazi.nix index 58a8eb2..39e47c3 100644 --- a/home/programs/yazi.nix +++ b/home/programs/yazi.nix @@ -5,32 +5,31 @@ let in { config = mkIf cfg.enable { - programs.yazi = { enable = true; enableZshIntegration = true; keymap = { manager.prepend_keymap = [ - { - on = [ "m" ]; - run = "plugin bookmarks --args=save"; - desc = "Save current position as a bookmark"; - } - { - on = [ "'" ]; - run = "plugin bookmarks --args=jump"; - desc = "Jump to a bookmark"; - } - { - on = [ "b" "d" ]; - run = "plugin bookmarks --args=delete"; - desc = "Delete a bookmark"; - } - { - on = [ "b" "D" ]; - run = "plugin bookmarks --args=delete_all"; - desc = "Delete all bookmarks"; - } + # { + # on = [ "m" ]; + # run = "plugin bookmarks --args=save"; + # desc = "Save current position as a bookmark"; + # } + # { + # on = [ "'" ]; + # run = "plugin bookmarks --args=jump"; + # desc = "Jump to a bookmark"; + # } + # { + # on = [ "b" "d" ]; + # run = "plugin bookmarks --args=delete"; + # desc = "Delete a bookmark"; + # } + # { + # on = [ "b" "D" ]; + # run = "plugin bookmarks --args=delete_all"; + # desc = "Delete all bookmarks"; + # } ]; }; settings = { @@ -80,6 +79,12 @@ in { name = "*"; use = "open"; } ]; }; + plugin = { + prepend_previewers = [ + { mime = "{image,audio,video}/*"; run = "mediainfo"; } + { mime = "application/x-subrip"; run = "mediainfo"; } + ]; + }; }; }; home.file = { @@ -92,22 +97,31 @@ in sha256 = "sha256-TSmZwy9jhf0D+6l4KbNQ6BjHbL0Vfo/yL3wt8bjo/EM="; }; }; - ".config/yazi/init.lua".text = /*lua*/ '' - require("bookmarks"):setup({ - last_directory = { enable = false, persist = false }, - persist = "none", - desc_format = "full", - notify = { - enable = false, - timeout = 1, - message = { - new = "New bookmark '' -> ''", - delete = "Deleted bookmark in ''", - delete_all = "Deleted all bookmarks", - }, - }, - }) - ''; + ".config/yazi/plugins/mediainfo.yazi" = { + recursive = true; + source = pkgs.fetchFromGitHub { + owner = "Ape"; + repo = "mediainfo.yazi"; + rev = "c69314e80f5b45fe87a0e06a10d064ed54110439"; + hash = "sha256-8xdBPdKSiwB7iRU8DJdTHY+BjfR9D3FtyVtDL9tNiy4="; + }; + }; + # ".config/yazi/init.lua".text = /*lua*/ '' + # require("bookmarks"):setup({ + # last_directory = { enable = false, persist = false }, + # persist = "none", + # desc_format = "full", + # notify = { + # enable = false, + # timeout = 1, + # message = { + # new = "New bookmark '' -> ''", + # delete = "Deleted bookmark in ''", + # delete_all = "Deleted all bookmarks", + # }, + # }, + # }) + # ''; }; }; } diff --git a/system/modules/sway.nix b/system/modules/sway.nix index a831798..b22fdc0 100644 --- a/system/modules/sway.nix +++ b/system/modules/sway.nix @@ -2,11 +2,11 @@ let dbus-sway-environment = pkgs.writeTextFile { name = "dbus-sway-environment"; - destination = "/bin/dbus-sway-enviroment"; + destination = "/bin/dbus-sway-environment"; executable = true; text = '' - dbus-update-activation-enviroment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway + dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr ''; diff --git a/system/modules/yazi.nix b/system/modules/yazi.nix index 4063eaf..142a614 100644 --- a/system/modules/yazi.nix +++ b/system/modules/yazi.nix @@ -1,10 +1,14 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: let cfg = config.profile.programs.yazi; inherit (lib) mkIf; in { config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + mediainfo + ffmpegthumbnailer + ]; programs.yazi = { enable = true; settings = { diff --git a/system/services/syncthing.nix b/system/services/syncthing.nix index b0d40f8..38895b5 100644 --- a/system/services/syncthing.nix +++ b/system/services/syncthing.nix @@ -143,6 +143,26 @@ in "living-room-system" ]; }; + "/nas/Syncthing/Sync/General" = { + label = "General"; + id = "General"; + devices = [ + "s20fe" + "work-laptop" + "windows" + "living-room-system" + ]; + }; + "/nas/Syncthing/Sync/Public" = { + label = "Public"; + id = "Public"; + devices = [ + "s20fe" + "work-laptop" + "windows" + "living-room-system" + ]; + }; }; devices = { s20fe = {