From 547bf872cbf85f4718576e1ac3a0eab094ccd26a Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Thu, 27 Nov 2025 23:17:55 +0530 Subject: Configured brave for for comfortably sized UI. Showing file previews in nnn. --- home.nix | 1 + modules/graphical/sxhkd/default.nix | 8 ++++---- modules/scripts/default.nix | 4 ++++ modules/tools/brave/default.nix | 22 ++++++++++++++++++++-- modules/tools/default.nix | 1 + modules/tools/kitty/default.nix | 4 +++- modules/tools/lsd/default.nix | 12 ++++++++++++ modules/tools/nnn/default.nix | 30 +++++++++++++++++++++++------- modules/tools/zsh/default.nix | 5 ----- 9 files changed, 68 insertions(+), 19 deletions(-) create mode 100644 modules/tools/lsd/default.nix diff --git a/home.nix b/home.nix index 76bfc6f..1e3ca50 100644 --- a/home.nix +++ b/home.nix @@ -26,6 +26,7 @@ tools.git.email = "54011232+arpitchakladar@users.noreply.github.com"; tools.htop.enable = true; tools.kitty.enable = true; + tools.lsd.enable = true; tools.neofetch.enable = true; tools.neovim.enable = true; tools.neovim.profile = "full"; diff --git a/modules/graphical/sxhkd/default.nix b/modules/graphical/sxhkd/default.nix index d19f01f..5746394 100644 --- a/modules/graphical/sxhkd/default.nix +++ b/modules/graphical/sxhkd/default.nix @@ -32,10 +32,10 @@ "Launch terminal." "kitty") - # (createKeybinding - # "f" - # "Launch File Manager." - # "kitty --title 'File Manager' --class floating-termial -e ${config.tools.file-manager.command}") + (createKeybinding + "f" + "Launch File Manager." + "kitty --title 'File Manager' --class floating-termial -e nnn") ]; }; } diff --git a/modules/scripts/default.nix b/modules/scripts/default.nix index 6e39f32..f421543 100644 --- a/modules/scripts/default.nix +++ b/modules/scripts/default.nix @@ -6,6 +6,10 @@ }; config = lib.mkIf config.scripts.enable { + home.sessionPath = [ + "${config.home.homeDirectory}/scripts" + ]; + home.file."scripts/restart-network" = { source = ./restart-network.sh; executable = true; diff --git a/modules/tools/brave/default.nix b/modules/tools/brave/default.nix index 93b4b84..3fd5f22 100644 --- a/modules/tools/brave/default.nix +++ b/modules/tools/brave/default.nix @@ -6,8 +6,26 @@ }; config = lib.mkIf config.tools.brave.enable { - home.packages = [ - pkgs.brave + home.packages = with pkgs; [ + # Modify the brave-browser.desktop entry to scale the UI + (brave.overrideAttrs (old: { + postInstall = (old.postInstall or "") + '' + sed -i 's|^Exec=\(.*brave[^\n]*\)|Exec=\1 --force-device-scale-factor=1.2|' \ + $out/share/applications/brave-browser.desktop + ''; + })) ]; + + home.sessionPath = [ + "${config.home.homeDirectory}/.local/bin" + ]; + + home.file.".local/bin/brave" = { + text = '' +#!${pkgs.bash}/bin/bash +exec ${pkgs.brave}/bin/brave --force-device-scale-factor=1.2 "$@" +''; + executable = true; + }; }; } diff --git a/modules/tools/default.nix b/modules/tools/default.nix index 2cc4330..d733a12 100644 --- a/modules/tools/default.nix +++ b/modules/tools/default.nix @@ -11,6 +11,7 @@ ./git ./htop ./kitty + ./lsd ./neofetch ./neovim ./nnn diff --git a/modules/tools/kitty/default.nix b/modules/tools/kitty/default.nix index 74b4519..a53bbb4 100644 --- a/modules/tools/kitty/default.nix +++ b/modules/tools/kitty/default.nix @@ -16,7 +16,6 @@ scrollback_indicator_opacity = "0.5"; dynamic_background_opacity = false; - allow_remote_control = false; enable_audio_bell = false; background = base00; @@ -42,6 +41,9 @@ selection_background = base03; selection_foreground = base00; + + allow_remote_control = "yes"; + listen_on = "unix:/tmp/kitty"; }; }; } diff --git a/modules/tools/lsd/default.nix b/modules/tools/lsd/default.nix new file mode 100644 index 0000000..feb1481 --- /dev/null +++ b/modules/tools/lsd/default.nix @@ -0,0 +1,12 @@ +{ config, lib, ... }: + +{ + options.tools.lsd = { + enable = lib.mkEnableOption "Enables lsd."; + }; + + config = lib.mkIf config.tools.lsd.enable { + programs.lsd.enable = true; + programs.lsd.settings.icons.separator = " "; + }; +} diff --git a/modules/tools/nnn/default.nix b/modules/tools/nnn/default.nix index 298f538..641e3a5 100644 --- a/modules/tools/nnn/default.nix +++ b/modules/tools/nnn/default.nix @@ -5,12 +5,28 @@ enable = lib.mkEnableOption "Enables nnn."; }; - config = - let - nnnWithNerdIcons = pkgs.nnn.override ({ withNerdIcons = true; }); - in lib.mkIf config.tools.nnn.enable { - programs.nnn.enable = true; - programs.nnn.package = nnnWithNerdIcons; - programs.nnn.plugins.src = "${nnnWithNerdIcons}/share/plugins"; + config = lib.mkIf config.tools.nnn.enable { + home.sessionVariables = { + # Start nnn in detail mode + show hidden items by default + NNN_OPTS = "dH"; + NNN_FIFO = "/tmp/nnn.fifo"; + }; + + programs.nnn = { + enable = true; + package = pkgs.nnn.override ({ withNerdIcons = true; }); + plugins = { + src = "${config.programs.nnn.package}/share/plugins"; + mappings = { + p = "preview-tui"; + }; + }; + extraPackages = with pkgs; [ + bat + ffmpeg + ffmpegthumbnailer + ueberzugpp + ]; + }; }; } diff --git a/modules/tools/zsh/default.nix b/modules/tools/zsh/default.nix index 0f10e72..6c1f343 100644 --- a/modules/tools/zsh/default.nix +++ b/modules/tools/zsh/default.nix @@ -14,12 +14,7 @@ ${if config.tools.fzf.enable then "eval \"$(fzf --zsh)\"" else ""} ${builtins.readFile ./zshrc} -${if config.scripts.enable then - "export PATH=${config.home.homeDirectory}/scripts:$PATH" -else ""} ''; programs.kitty.settings.shell = lib.mkIf config.tools.kitty.enable "zsh"; - programs.zsh.shellAliases."nnn" = lib.mkIf config.tools.nnn.enable "nnn -H -d"; - # programs.zsh.shellAliases."ls" = lib.mkIf config.tools.lsd.enable "lsd"; }; } -- cgit v1.2.3