update yazi

This commit is contained in:
Tigor Hutasuhut 2024-08-28 19:00:18 +07:00
parent a930955644
commit 03d35a039a
6 changed files with 90 additions and 41 deletions

View file

@ -41,6 +41,16 @@
"bind" "bind"
]; ];
}; };
fileSystems."/nas/public/Public" = {
device = "/nas/Syncthing/Sync/Public";
fsType = "auto";
options = [
"defaults"
"nofail"
"nobootwait"
"bind"
];
};
swapDevices = [ ]; swapDevices = [ ];
@ -86,6 +96,7 @@
}; };
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.enableAllFirmware = true;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;

View file

@ -227,7 +227,7 @@ in
]; ];
}; };
extraConfig = /*hyprlang*/ '' 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=${gnome-keyring.path} ${config.sops.secrets."gnome-keyring/${config.home.username}".path}
exec-once=foot --server exec-once=foot --server

View file

@ -5,32 +5,31 @@ let
in in
{ {
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.yazi = { programs.yazi = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
keymap = { keymap = {
manager.prepend_keymap = [ manager.prepend_keymap = [
{ # {
on = [ "m" ]; # on = [ "m" ];
run = "plugin bookmarks --args=save"; # run = "plugin bookmarks --args=save";
desc = "Save current position as a bookmark"; # desc = "Save current position as a bookmark";
} # }
{ # {
on = [ "'" ]; # on = [ "'" ];
run = "plugin bookmarks --args=jump"; # run = "plugin bookmarks --args=jump";
desc = "Jump to a bookmark"; # desc = "Jump to a bookmark";
} # }
{ # {
on = [ "b" "d" ]; # on = [ "b" "d" ];
run = "plugin bookmarks --args=delete"; # run = "plugin bookmarks --args=delete";
desc = "Delete a bookmark"; # desc = "Delete a bookmark";
} # }
{ # {
on = [ "b" "D" ]; # on = [ "b" "D" ];
run = "plugin bookmarks --args=delete_all"; # run = "plugin bookmarks --args=delete_all";
desc = "Delete all bookmarks"; # desc = "Delete all bookmarks";
} # }
]; ];
}; };
settings = { settings = {
@ -80,6 +79,12 @@ in
{ name = "*"; use = "open"; } { name = "*"; use = "open"; }
]; ];
}; };
plugin = {
prepend_previewers = [
{ mime = "{image,audio,video}/*"; run = "mediainfo"; }
{ mime = "application/x-subrip"; run = "mediainfo"; }
];
};
}; };
}; };
home.file = { home.file = {
@ -92,22 +97,31 @@ in
sha256 = "sha256-TSmZwy9jhf0D+6l4KbNQ6BjHbL0Vfo/yL3wt8bjo/EM="; sha256 = "sha256-TSmZwy9jhf0D+6l4KbNQ6BjHbL0Vfo/yL3wt8bjo/EM=";
}; };
}; };
".config/yazi/init.lua".text = /*lua*/ '' ".config/yazi/plugins/mediainfo.yazi" = {
require("bookmarks"):setup({ recursive = true;
last_directory = { enable = false, persist = false }, source = pkgs.fetchFromGitHub {
persist = "none", owner = "Ape";
desc_format = "full", repo = "mediainfo.yazi";
notify = { rev = "c69314e80f5b45fe87a0e06a10d064ed54110439";
enable = false, hash = "sha256-8xdBPdKSiwB7iRU8DJdTHY+BjfR9D3FtyVtDL9tNiy4=";
timeout = 1, };
message = { };
new = "New bookmark '<key>' -> '<folder>'", # ".config/yazi/init.lua".text = /*lua*/ ''
delete = "Deleted bookmark in '<key>'", # require("bookmarks"):setup({
delete_all = "Deleted all bookmarks", # last_directory = { enable = false, persist = false },
}, # persist = "none",
}, # desc_format = "full",
}) # notify = {
''; # enable = false,
# timeout = 1,
# message = {
# new = "New bookmark '<key>' -> '<folder>'",
# delete = "Deleted bookmark in '<key>'",
# delete_all = "Deleted all bookmarks",
# },
# },
# })
# '';
}; };
}; };
} }

View file

@ -2,11 +2,11 @@
let let
dbus-sway-environment = pkgs.writeTextFile { dbus-sway-environment = pkgs.writeTextFile {
name = "dbus-sway-environment"; name = "dbus-sway-environment";
destination = "/bin/dbus-sway-enviroment"; destination = "/bin/dbus-sway-environment";
executable = true; executable = true;
text = '' 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 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 systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
''; '';

View file

@ -1,10 +1,14 @@
{ config, lib, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.profile.programs.yazi; cfg = config.profile.programs.yazi;
inherit (lib) mkIf; inherit (lib) mkIf;
in in
{ {
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
mediainfo
ffmpegthumbnailer
];
programs.yazi = { programs.yazi = {
enable = true; enable = true;
settings = { settings = {

View file

@ -143,6 +143,26 @@ in
"living-room-system" "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 = { devices = {
s20fe = { s20fe = {