From 085ff668ab45ac8d57c093e502b1175a86f2c14e Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Thu, 10 Jul 2025 01:29:48 +0530 Subject: Removed unnecessary packages. --- modules/default.nix | 11 +- modules/desktop/application-launcher/default.nix | 23 -- .../desktop/application-launcher/fzf/default.nix | 22 -- modules/desktop/application-launcher/fzf/launch.sh | 28 -- .../desktop/application-launcher/rofi/default.nix | 21 -- .../application-launcher/rofi/theme.mustache.rasi | 82 ----- modules/desktop/default.nix | 11 - .../desktop/display-server/compositor/default.nix | 7 - .../display-server/compositor/picom/default.nix | 24 -- modules/desktop/display-server/default.nix | 8 - modules/desktop/display-server/x11/default.nix | 8 - .../desktop/display-server/x11/xclip/default.nix | 13 - .../desktop/display-server/x11/xinit/default.nix | 26 -- modules/desktop/status-bar/default.nix | 7 - modules/desktop/status-bar/polybar/bar/default.nix | 5 - modules/desktop/status-bar/polybar/bar/main.nix | 46 --- modules/desktop/status-bar/polybar/default.nix | 34 --- .../desktop/status-bar/polybar/module/battery.nix | 36 --- .../desktop/status-bar/polybar/module/bspwm.nix | 21 -- modules/desktop/status-bar/polybar/module/cpu.nix | 9 - modules/desktop/status-bar/polybar/module/date.nix | 10 - .../desktop/status-bar/polybar/module/default.nix | 20 -- modules/desktop/status-bar/polybar/module/i3.nix | 23 -- .../status-bar/polybar/module/kernel-version.nix | 10 - .../desktop/status-bar/polybar/module/memory.nix | 9 - .../status-bar/polybar/module/separator.nix | 7 - modules/desktop/status-bar/polybar/module/time.nix | 10 - .../desktop/status-bar/polybar/module/xwindow.nix | 7 - modules/desktop/window-manager/bspwm/bspwmrc | 3 - modules/desktop/window-manager/bspwm/default.nix | 54 ---- modules/desktop/window-manager/default.nix | 30 -- modules/desktop/window-manager/i3/default.nix | 38 --- modules/desktop/window-manager/sxhkd/default.nix | 46 --- .../window-manager/sxhkd/keybindings/bspwm.nix | 45 --- .../window-manager/sxhkd/scripts/keybindings.sh | 77 ----- modules/desktop/xdg/default.nix | 24 -- modules/scripts/default.nix | 10 +- modules/scripts/restart-network.sh | 3 + modules/scripts/scripts/restart-network.sh | 3 - modules/shell/bash/default.nix | 36 --- modules/shell/default.nix | 28 -- modules/shell/zsh/default.nix | 29 -- modules/shell/zsh/zshrc | 23 -- modules/tools/bat/default.nix | 22 ++ modules/tools/bat/theme.mustache.tmTheme | 120 ++++++++ modules/tools/default.nix | 15 +- modules/tools/editor/default.nix | 7 - modules/tools/editor/neovim/config/default.nix | 4 - modules/tools/editor/neovim/config/keybindings.lua | 5 - modules/tools/editor/neovim/config/options.lua | 41 --- modules/tools/editor/neovim/default.nix | 36 --- .../neovim/plugins/config/base16.mustache.lua | 12 - .../tools/editor/neovim/plugins/config/comment.lua | 1 - .../tools/editor/neovim/plugins/config/default.nix | 27 -- .../editor/neovim/plugins/config/dressing.lua | 1 - .../editor/neovim/plugins/config/lsp-config.lua | 75 ----- .../neovim/plugins/config/lualine.mustache.lua | 61 ---- .../neovim/plugins/config/noice.mustache.lua | 10 - .../editor/neovim/plugins/config/nvim-tree.lua | 15 - .../editor/neovim/plugins/config/nvim-ufo.lua | 21 -- .../editor/neovim/plugins/config/treesitter.nix | 13 - .../editor/neovim/plugins/config/which-key.lua | 5 - modules/tools/editor/neovim/plugins/default.nix | 31 -- modules/tools/feh/default.nix | 11 + modules/tools/file-manager/default.nix | 24 -- modules/tools/file-manager/lf/default.nix | 32 -- modules/tools/file-manager/lf/icons | 334 --------------------- modules/tools/file-manager/lsd/default.nix | 13 - modules/tools/file-manager/nnn/default.nix | 23 -- modules/tools/fzf/default.nix | 42 +++ modules/tools/htop/default.nix | 12 + modules/tools/kitty/default.nix | 47 +++ modules/tools/lsd/default.nix | 12 + modules/tools/neovim/config/default.nix | 4 + modules/tools/neovim/config/keybindings.lua | 5 + modules/tools/neovim/config/options.lua | 41 +++ modules/tools/neovim/default.nix | 36 +++ .../neovim/plugins/config/base16.mustache.lua | 12 + modules/tools/neovim/plugins/config/comment.lua | 1 + modules/tools/neovim/plugins/config/default.nix | 27 ++ modules/tools/neovim/plugins/config/dressing.lua | 1 + modules/tools/neovim/plugins/config/lsp-config.lua | 75 +++++ .../neovim/plugins/config/lualine.mustache.lua | 61 ++++ .../tools/neovim/plugins/config/noice.mustache.lua | 10 + modules/tools/neovim/plugins/config/nvim-tree.lua | 15 + modules/tools/neovim/plugins/config/nvim-ufo.lua | 21 ++ modules/tools/neovim/plugins/config/treesitter.nix | 13 + modules/tools/neovim/plugins/config/which-key.lua | 5 + modules/tools/neovim/plugins/default.nix | 31 ++ modules/tools/nnn/default.nix | 16 + modules/tools/system-monitor/default.nix | 7 - modules/tools/system-monitor/htop/default.nix | 12 - modules/tools/terminal/alacritty/default.nix | 83 ----- modules/tools/terminal/default.nix | 24 -- modules/tools/terminal/kitty/default.nix | 55 ---- modules/tools/terminal/tmux/default.nix | 11 - modules/tools/utils/default.nix | 7 - modules/tools/utils/fzf/default.nix | 42 --- modules/tools/viewer/bat/default.nix | 22 -- modules/tools/viewer/bat/theme.mustache.tmTheme | 120 -------- modules/tools/viewer/default.nix | 8 - modules/tools/viewer/feh/default.nix | 11 - modules/tools/zsh/default.nix | 25 ++ modules/tools/zsh/zshrc | 23 ++ 104 files changed, 702 insertions(+), 2181 deletions(-) delete mode 100644 modules/desktop/application-launcher/default.nix delete mode 100644 modules/desktop/application-launcher/fzf/default.nix delete mode 100644 modules/desktop/application-launcher/fzf/launch.sh delete mode 100644 modules/desktop/application-launcher/rofi/default.nix delete mode 100644 modules/desktop/application-launcher/rofi/theme.mustache.rasi delete mode 100644 modules/desktop/default.nix delete mode 100644 modules/desktop/display-server/compositor/default.nix delete mode 100644 modules/desktop/display-server/compositor/picom/default.nix delete mode 100644 modules/desktop/display-server/default.nix delete mode 100644 modules/desktop/display-server/x11/default.nix delete mode 100644 modules/desktop/display-server/x11/xclip/default.nix delete mode 100644 modules/desktop/display-server/x11/xinit/default.nix delete mode 100644 modules/desktop/status-bar/default.nix delete mode 100644 modules/desktop/status-bar/polybar/bar/default.nix delete mode 100644 modules/desktop/status-bar/polybar/bar/main.nix delete mode 100644 modules/desktop/status-bar/polybar/default.nix delete mode 100644 modules/desktop/status-bar/polybar/module/battery.nix delete mode 100644 modules/desktop/status-bar/polybar/module/bspwm.nix delete mode 100644 modules/desktop/status-bar/polybar/module/cpu.nix delete mode 100644 modules/desktop/status-bar/polybar/module/date.nix delete mode 100644 modules/desktop/status-bar/polybar/module/default.nix delete mode 100644 modules/desktop/status-bar/polybar/module/i3.nix delete mode 100644 modules/desktop/status-bar/polybar/module/kernel-version.nix delete mode 100644 modules/desktop/status-bar/polybar/module/memory.nix delete mode 100644 modules/desktop/status-bar/polybar/module/separator.nix delete mode 100644 modules/desktop/status-bar/polybar/module/time.nix delete mode 100644 modules/desktop/status-bar/polybar/module/xwindow.nix delete mode 100644 modules/desktop/window-manager/bspwm/bspwmrc delete mode 100644 modules/desktop/window-manager/bspwm/default.nix delete mode 100644 modules/desktop/window-manager/default.nix delete mode 100644 modules/desktop/window-manager/i3/default.nix delete mode 100644 modules/desktop/window-manager/sxhkd/default.nix delete mode 100644 modules/desktop/window-manager/sxhkd/keybindings/bspwm.nix delete mode 100755 modules/desktop/window-manager/sxhkd/scripts/keybindings.sh delete mode 100644 modules/desktop/xdg/default.nix create mode 100644 modules/scripts/restart-network.sh delete mode 100644 modules/scripts/scripts/restart-network.sh delete mode 100644 modules/shell/bash/default.nix delete mode 100644 modules/shell/default.nix delete mode 100644 modules/shell/zsh/default.nix delete mode 100644 modules/shell/zsh/zshrc create mode 100644 modules/tools/bat/default.nix create mode 100644 modules/tools/bat/theme.mustache.tmTheme delete mode 100644 modules/tools/editor/default.nix delete mode 100644 modules/tools/editor/neovim/config/default.nix delete mode 100644 modules/tools/editor/neovim/config/keybindings.lua delete mode 100644 modules/tools/editor/neovim/config/options.lua delete mode 100644 modules/tools/editor/neovim/default.nix delete mode 100644 modules/tools/editor/neovim/plugins/config/base16.mustache.lua delete mode 100644 modules/tools/editor/neovim/plugins/config/comment.lua delete mode 100644 modules/tools/editor/neovim/plugins/config/default.nix delete mode 100644 modules/tools/editor/neovim/plugins/config/dressing.lua delete mode 100644 modules/tools/editor/neovim/plugins/config/lsp-config.lua delete mode 100644 modules/tools/editor/neovim/plugins/config/lualine.mustache.lua delete mode 100644 modules/tools/editor/neovim/plugins/config/noice.mustache.lua delete mode 100644 modules/tools/editor/neovim/plugins/config/nvim-tree.lua delete mode 100644 modules/tools/editor/neovim/plugins/config/nvim-ufo.lua delete mode 100644 modules/tools/editor/neovim/plugins/config/treesitter.nix delete mode 100644 modules/tools/editor/neovim/plugins/config/which-key.lua delete mode 100644 modules/tools/editor/neovim/plugins/default.nix create mode 100644 modules/tools/feh/default.nix delete mode 100644 modules/tools/file-manager/default.nix delete mode 100644 modules/tools/file-manager/lf/default.nix delete mode 100644 modules/tools/file-manager/lf/icons delete mode 100644 modules/tools/file-manager/lsd/default.nix delete mode 100644 modules/tools/file-manager/nnn/default.nix create mode 100644 modules/tools/fzf/default.nix create mode 100644 modules/tools/htop/default.nix create mode 100644 modules/tools/kitty/default.nix create mode 100644 modules/tools/lsd/default.nix create mode 100644 modules/tools/neovim/config/default.nix create mode 100644 modules/tools/neovim/config/keybindings.lua create mode 100644 modules/tools/neovim/config/options.lua create mode 100644 modules/tools/neovim/default.nix create mode 100644 modules/tools/neovim/plugins/config/base16.mustache.lua create mode 100644 modules/tools/neovim/plugins/config/comment.lua create mode 100644 modules/tools/neovim/plugins/config/default.nix create mode 100644 modules/tools/neovim/plugins/config/dressing.lua create mode 100644 modules/tools/neovim/plugins/config/lsp-config.lua create mode 100644 modules/tools/neovim/plugins/config/lualine.mustache.lua create mode 100644 modules/tools/neovim/plugins/config/noice.mustache.lua create mode 100644 modules/tools/neovim/plugins/config/nvim-tree.lua create mode 100644 modules/tools/neovim/plugins/config/nvim-ufo.lua create mode 100644 modules/tools/neovim/plugins/config/treesitter.nix create mode 100644 modules/tools/neovim/plugins/config/which-key.lua create mode 100644 modules/tools/neovim/plugins/default.nix create mode 100644 modules/tools/nnn/default.nix delete mode 100644 modules/tools/system-monitor/default.nix delete mode 100644 modules/tools/system-monitor/htop/default.nix delete mode 100644 modules/tools/terminal/alacritty/default.nix delete mode 100644 modules/tools/terminal/default.nix delete mode 100644 modules/tools/terminal/kitty/default.nix delete mode 100644 modules/tools/terminal/tmux/default.nix delete mode 100644 modules/tools/utils/default.nix delete mode 100644 modules/tools/utils/fzf/default.nix delete mode 100644 modules/tools/viewer/bat/default.nix delete mode 100644 modules/tools/viewer/bat/theme.mustache.tmTheme delete mode 100644 modules/tools/viewer/default.nix delete mode 100644 modules/tools/viewer/feh/default.nix create mode 100644 modules/tools/zsh/default.nix create mode 100644 modules/tools/zsh/zshrc (limited to 'modules') diff --git a/modules/default.nix b/modules/default.nix index 5e01083..13ba2b9 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,18 +1,9 @@ -{ lib, ... }: +{ ... }: { imports = [ - ./desktop ./fonts ./scripts - ./shell ./tools ]; - - options = { - baseDirectory = lib.mkOption { - type = lib.types.str; - description = "Path to the base of the current home manager configuration."; - }; - }; } diff --git a/modules/desktop/application-launcher/default.nix b/modules/desktop/application-launcher/default.nix deleted file mode 100644 index 012deb5..0000000 --- a/modules/desktop/application-launcher/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ lib, ... }: - -{ - imports = [ - ./fzf - ./rofi - ]; - - options.desktop.application-launcher = { - default = lib.mkOption { - type = lib.types.enum [ - "fzf" - "rofi" - ]; - description = "Select the default application launcher."; - }; - - command = lib.mkOption { - type = lib.types.str; - description = "Command for default application launcher program."; - }; - }; -} diff --git a/modules/desktop/application-launcher/fzf/default.nix b/modules/desktop/application-launcher/fzf/default.nix deleted file mode 100644 index a7d12d3..0000000 --- a/modules/desktop/application-launcher/fzf/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - options.desktop.application-launcher.fzf = { - enable = lib.mkEnableOption "Enables fzf to be used as a application launcher."; - }; - - config = lib.mkIf config.desktop.application-launcher.fzf.enable { - assertions = [ - { - assertion = config.tools.utils.fzf.enable; - message ="Module desktop.application-launcher.fzf requires tools.utils.fzf module to be enabled."; - } - ]; - - desktop.application-launcher.default = lib.mkDefault "fzf"; - desktop.application-launcher.command = - lib.mkIf - (config.desktop.application-launcher.default == "fzf") - "${config.tools.terminal.command} --title 'Application Launcher' --class floating-termial -e ${(pkgs.writeShellScript "fzf-launch.sh" (builtins.readFile ./launch.sh))}"; - }; -} diff --git a/modules/desktop/application-launcher/fzf/launch.sh b/modules/desktop/application-launcher/fzf/launch.sh deleted file mode 100644 index 53987f6..0000000 --- a/modules/desktop/application-launcher/fzf/launch.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -# Function to get executables from PATH and display them with Nerd Font icons -get_executables() { - for dir in $(echo "$PATH" | tr ':' ' '); do - [ -d "$dir" ] && ls "$dir" 2>/dev/null | awk -F/ '{print "\033[31m \033[0m " $NF}' - done | sort -u -} - -# Function to run fzf and select an executable -select_executable() { - fzf --ansi --height=100% --border=none --layout=reverse --no-multi --prompt " " -} - -# Function to remove ANSI codes and icons from the selected executable -clean_selection() { - sed 's/\x1B\[[0-9;]*m//g' | awk '{$1=""; print $0}' | sed 's/^ //' -} - -# Main script execution -selected_executable=$(get_executables | select_executable | clean_selection) - -# If an executable is selected, run it -if [ -n "$selected_executable" ]; then - setsid "$selected_executable" >/dev/null 2>&1 & - sleep 0.01 - kill -9 $PPID -fi diff --git a/modules/desktop/application-launcher/rofi/default.nix b/modules/desktop/application-launcher/rofi/default.nix deleted file mode 100644 index bfdd617..0000000 --- a/modules/desktop/application-launcher/rofi/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - options.desktop.application-launcher.rofi = { - enable = lib.mkEnableOption "Enables rofi."; - }; - - config = lib.mkIf config.desktop.application-launcher.rofi.enable { - desktop.application-launcher.default = lib.mkDefault "rofi"; - desktop.application-launcher.command = - lib.mkIf - (config.desktop.application-launcher.default == "rofi") - "${pkgs.rofi}/bin/rofi -show run"; - - programs.rofi.enable = true; - programs.rofi.font = "${config.fonts.normal} ${toString config.fonts.size}"; - programs.rofi.theme = config.scheme { - template = builtins.readFile ./theme.mustache.rasi; - }; - }; -} diff --git a/modules/desktop/application-launcher/rofi/theme.mustache.rasi b/modules/desktop/application-launcher/rofi/theme.mustache.rasi deleted file mode 100644 index 02cdaf3..0000000 --- a/modules/desktop/application-launcher/rofi/theme.mustache.rasi +++ /dev/null @@ -1,82 +0,0 @@ -configuration { - drun { - display-name: " "; - } - - run { - display-name: " "; - } - - window { - display-name: " "; - } - - ssh { - display-name: " "; - } - - timeout { - delay: 10; - action: "kb-cancel"; - } -} - -* { - border: 1; - margin: 0; - padding: 0; - spacing: 0; - - bg: #{{base00-hex}}; - bg-alt: #{{base01-hex}}; - fg: #{{base07-hex}}; - fg-alt: #{{base03-hex}}; - - background-color: @bg; - text-color: @fg; -} - -window { - transparency: "real"; - border-color: #{{base03-hex}}; -} - -mainbox { - children: [inputbar, listview]; -} - -inputbar { - background-color: @bg-alt; - children: [prompt, entry]; -} - -entry { - background-color: inherit; - padding: 12px 3px; -} - -prompt { - background-color: inherit; - padding: 12px; -} - -listview { - lines: 8; -} - -element { - children: [element-text]; -} - -element-icon { - padding: 10px 10px; -} - -element-text { - padding: 10px 10px; - text-color: @fg-alt; -} - -element-text selected { - text-color: @fg; -} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix deleted file mode 100644 index edb8959..0000000 --- a/modules/desktop/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: - -{ - imports = [ - ./application-launcher - ./display-server - ./status-bar - ./window-manager - ./xdg - ]; -} diff --git a/modules/desktop/display-server/compositor/default.nix b/modules/desktop/display-server/compositor/default.nix deleted file mode 100644 index ae5fc6d..0000000 --- a/modules/desktop/display-server/compositor/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - imports = [ - ./picom - ]; -} diff --git a/modules/desktop/display-server/compositor/picom/default.nix b/modules/desktop/display-server/compositor/picom/default.nix deleted file mode 100644 index 750fd1e..0000000 --- a/modules/desktop/display-server/compositor/picom/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ lib, config, ... }: - -{ - options.desktop.display-server.compositor.picom = { - enable = lib.mkEnableOption "Enables picom."; - }; - - config = lib.mkIf config.desktop.display-server.compositor.picom.enable { - services.picom.enable = true; - services.picom.backend = "xrender"; - services.picom.fade = false; - services.picom.shadow = false; - services.picom.settings = { - blur-background = false; - background = "#000000"; - transparent-clipping = true; - }; - services.picom.activeOpacity = 0.8; - services.picom.inactiveOpacity = 0.8; - services.picom.opacityRules = [ - "100:class_g = 'Polybar'" # 70% opacity for Polybar - ]; - }; -} diff --git a/modules/desktop/display-server/default.nix b/modules/desktop/display-server/default.nix deleted file mode 100644 index 5062f7c..0000000 --- a/modules/desktop/display-server/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: - -{ - imports = [ - ./compositor - ./x11 - ]; -} diff --git a/modules/desktop/display-server/x11/default.nix b/modules/desktop/display-server/x11/default.nix deleted file mode 100644 index f1fd52a..0000000 --- a/modules/desktop/display-server/x11/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: - -{ - imports = [ - ./xclip - ./xinit - ]; -} diff --git a/modules/desktop/display-server/x11/xclip/default.nix b/modules/desktop/display-server/x11/xclip/default.nix deleted file mode 100644 index 7c97d60..0000000 --- a/modules/desktop/display-server/x11/xclip/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ lib, config, pkgs, ... }: - -{ - options.desktop.display-server.x11.xclip = { - enable = lib.mkEnableOption "Enables xclip."; - }; - - config = lib.mkIf config.desktop.display-server.x11.xclip.enable { - home.packages = with pkgs; [ - xclip - ]; - }; -} diff --git a/modules/desktop/display-server/x11/xinit/default.nix b/modules/desktop/display-server/x11/xinit/default.nix deleted file mode 100644 index 6e82e2c..0000000 --- a/modules/desktop/display-server/x11/xinit/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ lib, config, pkgs, ... }: - -{ - options.desktop.display-server.x11.xinit = { - enable = lib.mkEnableOption "Enables xinit."; - }; - - config = lib.mkIf config.desktop.display-server.x11.xinit.enable { - home.file.".xinitrc" = { - executable = true; - - source = pkgs.writeText ".xinitrc" -'' -#!/bin/sh -${if config.tools.viewer.feh.enable then - "feh --bg-scale ${../../../../../assets/skeleton-mage.png}" -else "xsetroot -solid \"${config.scheme.withHashtag.base00}\""} -${if config.desktop.status-bar.polybar.enable then - config.desktop.status-bar.polybar.command -else ""} -${if config.desktop.window-manager.sxhkd.enable then "sxhkd &" else ""} -exec ${config.desktop.window-manager.command} -''; - }; - }; -} diff --git a/modules/desktop/status-bar/default.nix b/modules/desktop/status-bar/default.nix deleted file mode 100644 index 45cb3a0..0000000 --- a/modules/desktop/status-bar/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - imports = [ - ./polybar - ]; -} diff --git a/modules/desktop/status-bar/polybar/bar/default.nix b/modules/desktop/status-bar/polybar/bar/default.nix deleted file mode 100644 index 23a43c4..0000000 --- a/modules/desktop/status-bar/polybar/bar/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, lib }: - -{ - "bar/main" = import ./main.nix { inherit config lib; }; -} diff --git a/modules/desktop/status-bar/polybar/bar/main.nix b/modules/desktop/status-bar/polybar/bar/main.nix deleted file mode 100644 index a389b8c..0000000 --- a/modules/desktop/status-bar/polybar/bar/main.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ config, lib }: - -with config.scheme.withHashtag; -let - largerFontSize = toString (builtins.ceil (config.fonts.size * 9.0 / 8.0)); -in { - width = "\${env:POLYBAR_WIDTH}"; - fixed-center = false; - height = 35; - - border-top-size = 1; - border-bottom-size = 1; - border-left-size = 1; - border-right-size = 1; - border-color = base03; - - background = base00; - foreground = base05; - - line-size = 3; - line-color = base08; - - padding-left = 1; - padding-right = 1; - - module-margin-left = 1; - module-margin-right = 1; - - separator = "%{F${base03}}%{T3}│%{T-}%{F-}"; - - offset-x = "\${env:POLYBAR_OFFSET}"; - offset-y = "\${env:POLYBAR_OFFSET}"; - - font-0 = "${config.fonts.normal}:pixelsize=${toString config.fonts.size};3"; - font-1 = "${config.fonts.normal}:weight=Bold:pixelsize=${largerFontSize};3"; - font-2 = "${config.fonts.normal}:style=Light:pixelsize=${largerFontSize};2"; - - modules-left = - if config.desktop.window-manager.bspwm.enable then - "bspwm separator" - else if config.desktop.window-manager.i3.enable then - "i3 separator" - else ""; - modules-center = "xwindow"; - modules-right = "separator memory cpu battery time date kernel-version"; -} diff --git a/modules/desktop/status-bar/polybar/default.nix b/modules/desktop/status-bar/polybar/default.nix deleted file mode 100644 index 76901f6..0000000 --- a/modules/desktop/status-bar/polybar/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - polybarPackage = pkgs.polybar.override { - i3Support = config.desktop.window-manager.i3.enable; - }; -in -{ - options.desktop.status-bar.polybar = { - enable = lib.mkEnableOption "Enables polybar."; - command = lib.mkOption { - type = lib.types.str; - description = "Command to run polybar."; - # This command calculates the width of the polybar to create those gaps - default = toString (pkgs.writeShellScript "polybar-run.sh" '' -#!/bin/sh - -MONITOR_WIDTH=$(xrandr | grep '*' | awk '{print $1}' | cut -d'x' -f1 | head -n1) -OFFSET=${toString config.desktop.window-manager.gap} -POLYBAR_WIDTH=$((MONITOR_WIDTH - 2 * OFFSET)) POLYBAR_OFFSET=$OFFSET ${polybarPackage}/bin/polybar main & -''); - }; - }; - - config = lib.mkIf config.desktop.status-bar.polybar.enable { - services.polybar.enable = true; - services.polybar.script = config.desktop.status-bar.polybar.command; - services.polybar.package = polybarPackage; - services.polybar.config = lib.mkMerge [ - (import ./bar { inherit config lib; }) - (import ./module { inherit config lib; }) - ]; - }; -} diff --git a/modules/desktop/status-bar/polybar/module/battery.nix b/modules/desktop/status-bar/polybar/module/battery.nix deleted file mode 100644 index 6e25e99..0000000 --- a/modules/desktop/status-bar/polybar/module/battery.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ config }: - -with config.scheme.withHashtag; -{ - type = "internal/battery"; - battery = "BAT0"; - adapter = "ADP1"; - - format-charging = "%{T2}%{F${base03}}%{F-}%{T-} "; - format-discharging = "%{T2}%{F${base03}}%{F-}%{T-} "; - format-full-prefix = "󰁹 "; - - ramp-capacity-0 = "󰁺"; - ramp-capacity-1 = "󰁻"; - ramp-capacity-2 = "󰁼"; - ramp-capacity-3 = "󰁽"; - ramp-capacity-4 = "󰁾"; - ramp-capacity-5 = "󰁿"; - ramp-capacity-6 = "󰂀"; - ramp-capacity-7 = "󰂁"; - ramp-capacity-8 = "󰂂"; - ramp-capacity-9 = "󰁹"; - - animation-charging-0 = "󰁺"; - animation-charging-1 = "󰁻"; - animation-charging-2 = "󰁼"; - animation-charging-3 = "󰁽"; - animation-charging-4 = "󰁾"; - animation-charging-5 = "󰁿"; - animation-charging-6 = "󰂀"; - animation-charging-7 = "󰂁"; - animation-charging-8 = "󰂂"; - animation-charging-9 = "󰁹"; - - animation-charging-framerate = 750; -} diff --git a/modules/desktop/status-bar/polybar/module/bspwm.nix b/modules/desktop/status-bar/polybar/module/bspwm.nix deleted file mode 100644 index ed82946..0000000 --- a/modules/desktop/status-bar/polybar/module/bspwm.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config }: - -with config.scheme.withHashtag; -{ - type = "internal/bspwm"; - - label-focused = "%index%"; - label-focused-underline = "${base0D}"; - label-focused-padding = 2; - - label-occupied = "%index%"; - label-occupied-padding = 2; - - label-urgent = "%index%"; - label-urgent-underline = "${base08}"; - label-urgent-padding = 2; - - label-empty = "%index%"; - label-empty-foreground = "${base03}"; - label-empty-padding = 2; -} diff --git a/modules/desktop/status-bar/polybar/module/cpu.nix b/modules/desktop/status-bar/polybar/module/cpu.nix deleted file mode 100644 index d37b5cc..0000000 --- a/modules/desktop/status-bar/polybar/module/cpu.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config }: - -with config.scheme.withHashtag; -{ - type = "internal/cpu"; - interval = 2; - format-prefix = "%{T2}%{F${base03}} %{F-}%{T-}"; - label = "%percentage%%"; -} diff --git a/modules/desktop/status-bar/polybar/module/date.nix b/modules/desktop/status-bar/polybar/module/date.nix deleted file mode 100644 index 56e2fa6..0000000 --- a/modules/desktop/status-bar/polybar/module/date.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config }: - -with config.scheme.withHashtag; -{ - type = "internal/date"; - interval = 60; - date = "%d/%m/%Y"; - label = "%date%"; - format-prefix = "%{T2}%{F${base03}} %{F-}%{T-}"; -} diff --git a/modules/desktop/status-bar/polybar/module/default.nix b/modules/desktop/status-bar/polybar/module/default.nix deleted file mode 100644 index 5507569..0000000 --- a/modules/desktop/status-bar/polybar/module/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, lib }: - -{ - "module/separator" = import ./separator.nix { inherit config; }; - "module/xwindow" = import ./xwindow.nix { inherit config; }; - "module/bspwm" = - lib.mkIf - config.desktop.window-manager.bspwm.enable - (import ./bspwm.nix { inherit config; }); - "module/i3" = - lib.mkIf - config.desktop.window-manager.i3.enable - (import ./i3.nix { inherit config; }); - "module/cpu" = import ./cpu.nix { inherit config; }; - "module/memory" = import ./memory.nix { inherit config; }; - "module/date" = import ./date.nix { inherit config; }; - "module/time" = import ./time.nix { inherit config; }; - "module/battery" = import ./battery.nix { inherit config; }; - "module/kernel-version" = import ./kernel-version.nix { inherit config; }; -} diff --git a/modules/desktop/status-bar/polybar/module/i3.nix b/modules/desktop/status-bar/polybar/module/i3.nix deleted file mode 100644 index 46595cd..0000000 --- a/modules/desktop/status-bar/polybar/module/i3.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ config }: - -with config.scheme.withHashtag; -{ - type = "internal/i3"; - - pin-workspaces = true; - - label-focused = "%index%"; - label-focused-underline = "${base0D}"; - label-focused-padding = 2; - - label-occupied = "%index%"; - label-occupied-padding = 2; - - label-urgent = "%index%"; - label-urgent-underline = "${base08}"; - label-urgent-padding = 2; - - label-empty = "%index%"; - label-empty-foreground = "${base03}"; - label-empty-padding = 2; -} diff --git a/modules/desktop/status-bar/polybar/module/kernel-version.nix b/modules/desktop/status-bar/polybar/module/kernel-version.nix deleted file mode 100644 index 8f94e37..0000000 --- a/modules/desktop/status-bar/polybar/module/kernel-version.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config }: - -with config.scheme.withHashtag; -{ - type = "custom/script"; - exec = "uname -r"; - interval = 1024; - format-prefix = "%{T2}%{F${base03}} %{F-}%{T-}"; - label = "%output%"; -} diff --git a/modules/desktop/status-bar/polybar/module/memory.nix b/modules/desktop/status-bar/polybar/module/memory.nix deleted file mode 100644 index 79033f1..0000000 --- a/modules/desktop/status-bar/polybar/module/memory.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config }: - -with config.scheme.withHashtag; -{ - type = "internal/memory"; - interval = 2; - format-prefix = "%{T2}%{F${base03}} %{F-}%{T-}"; - label = "%percentage_used%%"; -} diff --git a/modules/desktop/status-bar/polybar/module/separator.nix b/modules/desktop/status-bar/polybar/module/separator.nix deleted file mode 100644 index 3cd1430..0000000 --- a/modules/desktop/status-bar/polybar/module/separator.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config }: - -with config.scheme.withHashtag; -{ - type = "custom/text"; - label = " "; -} diff --git a/modules/desktop/status-bar/polybar/module/time.nix b/modules/desktop/status-bar/polybar/module/time.nix deleted file mode 100644 index b8ea545..0000000 --- a/modules/desktop/status-bar/polybar/module/time.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config }: - -with config.scheme.withHashtag; -{ - type = "internal/date"; - interval = 30; - time = "%H:%M"; - label = "%time%"; - format-prefix = "%{T2}%{F${base03}} %{F-}%{T-}"; -} diff --git a/modules/desktop/status-bar/polybar/module/xwindow.nix b/modules/desktop/status-bar/polybar/module/xwindow.nix deleted file mode 100644 index 833899e..0000000 --- a/modules/desktop/status-bar/polybar/module/xwindow.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config }: - -with config.scheme.withHashtag; -{ - type = "internal/xwindow"; - label = "%title:0:30:...%"; -} diff --git a/modules/desktop/window-manager/bspwm/bspwmrc b/modules/desktop/window-manager/bspwm/bspwmrc deleted file mode 100644 index 8a3a35a..0000000 --- a/modules/desktop/window-manager/bspwm/bspwmrc +++ /dev/null @@ -1,3 +0,0 @@ -for monitor in $(xrandr -q | grep -w 'connected' | cut -d' ' -f1); do - bspc monitor "$monitor" -d '1' '2' '3' '4' '5' '6' -done diff --git a/modules/desktop/window-manager/bspwm/default.nix b/modules/desktop/window-manager/bspwm/default.nix deleted file mode 100644 index e275135..0000000 --- a/modules/desktop/window-manager/bspwm/default.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - options.desktop.window-manager.bspwm = { - enable = lib.mkEnableOption "Enables bspwm."; - }; - - config = lib.mkIf config.desktop.window-manager.bspwm.enable { - assertions = [ - { - assertion = config.desktop.window-manager.sxhkd.enable; - message ="Module desktop.window-manager.bspwm requires desktop.window-manager.sxhkd module to be enabled."; - } - ]; - - desktop.window-manager.default = lib.mkDefault "bspwm"; - desktop.window-manager.command = - if config.desktop.window-manager.default == "bspwm" then - "${pkgs.bspwm}/bin/bspwm" - else lib.mkDefault ""; - - xsession.windowManager.bspwm.enable = true; - - xsession.windowManager.bspwm.settings = with config.scheme.withHashtag; { - window_gap = config.desktop.window-manager.gap; - split_ratio = 0.5; - single_monocle = true; - borderless_monocle = false; - gapless_monocle = false; - focus_follows_pointer = true; - pointer_follows_focus = false; - pointer_motion_interval = 40; - pointer_modifier = "mod1"; # alt key - pointer_action1 = "resize_side"; - pointer_action2 = "move"; - pointer_action3 = "resize_corner"; - normal_border_color = base02; - active_border_color = base02; - focused_border_color = base03; - }; - - xsession.windowManager.bspwm.rules = { - "floating-termial" = { - state = "floating"; - sticky = true; - rectangle = "1000x600+0+0"; - center = true; - follow = true; - }; - }; - - xsession.windowManager.bspwm.extraConfig = builtins.readFile ./bspwmrc; - }; -} diff --git a/modules/desktop/window-manager/default.nix b/modules/desktop/window-manager/default.nix deleted file mode 100644 index 2f36bce..0000000 --- a/modules/desktop/window-manager/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ lib, ... }: - -{ - imports = [ - ./bspwm - ./i3 - ./sxhkd - ]; - - options.desktop.window-manager = { - default = lib.mkOption { - type = lib.types.enum [ - "bspwm" - "i3" - ]; - description = "Default window manager."; - }; - - command = lib.mkOption { - type = lib.types.str; - description = "Command window manager program."; - }; - - gap = lib.mkOption { - type = lib.types.int; - default = 10; - description = "The spacing between windows."; - }; - }; -} diff --git a/modules/desktop/window-manager/i3/default.nix b/modules/desktop/window-manager/i3/default.nix deleted file mode 100644 index 369fe34..0000000 --- a/modules/desktop/window-manager/i3/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - options.desktop.window-manager.i3 = { - enable = lib.mkEnableOption "Enables i3."; - }; - - config = lib.mkIf config.desktop.window-manager.i3.enable { - # Set i3 as the default window manager - desktop.window-manager.default = lib.mkDefault "i3"; - desktop.window-manager.command = - if config.desktop.window-manager.default == "i3" then - "${pkgs.i3}/bin/i3" - else lib.mkDefault ""; - - xsession.windowManager.i3.enable = true; - - xsession.windowManager.i3.config = { - modifier = "Mod4"; - gaps = { - inner = config.desktop.window-manager.gap; - }; - terminal = config.tools.terminal.command; - fonts = { - names = [ "FiraCode Nerd Font" ]; - size = 11.0; - }; - bars = [ - { - command = - lib.mkIf - config.desktop.status-bar.polybar.enable - config.desktop.status-bar.polybar.command; - } - ]; - }; - }; -} diff --git a/modules/desktop/window-manager/sxhkd/default.nix b/modules/desktop/window-manager/sxhkd/default.nix deleted file mode 100644 index cab7351..0000000 --- a/modules/desktop/window-manager/sxhkd/default.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ pkgs, config, lib, ... }: - -{ - options.desktop.window-manager.sxhkd = { - enable = lib.mkEnableOption "Enables sxhkd."; - }; - - config = lib.mkIf config.desktop.window-manager.sxhkd.enable { - services.sxhkd.enable = true; - services.sxhkd.keybindings = - let - modKey = "alt"; - createKeybinding = keybinding: description: command: { - "# ${description}\n${modKey} + ${keybinding}" = command; - }; - in lib.mkMerge [ - ( - if config.desktop.window-manager.bspwm.enable then - (import ./keybindings/bspwm.nix { inherit pkgs createKeybinding lib; }) - else {} - ) - (lib.mkMerge [ - (createKeybinding - "s" - "Show keybindings." - "${config.tools.terminal.command} --title 'Keybindings' --class floating-termial -e ${pkgs.writeShellScript "keybindings.sh" (builtins.readFile ./scripts/keybindings.sh)}" - ) - - (createKeybinding - "r" - "Application launcher." - config.desktop.application-launcher.command) - - (createKeybinding - "t" - "Launch terminal." - config.tools.terminal.command) - - (createKeybinding - "f" - "Launch File Manager." - "${config.tools.terminal.command} --title 'File Manager' --class floating-termial -e ${config.tools.file-manager.command}") - ]) - ]; - }; -} diff --git a/modules/desktop/window-manager/sxhkd/keybindings/bspwm.nix b/modules/desktop/window-manager/sxhkd/keybindings/bspwm.nix deleted file mode 100644 index ed62ed4..0000000 --- a/modules/desktop/window-manager/sxhkd/keybindings/bspwm.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ createKeybinding, pkgs, lib }: - -let - bspc = "${pkgs.bspwm}/bin/bspc"; -in lib.mkMerge [ - (createKeybinding - "q" - "Kill current window." - "${bspc} node -c") - - (createKeybinding - "{1-9,0}" - "Switch workspace." - "${bspc} desktop -f {1-9,10}") - - (createKeybinding - "shift + {1-9,0}" - "Move window to workspace." - "${bspc} node -d {1-9,10} --follow") - - (createKeybinding - "{n,d,m}" - "Set current window mode (tiled, floating, fullscreen)." - "${bspc} node focused -t {tiled,floating,fullscreen}") - - (createKeybinding - "{_,shift + }{h,j,k,l}" - "Navigate between windows." - "${bspc} node --{focus,swap} {west,south,north,east}") - - # the indentation for each line is required to work with the help prompt - (createKeybinding - "ctrl + {h,j,k,l}" - "Resize current window." - '' - ${bspc} node {@parent/second -z left -20 0; \ - @parent/first -z right -20 0, \ - @parent/second -z top 0 +20; \ - @parent/first -z bottom 0 +20, \ - @parent/first -z bottom 0 -20; \ - @parent/second -z top 0 -20, \ - @parent/first -z right +20 0; \ - @parent/second -z left +20 0} -'') -] diff --git a/modules/desktop/window-manager/sxhkd/scripts/keybindings.sh b/modules/desktop/window-manager/sxhkd/scripts/keybindings.sh deleted file mode 100755 index 01bb05f..0000000 --- a/modules/desktop/window-manager/sxhkd/scripts/keybindings.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh - -# Path to your sxhkd config file -SXHKD_FILE="$HOME/.config/sxhkd/sxhkdrc" - -# Function to wrap text to a specified width -wrap_text() { - local text="$1" - local width="$2" - echo "$text" | fold -s -w "$width" -} - -# Get terminal width -terminal_width=$(tput cols) - -# Set the table width to the full terminal width, leaving space for borders -table_width=$((terminal_width - 4)) # 4 for the borders and space between columns - -# Set keybinding column width to half of the available width -max_keybinding_length=$((table_width / 2)) - -# Length of the cotent inside the cell (2 spaces are substracted for padding) -max_keybinding_content_length=$((max_keybinding_length - 2)) - -# Set the description column width to the other half -description_width=$((table_width - max_keybinding_length - 1)) # 1 for the separator between columns - -# Length of the cotent inside the cell (2 spaces are substracted for padding) -description_content_width=$((description_width - 2)) - -# Generate the top border line and row separator -border_line="├$(printf '%.0s─' $(seq 1 $max_keybinding_length))┼$(printf '%.0s─' $(seq 1 $description_width))┤" - -# Pipe all output to less -{ - # Print table header with borders - echo "┌$(printf '%.0s─' $(seq 1 $max_keybinding_length))┬$(printf '%.0s─' $(seq 1 $description_width))┐" - printf "│ %-*s │ %-*s │\n" "$max_keybinding_content_length" "KEYBINDING" "$description_content_width" "DESCRIPTION" - - # Initialize variables - description="" - - # Load the sxhkd file into an array - mapfile -t lines < "$SXHKD_FILE" - - # Loop through lines for output - for line in "${lines[@]}"; do - # Check if the line is a comment - if [[ $line =~ ^# ]]; then - # Remove the "#" and any leading/trailing whitespace to capture the description - description="${line#\# }" - elif [[ $line =~ ^[^#[:space:]] ]]; then - # If it's a keybinding line, store it - keybinding="$line" - # Move to the next line for the command - command="${lines[((++i))]}" - - # Wrap the description to the calculated width - wrapped_description=$(wrap_text "$description" "$description_width") - - # Print the keybinding with a border line above and below it - echo "$border_line" - printf "│ %-*s │ %-*s │\n" "$max_keybinding_content_length" "$keybinding" "$description_content_width" "$(echo "$wrapped_description" | head -n 1)" - - # Print wrapped description lines with empty keybinding column - echo "$wrapped_description" | sed '1d' | while read -r continuation; do - printf "│ %-*s │ %-*s │\n" "$max_keybinding_content_length" "" "$description_content_width" "$continuation" - done - - # Reset description for the next keybinding - description="" - fi - done - - # Print the final border line - echo "└$(printf '%.0s─' $(seq 1 $max_keybinding_length))┴$(printf '%.0s─' $(seq 1 $description_width))┘" -} | less diff --git a/modules/desktop/xdg/default.nix b/modules/desktop/xdg/default.nix deleted file mode 100644 index a1614f4..0000000 --- a/modules/desktop/xdg/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, config, lib, ... }: - -{ - options.desktop.xdg = { - portal.enable = lib.mkEnableOption "Enables xdg desktop portal."; - }; - - config = lib.mkIf config.desktop.xdg.portal.enable { - xdg.portal.enable = true; - xdg.portal.xdgOpenUsePortal = true; - - xdg.portal.config = { - common = { - default = [ - "gtk" - ]; - }; - }; - - xdg.portal.extraPortals = [ - pkgs.xdg-desktop-portal-gtk - ]; - }; -} diff --git a/modules/scripts/default.nix b/modules/scripts/default.nix index 3802b82..6e39f32 100644 --- a/modules/scripts/default.nix +++ b/modules/scripts/default.nix @@ -7,15 +7,7 @@ config = lib.mkIf config.scripts.enable { home.file."scripts/restart-network" = { - source = ./scripts/restart-network.sh; - executable = true; - }; - - home.file."scripts/home-manager-switch" = { - text = '' -#!/bin/sh -home-manager switch --flake ${config.baseDirectory}/#${config.home.username} - ''; + source = ./restart-network.sh; executable = true; }; }; diff --git a/modules/scripts/restart-network.sh b/modules/scripts/restart-network.sh new file mode 100644 index 0000000..fc2b712 --- /dev/null +++ b/modules/scripts/restart-network.sh @@ -0,0 +1,3 @@ +#!/bin/sh +sudo ip link set $1 down +sudo ip link set $1 up diff --git a/modules/scripts/scripts/restart-network.sh b/modules/scripts/scripts/restart-network.sh deleted file mode 100644 index fc2b712..0000000 --- a/modules/scripts/scripts/restart-network.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -sudo ip link set $1 down -sudo ip link set $1 up diff --git a/modules/shell/bash/default.nix b/modules/shell/bash/default.nix deleted file mode 100644 index b14669e..0000000 --- a/modules/shell/bash/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - options.shell.bash = { - enable = lib.mkOption { - type = lib.types.bool; - description = "Enables bash."; - default = true; - }; - }; - - config = lib.mkIf config.shell.bash.enable { - shell.default = lib.mkDefault "bash"; - shell.command = - lib.mkIf - (config.shell.default == "bash") - "${pkgs.zsh}/bin/bash"; - - programs.bash.enable = true; - programs.bash.historyFile = "${config.xdg.cacheHome}/bash/history"; - programs.bash.shellAliases = config.shell.alias; - programs.bash.bashrcExtra = '' -${if config.tools.utils.fzf.enable then - "eval \"$(fzf --bash)\"" -else ""} -${if config.scripts.enable then - "export PATH=${config.home.homeDirectory}/scripts:$PATH" -else ""} - ''; - - home.activation.createBashCacheDirectory = - lib.hm.dag.entryAfter - [ "writeBoundary" ] - "mkdir -p ${config.xdg.cacheHome}/bash"; - }; -} diff --git a/modules/shell/default.nix b/modules/shell/default.nix deleted file mode 100644 index c2eada9..0000000 --- a/modules/shell/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ lib, pkgs, ... }: - -{ - imports = [ - ./bash - ./zsh - ]; - - options.shell = { - default = lib.mkOption { - type = lib.types.enum [ - "bash" - "zsh" - ]; - description = "Default shell."; - }; - - command = lib.mkOption { - type = lib.types.str; - description = "Command for the default shell."; - }; - - alias = lib.mkOption { - type = lib.types.attrs; - description = "Shell aliases."; - }; - }; -} diff --git a/modules/shell/zsh/default.nix b/modules/shell/zsh/default.nix deleted file mode 100644 index 96df967..0000000 --- a/modules/shell/zsh/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - options.shell.zsh = { - enable = lib.mkEnableOption "Enables zsh."; - }; - - config = lib.mkIf config.shell.zsh.enable { - shell.default = lib.mkDefault "zsh"; - shell.command = - lib.mkIf - (config.shell.default == "zsh") - "${pkgs.zsh}/bin/zsh"; - - programs.zsh.enable = true; - programs.zsh.dotDir = ".config/zsh"; - programs.zsh.history.path = "${config.xdg.cacheHome}/zsh/history"; - programs.zsh.shellAliases = config.shell.alias; - programs.zsh.initExtra = '' -${if config.tools.utils.fzf.enable then - "eval \"$(fzf --zsh)\"" -else ""} -${builtins.readFile ./zshrc} -${if config.scripts.enable then - "export PATH=${config.home.homeDirectory}/scripts:$PATH" -else ""} - ''; - }; -} diff --git a/modules/shell/zsh/zshrc b/modules/shell/zsh/zshrc deleted file mode 100644 index 3465071..0000000 --- a/modules/shell/zsh/zshrc +++ /dev/null @@ -1,23 +0,0 @@ -setopt PROMPT_SUBST - -autoload -U colors && colors - -autoload -Uz vcs_info -precmd() { vcs_info } - -zstyle ':vcs_info:git:*' formats '%F{red}┄[%F{cyan}%b%c%F{blue}%a%F{red}]' -zstyle ':vcs_info:git:*' actionformats '%F{red}┄[%F{cyan}%b%c%F{blue}%a%F{red}]' - -zstyle ':vcs_info:*+set-message:*' hooks git-untracked git-dirty - -zstyle ':vcs_info:git:*' check-for-changes true -zstyle ':vcs_info:git:*' stagedstr ' %F{green}✓%f' -zstyle ':vcs_info:git:*' unstagedstr ' %F{red}✗%f' -zstyle ':vcs_info:git:*' aheadstr ' %F{blue}⬆%f' -zstyle ':vcs_info:git:*' behindstr ' %F{yellow}⬇%f' - -PROMPT='%F{red}╭──[%F{green}%m%F{red}@%F{blue}%n%F{red}]┄[%F{magenta}%~%F{red}]${vcs_info_msg_0_}%(?..%F{red}┄[%F{white}Exit status: %F{yellow}%?%F{red}] ) -╰─>%f ' - -bindkey "^[[3~" delete-char -bindkey "^?" backward-delete-char diff --git a/modules/tools/bat/default.nix b/modules/tools/bat/default.nix new file mode 100644 index 0000000..d459042 --- /dev/null +++ b/modules/tools/bat/default.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: + +{ + options.tools.bat = { + enable = lib.mkEnableOption "Enables bat."; + }; + + config = lib.mkIf config.tools.bat.enable { + programs.bat.enable = true; + programs.bat.config = { + tabs = "4"; + theme = "custom-theme"; + }; + # shell.alias."cat" = "${pkgs.bat}/bin/bat -pp"; + # shell.alias."less" = "${pkgs.bat}/bin/bat --paging always"; + # home.sessionVariables."PAGER" = "${pkgs.bat}/bin/bat --paging always"; + xdg.configFile."bat/themes/custom-theme.tmTheme".source + = config.scheme { + template = builtins.readFile ./theme.mustache.tmTheme; + }; + }; +} diff --git a/modules/tools/bat/theme.mustache.tmTheme b/modules/tools/bat/theme.mustache.tmTheme new file mode 100644 index 0000000..844b80d --- /dev/null +++ b/modules/tools/bat/theme.mustache.tmTheme @@ -0,0 +1,120 @@ + + + + name + customTheme + settings + + + + settings + + background + #{{base00-hex}} + foreground + #{{base05-hex}} + caret + #{{base07-hex}} + invisibles + #{{base03-hex}} + lineHighlight + #{{base02-hex}} + selection + #{{base03-hex}} + + + + + + scope + comment + settings + + foreground + #{{base04-hex}} + + + + + scope + string + settings + + foreground + #{{base0A-hex}} + + + + + scope + constant.numeric + settings + + foreground + #{{base09-hex}} + + + + + scope + variable + settings + + foreground + #{{base08-hex}} + + + + + scope + keyword + settings + + foreground + #{{base0D-hex}} + + + + + scope + support.function + settings + + foreground + #{{base0E-hex}} + + + + + scope + constant.language + settings + + foreground + #{{base0B-hex}} + + + + + scope + entity.name.tag + settings + + foreground + #{{base0C-hex}} + + + + + scope + invalid + settings + + foreground + #{{base0F-hex}} + + + + + + diff --git a/modules/tools/default.nix b/modules/tools/default.nix index 0180df9..20b661d 100644 --- a/modules/tools/default.nix +++ b/modules/tools/default.nix @@ -2,12 +2,15 @@ { imports = [ - ./editor - ./file-manager + ./bat + ./feh + ./fzf ./git - ./system-monitor - ./terminal - ./utils - ./viewer + ./htop + ./kitty + ./lsd + ./neovim + ./nnn + ./zsh ]; } diff --git a/modules/tools/editor/default.nix b/modules/tools/editor/default.nix deleted file mode 100644 index fd2da1a..0000000 --- a/modules/tools/editor/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - imports = [ - ./neovim - ]; -} diff --git a/modules/tools/editor/neovim/config/default.nix b/modules/tools/editor/neovim/config/default.nix deleted file mode 100644 index 4514d2f..0000000 --- a/modules/tools/editor/neovim/config/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -'' -${builtins.readFile ./options.lua} -${builtins.readFile ./keybindings.lua} -'' diff --git a/modules/tools/editor/neovim/config/keybindings.lua b/modules/tools/editor/neovim/config/keybindings.lua deleted file mode 100644 index 3f2c9bf..0000000 --- a/modules/tools/editor/neovim/config/keybindings.lua +++ /dev/null @@ -1,5 +0,0 @@ --- Navigate splits -vim.keymap.set("n", "", ":wincmd h", { silent = true }); -vim.keymap.set("n", "", ":wincmd j", { silent = true }); -vim.keymap.set("n", "", ":wincmd k", { silent = true }); -vim.keymap.set("n", "", ":wincmd l", { silent = true }); diff --git a/modules/tools/editor/neovim/config/options.lua b/modules/tools/editor/neovim/config/options.lua deleted file mode 100644 index fc0b04c..0000000 --- a/modules/tools/editor/neovim/config/options.lua +++ /dev/null @@ -1,41 +0,0 @@ -vim.g.mapleader = " "; -vim.g.maplocalleader = " "; - -vim.o.clipboard = "unnamedplus"; - -vim.o.number = true; -vim.o.list = true; -vim.o.listchars = "tab:| ,trail:_,lead:_"; - -vim.o.laststatus = 3; - -vim.o.signcolumn = "auto"; -vim.opt.fillchars = { eob = " " }; - -vim.o.tabstop = 3; -vim.o.shiftwidth = 0; -vim.o.expandtab = false; - -vim.o.updatetime = 300; - -vim.o.mouse = "a"; - --- Force all filetypes to use tabs -vim.api.nvim_create_autocmd("FileType", { - pattern = "*", - callback = function() - vim.bo.expandtab = false; - vim.bo.tabstop = 3; - vim.bo.shiftwidth = 0; - end, -}); - --- Exception that use spaces -vim.api.nvim_create_autocmd("FileType", { - pattern = { "yaml" }, - callback = function() - vim.bo.expandtab = true; - vim.bo.tabstop = 2; - vim.bo.shiftwidth = 2; - end, -}); diff --git a/modules/tools/editor/neovim/default.nix b/modules/tools/editor/neovim/default.nix deleted file mode 100644 index 7d257ba..0000000 --- a/modules/tools/editor/neovim/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ pkgs, config, lib, ... }: - -{ - options.tools.editor.neovim = { - enable = lib.mkEnableOption "Enables neovim."; - profile = lib.mkOption { - type = lib.types.enum [ - "minimal" - "full" - ]; - default = "minimal"; - description = "The profile for neovim to use."; - }; - }; - - config = - let - plugins = import ./plugins { inherit config pkgs lib; }; - in lib.mkIf config.tools.editor.neovim.enable { - programs.neovim.enable = true; - programs.neovim.viAlias = true; - programs.neovim.vimAlias = true; - programs.neovim.vimdiffAlias = true; - programs.neovim.defaultEditor = true; - - home.packages = plugins.requirements; - - programs.neovim.extraLuaConfig = - '' -${import ./config} -${plugins.configuration} - ''; - - programs.neovim.plugins = plugins.list; - }; -} diff --git a/modules/tools/editor/neovim/plugins/config/base16.mustache.lua b/modules/tools/editor/neovim/plugins/config/base16.mustache.lua deleted file mode 100644 index 3c13fcc..0000000 --- a/modules/tools/editor/neovim/plugins/config/base16.mustache.lua +++ /dev/null @@ -1,12 +0,0 @@ -vim.o.termguicolors = true; -vim.opt.termguicolors = true; -vim.o.background = "dark"; -vim.g.base16colorspace = 256 -vim.cmd.colorscheme("base16-scheme"); - --- Overrides --- disable the background of line numbers -vim.api.nvim_set_hl(0, "LineNr", { link = "Normal" }); - --- change the color of the pane separator -vim.api.nvim_set_hl(0, "WinSeparator", { fg = "#{{base02-hex}}", bg = "None" }); diff --git a/modules/tools/editor/neovim/plugins/config/comment.lua b/modules/tools/editor/neovim/plugins/config/comment.lua deleted file mode 100644 index 9086261..0000000 --- a/modules/tools/editor/neovim/plugins/config/comment.lua +++ /dev/null @@ -1 +0,0 @@ -require("Comment").setup(); diff --git a/modules/tools/editor/neovim/plugins/config/default.nix b/modules/tools/editor/neovim/plugins/config/default.nix deleted file mode 100644 index dcdb371..0000000 --- a/modules/tools/editor/neovim/plugins/config/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config }: - -let - fullExtra = if config.tools.editor.neovim.profile == "full" then -'' -${builtins.readFile ./lsp-config.lua} -${builtins.readFile ./dressing.lua} -${builtins.readFile (config.scheme { - template = builtins.readFile ./noice.mustache.lua; -})} -${builtins.readFile ./nvim-ufo.lua} -${builtins.readFile ./which-key.lua} -'' - else ""; -in -'' -${builtins.readFile ./comment.lua} -${builtins.readFile (config.scheme { - template = builtins.readFile ./lualine.mustache.lua; -})} -${import ./treesitter.nix { inherit config; }} -${builtins.readFile (config.scheme { - template = builtins.readFile ./base16.mustache.lua; -})} -${builtins.readFile ./nvim-tree.lua} -${fullExtra} -'' diff --git a/modules/tools/editor/neovim/plugins/config/dressing.lua b/modules/tools/editor/neovim/plugins/config/dressing.lua deleted file mode 100644 index 6d14d47..0000000 --- a/modules/tools/editor/neovim/plugins/config/dressing.lua +++ /dev/null @@ -1 +0,0 @@ -require("dressing").setup(); diff --git a/modules/tools/editor/neovim/plugins/config/lsp-config.lua b/modules/tools/editor/neovim/plugins/config/lsp-config.lua deleted file mode 100644 index cca4116..0000000 --- a/modules/tools/editor/neovim/plugins/config/lsp-config.lua +++ /dev/null @@ -1,75 +0,0 @@ -local lspconfig = require("lspconfig"); - -local filetype_to_lsp = { - lua = { server = "lua_ls", executable = "lua-language-server" }, - cpp = { server = "clangd", executable = "clangd" }, - c = { server = "clangd", executable = "clangd" }, - python = { server = "pyright", executable = "pyright-langserver" }, - javascript = { server = "tsserver", executable = "typescript-language-server" }, - typescript = { server = "tsserver", executable = "typescript-language-server" }, - go = { server = "gopls", executable = "gopls" }, - html = { server = "html", executable = "vscode-html-language-server" }, - css = { server = "cssls", executable = "vscode-css-language-server" }, - json = { server = "jsonls", executable = "vscode-json-language-server" }, - bash = { server = "bashls", executable = "bash-language-server" }, - graphql = { server = "graphql", executable = "graphql-lsp" }, - dockerfile = { server = "dockerls", executable = "docker-langserver" }, - php = { server = "phpactor", executable = "phpactor" }, - rust = { server = "rust_analyzer", executable = "rust-analyzer" }, - haskell = { server = "hls", executable = "haskell-language-server-wrapper" }, - deno = { server = "denols", executable = "deno" }, - vim = { server = "vimls", executable = "vim-language-server" }, - elixir = { server = "elixirls", executable = "elixir-ls" }, - clojure = { server = "clojure_lsp", executable = "clojure-lsp" }, - scala = { server = "scala_metals", executable = "metals" }, - ruby = { server = "sorbet", executable = "srb" }, - zig = { server = "zls", executable = "zls" }, - kotlin = { server = "kotlin_language_server", executable = "kotlin-language-server" }, - java = { server = "jdtls", executable = "jdtls" }, - dart = { server = "dartls", executable = "dart" }, - yaml = { server = "yamlls", executable = "yaml-language-server" }, - perl = { server = "perlls", executable = "perl" }, - r = { server = "r_language_server", executable = "R" }, - tex = { server = "texlab", executable = "texlab" }, - swift = { server = "sourcekit", executable = "sourcekit-lsp" }, - svelte = { server = "svelteserver", executable = "svelteserver" }, - terraform = { server = "terraformls", executable = "terraform-ls" }, - vue = { server = "vls", executable = "vls" }, - markdown = { server = "marksman", executable = "marksman" }, - yaml = { server = "yamlls", executable = "yaml-language-server" }, -}; - --- Keeping track of all the lsps that have been already configured -local lsp_setup_done = {}; - --- Function to setup LSP based on filetype -local function setup_lsp(filetype) - local lsp = filetype_to_lsp[filetype]; - if lsp ~= nil and not lsp_setup_done[lsp.server] then - lsp_setup_done[lsp.server] = true; - if vim.fn.executable(lsp.executable) == 1 then - lspconfig[lsp.server].setup({}); - end - end -end - -vim.api.nvim_create_autocmd("FileType", { - pattern = "*", -- Match all file types - callback = function() - setup_lsp(vim.bo.filetype); -- Call the setup_lsp function only if the filetype is in the mapping - end, -}); - --- Show diagnostics in a floating window when hovering over the line -vim.api.nvim_create_autocmd("CursorHold", { - callback = function() - vim.diagnostic.open_float(nil, { focusable = false }) - end, -}) - -local lsp_keymap_opts = { noremap = true, silent = true }; - -vim.keymap.set("n", "d", vim.lsp.buf.definition, lsp_keymap_opts); -vim.keymap.set("n", "i", vim.lsp.buf.implementation, lsp_keymap_opts); -vim.keymap.set("n", "r", vim.lsp.buf.references, lsp_keymap_opts); -vim.keymap.set("n", "k", vim.lsp.buf.hover, lsp_keymap_opts); diff --git a/modules/tools/editor/neovim/plugins/config/lualine.mustache.lua b/modules/tools/editor/neovim/plugins/config/lualine.mustache.lua deleted file mode 100644 index bf4f1d1..0000000 --- a/modules/tools/editor/neovim/plugins/config/lualine.mustache.lua +++ /dev/null @@ -1,61 +0,0 @@ -local lualine_theme = { - normal = { - a = { fg = "#{{base0D-hex}}", bg = "none", gui = "bold" }, - b = { fg = "#{{base05-hex}}", bg = "none" }, - c = { fg = "#{{base05-hex}}", bg = "none" }, - }, - insert = { - a = { fg = "#{{base0B-hex}}", bg = "none", gui = "bold" }, - }, - visual = { - a = { fg = "#{{base0E-hex}}", bg = "none", gui = "bold" }, - }, - replace = { - a = { fg = "#{{base08-hex}}", bg = "none", gui = "bold" }, - }, - command = { - a = { fg = "#{{base0A-hex}}", bg = "none", gui = "bold" }, - }, - inactive = { - a = { fg = "#{{base04-hex}}", bg = "none" }, - b = { fg = "#{{base04-hex}}", bg = "none" }, - c = { fg = "#{{base04-hex}}", bg = "none" }, - }, -}; - -local function macro_recording() - local recording_register = vim.fn.reg_recording() - if recording_register ~= "" then - return "@" .. recording_register - else - return "" - end -end - -require("lualine").setup { - options = { - icons_enabled = true, - theme = lualine_theme, - section_separators = "", - component_separators = "", - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { - "branch", - { - "diff", - colored = true, - symbols = { - added = " ", - modified = " ", - removed = " ", - } - } - }, - lualine_c = { "filename" }, - lualine_x = { macro_recording, "encoding", "fileformat", "filetype" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, -}; diff --git a/modules/tools/editor/neovim/plugins/config/noice.mustache.lua b/modules/tools/editor/neovim/plugins/config/noice.mustache.lua deleted file mode 100644 index a258c8e..0000000 --- a/modules/tools/editor/neovim/plugins/config/noice.mustache.lua +++ /dev/null @@ -1,10 +0,0 @@ -require("noice").setup(); - -vim.api.nvim_set_hl(0, "NoiceCommandOutput", { fg = "#{{base05-hex}}", bg = "#{{base00-hex}}" }); -vim.api.nvim_set_hl(0, "NoiceCmdline", { fg = "#{{base05-hex}}", bg = "#{{base00-hex}}" }); -vim.api.nvim_set_hl(0, "NoiceCmdlinePopup", { fg = "#{{base05-hex}}", bg = "#{{base00-hex}}" }); -vim.api.nvim_set_hl(0, "NoiceCmdlinePopupBorder", { fg = "#{{base03-hex}}", bg = "#{{base00-hex}}" }); -vim.api.nvim_set_hl(0, "NoiceError", { fg = "#{{base08-hex}}", bg = "#{{base00-hex}}" }); -vim.api.nvim_set_hl(0, "NoiceWarning", { fg = "#{{base0A-hex}}", bg = "#{{base00-hex}}" }); -vim.api.nvim_set_hl(0, "NoiceInfo", { fg = "#{{base0C-hex}}", bg = "#{{base00-hex}}" }); -vim.api.nvim_set_hl(0, "NoiceHint", { fg = "#{{base0B-hex}}", bg = "#{{base00-hex}}" }); diff --git a/modules/tools/editor/neovim/plugins/config/nvim-tree.lua b/modules/tools/editor/neovim/plugins/config/nvim-tree.lua deleted file mode 100644 index cdbef6a..0000000 --- a/modules/tools/editor/neovim/plugins/config/nvim-tree.lua +++ /dev/null @@ -1,15 +0,0 @@ -require("nvim-tree").setup { - filters = { - enable = false - }, - renderer = { - indent_markers = { - enable = true - }, - root_folder_label = function(path) - return vim.fn.fnamemodify(path, ":t") - end, - }, -}; - -vim.keymap.set("n", "", ":NvimTreeToggle", { silent = true }); diff --git a/modules/tools/editor/neovim/plugins/config/nvim-ufo.lua b/modules/tools/editor/neovim/plugins/config/nvim-ufo.lua deleted file mode 100644 index 641373f..0000000 --- a/modules/tools/editor/neovim/plugins/config/nvim-ufo.lua +++ /dev/null @@ -1,21 +0,0 @@ -require("ufo").setup { - provider_selector = function(bufnr, filetype, buftype) - return { - "treesitter", - "indent" - } - end, -}; - -vim.o.foldenable = true -vim.o.foldcolumn = '0' -vim.o.foldlevel = 99 -- Ensure all folds start open -vim.o.foldlevelstart = 99 - --- press K or capslockK -vim.keymap.set("n", "", function() - local winid = ufo.peekFoldedLinesUnderCursor() - if not winid then - vim.lsp.buf.hover() - end -end) diff --git a/modules/tools/editor/neovim/plugins/config/treesitter.nix b/modules/tools/editor/neovim/plugins/config/treesitter.nix deleted file mode 100644 index be0bdb6..0000000 --- a/modules/tools/editor/neovim/plugins/config/treesitter.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config }: - -'' -require("nvim-treesitter.configs").setup { - auto_install = true, - highlight = { - enable = true, - }, - parser_install_dir = "${config.xdg.dataHome}/nvim", -}; - -vim.opt.runtimepath:append("${config.xdg.dataHome}/nvim"); -'' diff --git a/modules/tools/editor/neovim/plugins/config/which-key.lua b/modules/tools/editor/neovim/plugins/config/which-key.lua deleted file mode 100644 index 1290432..0000000 --- a/modules/tools/editor/neovim/plugins/config/which-key.lua +++ /dev/null @@ -1,5 +0,0 @@ -local wk = require("which-key"); - -vim.keymap.set("n", "h", function() - wk.show({ global = true }) -end, { silent = true }); diff --git a/modules/tools/editor/neovim/plugins/default.nix b/modules/tools/editor/neovim/plugins/default.nix deleted file mode 100644 index f801519..0000000 --- a/modules/tools/editor/neovim/plugins/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ config, pkgs, lib }: - -{ - configuration = import ./config { inherit config; }; - - list = with pkgs.vimPlugins; lib.mkMerge [ - [ - comment-nvim - lualine-nvim - nvim-treesitter - nvim-web-devicons - nvim-tree-lua - which-key-nvim - (base16-vim.overrideAttrs (old: { - patchPhase = "ln -s ${config.scheme base16-vim} colors/base16-scheme.vim"; - })) - ] - (if config.tools.editor.neovim.profile == "full" then - [ - noice-nvim - dressing-nvim - nvim-lspconfig - nvim-ufo - ] - else []) - ]; - - requirements = with pkgs; [ - gcc # for treesitter - ]; -} diff --git a/modules/tools/feh/default.nix b/modules/tools/feh/default.nix new file mode 100644 index 0000000..8aa5631 --- /dev/null +++ b/modules/tools/feh/default.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, ... }: + +{ + options.tools.feh = { + enable = lib.mkEnableOption "Enables feh."; + }; + + config = lib.mkIf config.tools.git.enable { + programs.feh.enable = true; + }; +} diff --git a/modules/tools/file-manager/default.nix b/modules/tools/file-manager/default.nix deleted file mode 100644 index 4889f5b..0000000 --- a/modules/tools/file-manager/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ lib, ... }: - -{ - imports = [ - ./lf - ./lsd - ./nnn - ]; - - options.tools.file-manager = { - default = lib.mkOption { - type = lib.types.enum [ - "nnn" - "lf" - ]; - description = "Default file manager."; - }; - - command = lib.mkOption { - type = lib.types.str; - description = "Command for the default file manager program."; - }; - }; -} diff --git a/modules/tools/file-manager/lf/default.nix b/modules/tools/file-manager/lf/default.nix deleted file mode 100644 index 2fab997..0000000 --- a/modules/tools/file-manager/lf/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - options.tools.file-manager.lf = { - enable = lib.mkEnableOption "Enables lf."; - }; - - config = lib.mkIf config.tools.file-manager.lf.enable { - tools.file-manager.default = lib.mkDefault "lf"; - tools.file-manager.command = - lib.mkIf - (config.tools.file-manager.default == "lf") - "${pkgs.lf}/bin/lf"; - - programs.lf.enable = true; - programs.lf.settings = { - hidden = true; - }; - programs.lf.previewer.source = pkgs.writeShellScript - "previewer.sh" - '' -#!/bin/sh -unset COLORTERM -${if config.tools.viewer.bat.enable then - "bat -pp --line-range=:500 --color=always" -else "cat"} "$1" - ''; - programs.lf.extraConfig = "set icons"; - - xdg.configFile."lf/icons".source = ./icons; - }; -} diff --git a/modules/tools/file-manager/lf/icons b/modules/tools/file-manager/lf/icons deleted file mode 100644 index 2e9d8a2..0000000 --- a/modules/tools/file-manager/lf/icons +++ /dev/null @@ -1,334 +0,0 @@ -# vim:ft=conf - -# These examples require Nerd Fonts or a compatible font to be used. -# See https://www.nerdfonts.com for more information. - -# file types (with matching order) -ln  # LINK -or  # ORPHAN -tw t # STICKY_OTHER_WRITABLE -ow  # OTHER_WRITABLE -st t # STICKY -di  # DIR -pi p # FIFO -so s # SOCK -bd b # BLK -cd c # CHR -su u # SETUID -sg g # SETGID -ex  # EXEC -fi  # FILE - -# file extensions (vim-devicons) -*.styl  -*.sass  -*.scss  -*.htm  -*.html  -*.slim  -*.haml  -*.ejs  -*.css  -*.less  -*.md  -*.mdx  -*.markdown  -*.rmd  -*.json  -*.webmanifest  -*.js  -*.mjs  -*.jsx  -*.rb  -*.gemspec  -*.rake  -*.php  -*.py  -*.pyc  -*.pyo  -*.pyd  -*.coffee  -*.mustache  -*.hbs  -*.conf  -*.ini  -*.yml  -*.yaml  -*.toml  -*.bat  -*.mk  -*.jpg  -*.jpeg  -*.bmp  -*.png  -*.webp  -*.gif  -*.ico  -*.twig  -*.cpp  -*.c++  -*.cxx  -*.cc  -*.cp  -*.c  -*.cs 󰌛 -*.h  -*.hh  -*.hpp  -*.hxx  -*.hs  -*.lhs  -*.nix  -*.lua  -*.java  -*.sh  -*.fish  -*.bash  -*.zsh  -*.ksh  -*.csh  -*.awk  -*.ps1  -*.ml λ -*.mli λ -*.diff  -*.db  -*.sql  -*.dump  -*.clj  -*.cljc  -*.cljs  -*.edn  -*.scala  -*.go  -*.dart  -*.xul  -*.sln  -*.suo  -*.pl  -*.pm  -*.t  -*.rss  -'*.f#'  -*.fsscript  -*.fsx  -*.fs  -*.fsi  -*.rs  -*.rlib  -*.d  -*.erl  -*.hrl  -*.ex  -*.exs  -*.eex  -*.leex  -*.heex  -*.vim  -*.ai  -*.psd  -*.psb  -*.ts  -*.tsx  -*.jl  -*.pp  -*.vue  -*.elm  -*.swift  -*.xcplayground  -*.tex 󰙩 -*.r 󰟔 -*.rproj 󰗆 -*.sol 󰡪 -*.pem  - -# file names (vim-devicons) (case-insensitive not supported in lf) -*gruntfile.coffee  -*gruntfile.js  -*gruntfile.ls  -*gulpfile.coffee  -*gulpfile.js  -*gulpfile.ls  -*mix.lock  -*dropbox  -*.ds_store  -*.gitconfig  -*.gitignore  -*.gitattributes  -*.gitlab-ci.yml  -*.bashrc  -*.zshrc  -*.zshenv  -*.zprofile  -*.vimrc  -*.gvimrc  -*_vimrc  -*_gvimrc  -*.bashprofile  -*favicon.ico  -*license  -*node_modules  -*react.jsx  -*procfile  -*dockerfile  -*docker-compose.yml  -*docker-compose.yaml  -*compose.yml  -*compose.yaml  -*rakefile  -*config.ru  -*gemfile  -*makefile  -*cmakelists.txt  -*robots.txt 󰚩 - -# file names (case-sensitive adaptations) -*Gruntfile.coffee  -*Gruntfile.js  -*Gruntfile.ls  -*Gulpfile.coffee  -*Gulpfile.js  -*Gulpfile.ls  -*Dropbox  -*.DS_Store  -*LICENSE  -*React.jsx  -*Procfile  -*Dockerfile  -*Docker-compose.yml  -*Docker-compose.yaml  -*Rakefile  -*Gemfile  -*Makefile  -*CMakeLists.txt  - -# file patterns (file name adaptations) -*jquery.min.js  -*angular.min.js  -*backbone.min.js  -*require.min.js  -*materialize.min.js  -*materialize.min.css  -*mootools.min.js  -*vimrc  -Vagrantfile  - -# archives or compressed (extensions from dircolors defaults) -*.tar  -*.tgz  -*.arc  -*.arj  -*.taz  -*.lha  -*.lz4  -*.lzh  -*.lzma  -*.tlz  -*.txz  -*.tzo  -*.t7z  -*.zip  -*.z  -*.dz  -*.gz  -*.lrz  -*.lz  -*.lzo  -*.xz  -*.zst  -*.tzst  -*.bz2  -*.bz  -*.tbz  -*.tbz2  -*.tz  -*.deb  -*.rpm  -*.jar  -*.war  -*.ear  -*.sar  -*.rar  -*.alz  -*.ace  -*.zoo  -*.cpio  -*.7z  -*.rz  -*.cab  -*.wim  -*.swm  -*.dwm  -*.esd  - -# image formats (extensions from dircolors defaults) -*.jpg  -*.jpeg  -*.mjpg  -*.mjpeg  -*.gif  -*.bmp  -*.pbm  -*.pgm  -*.ppm  -*.tga  -*.xbm  -*.xpm  -*.tif  -*.tiff  -*.png  -*.svg  -*.svgz  -*.mng  -*.pcx  -*.mov  -*.mpg  -*.mpeg  -*.m2v  -*.mkv  -*.webm  -*.ogm  -*.mp4  -*.m4v  -*.mp4v  -*.vob  -*.qt  -*.nuv  -*.wmv  -*.asf  -*.rm  -*.rmvb  -*.flc  -*.avi  -*.fli  -*.flv  -*.gl  -*.dl  -*.xcf  -*.xwd  -*.yuv  -*.cgm  -*.emf  -*.ogv  -*.ogx  - -# audio formats (extensions from dircolors defaults) -*.aac  -*.au  -*.flac  -*.m4a  -*.mid  -*.midi  -*.mka  -*.mp3  -*.mpc  -*.ogg  -*.ra  -*.wav  -*.oga  -*.opus  -*.spx  -*.xspf  - -# other formats -*.pdf  diff --git a/modules/tools/file-manager/lsd/default.nix b/modules/tools/file-manager/lsd/default.nix deleted file mode 100644 index d99413d..0000000 --- a/modules/tools/file-manager/lsd/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, lib, config, ... }: - -{ - options.tools.file-manager.lsd = { - enable = lib.mkEnableOption "Enables lsd."; - }; - - config = lib.mkIf config.tools.file-manager.lsd.enable { - programs.lsd.enable = true; - programs.lsd.enableAliases = true; - programs.lsd.settings.icons.separator = " "; - }; -} diff --git a/modules/tools/file-manager/nnn/default.nix b/modules/tools/file-manager/nnn/default.nix deleted file mode 100644 index a41096c..0000000 --- a/modules/tools/file-manager/nnn/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - options.tools.file-manager.nnn = { - enable = lib.mkEnableOption "Enables nnn."; - }; - - config = - let - nnnWithNerdIcons = pkgs.nnn.override ({ withNerdIcons = true; }); - in lib.mkIf config.tools.file-manager.nnn.enable { - tools.file-manager.default = lib.mkDefault "nnn"; - tools.file-manager.command = - lib.mkIf - (config.tools.file-manager.default == "nnn") - "${nnnWithNerdIcons}/bin/nnn -H -d"; - - programs.nnn.enable = true; - programs.nnn.package = nnnWithNerdIcons; - programs.nnn.plugins.src = "${nnnWithNerdIcons}/share/plugins"; - shell.alias."nnn" = "${nnnWithNerdIcons}/bin/nnn -H -d"; - }; -} diff --git a/modules/tools/fzf/default.nix b/modules/tools/fzf/default.nix new file mode 100644 index 0000000..169a07f --- /dev/null +++ b/modules/tools/fzf/default.nix @@ -0,0 +1,42 @@ +{ config, lib,... }: + +{ + options.tools.fzf = { + enable = lib.mkEnableOption "Enables fzf."; + }; + + config = lib.mkIf config.tools.fzf.enable { + programs.fzf.enable = true; + programs.fzf.defaultOptions = [ + "--height 100%" + "--layout=reverse" + ''--pointer=\"${if config.fonts.nerdfont.fira-code.enable then " " else ">"}\"'' + ''--header=\" \"'' + ''--prompt=\" \"'' + ''--marker=\"✓ \"'' + "--border=none" + "--cycle" + "--no-info" + "--margin=\"1,2\"" + ]; + + programs.fzf.colors = with config.scheme.withHashtag; { + fg = base05; # Foreground + bg = "-1"; # Background (-1 for transparent) + hl = base0D; # Highlight + + "fg+" = base07; # Foreground for selected item + "bg+" = "-1"; # Background for selected item + "hl+" = base0D; # Highlight for selected item + + gutter = "-1"; # Remove the white margin at the left + + info = base0B; # Info text (usually count of items) + border = base03; # Border color + prompt = base0A; # Prompt text color + pointer = base0F; # Pointer color (e.g., > for selected) + marker = base0C; # Marker color (e.g., for multi-select) + spinner = base0C; # Spinner color (during search) + }; + }; +} diff --git a/modules/tools/htop/default.nix b/modules/tools/htop/default.nix new file mode 100644 index 0000000..d4037e6 --- /dev/null +++ b/modules/tools/htop/default.nix @@ -0,0 +1,12 @@ +{ pkgs, lib, config, ... }: + +{ + options.tools.htop = { + enable = lib.mkEnableOption "Enables htop."; + }; + + config = lib.mkIf config.tools.htop.enable { + programs.htop.enable = true; + programs.htop.package = pkgs.htop-vim; + }; +} diff --git a/modules/tools/kitty/default.nix b/modules/tools/kitty/default.nix new file mode 100644 index 0000000..74b4519 --- /dev/null +++ b/modules/tools/kitty/default.nix @@ -0,0 +1,47 @@ +{ pkgs, config, lib, ... }: + +{ + options.tools.kitty = { + enable = lib.mkEnableOption "Enables kitty. WARNING! Currently faces problems with color rendering with picom."; + }; + + config = lib.mkIf config.tools.kitty.enable { + programs.kitty.enable = true; + programs.kitty.settings = with config.scheme.withHashtag; { + window_padding_width = 10; + font_size = config.fonts.size; + font_family = config.fonts.normal; + filter_notification = "all"; + update_check_interval = 0; # disable notifications + scrollback_indicator_opacity = "0.5"; + + dynamic_background_opacity = false; + allow_remote_control = false; + enable_audio_bell = false; + + background = base00; + foreground = base05; + text_composition_strategy = "legacy"; + + color0 = base00; # Black + color8 = base00; # Black + color1 = base08; # Red + color9 = base08; # Red + color2 = base0B; # Green + color10 = base0B; # Green + color3 = base0A; # Yellow + color11 = base0A; # Yellow + color4 = base0D; # Blue + color12 = base0D; # Blue + color5 = base0E; # Magenta + color13 = base0E; # Magenta + color6 = base0C; # Cyan + color14 = base0C; # Cyan + color7 = base05; # White + color15 = base05; # White + + selection_background = base03; + selection_foreground = base00; + }; + }; +} 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/neovim/config/default.nix b/modules/tools/neovim/config/default.nix new file mode 100644 index 0000000..4514d2f --- /dev/null +++ b/modules/tools/neovim/config/default.nix @@ -0,0 +1,4 @@ +'' +${builtins.readFile ./options.lua} +${builtins.readFile ./keybindings.lua} +'' diff --git a/modules/tools/neovim/config/keybindings.lua b/modules/tools/neovim/config/keybindings.lua new file mode 100644 index 0000000..3f2c9bf --- /dev/null +++ b/modules/tools/neovim/config/keybindings.lua @@ -0,0 +1,5 @@ +-- Navigate splits +vim.keymap.set("n", "", ":wincmd h", { silent = true }); +vim.keymap.set("n", "", ":wincmd j", { silent = true }); +vim.keymap.set("n", "", ":wincmd k", { silent = true }); +vim.keymap.set("n", "", ":wincmd l", { silent = true }); diff --git a/modules/tools/neovim/config/options.lua b/modules/tools/neovim/config/options.lua new file mode 100644 index 0000000..fc0b04c --- /dev/null +++ b/modules/tools/neovim/config/options.lua @@ -0,0 +1,41 @@ +vim.g.mapleader = " "; +vim.g.maplocalleader = " "; + +vim.o.clipboard = "unnamedplus"; + +vim.o.number = true; +vim.o.list = true; +vim.o.listchars = "tab:| ,trail:_,lead:_"; + +vim.o.laststatus = 3; + +vim.o.signcolumn = "auto"; +vim.opt.fillchars = { eob = " " }; + +vim.o.tabstop = 3; +vim.o.shiftwidth = 0; +vim.o.expandtab = false; + +vim.o.updatetime = 300; + +vim.o.mouse = "a"; + +-- Force all filetypes to use tabs +vim.api.nvim_create_autocmd("FileType", { + pattern = "*", + callback = function() + vim.bo.expandtab = false; + vim.bo.tabstop = 3; + vim.bo.shiftwidth = 0; + end, +}); + +-- Exception that use spaces +vim.api.nvim_create_autocmd("FileType", { + pattern = { "yaml" }, + callback = function() + vim.bo.expandtab = true; + vim.bo.tabstop = 2; + vim.bo.shiftwidth = 2; + end, +}); diff --git a/modules/tools/neovim/default.nix b/modules/tools/neovim/default.nix new file mode 100644 index 0000000..2c0b7aa --- /dev/null +++ b/modules/tools/neovim/default.nix @@ -0,0 +1,36 @@ +{ pkgs, config, lib, ... }: + +{ + options.tools.neovim = { + enable = lib.mkEnableOption "Enables neovim."; + profile = lib.mkOption { + type = lib.types.enum [ + "minimal" + "full" + ]; + default = "minimal"; + description = "The profile for neovim to use."; + }; + }; + + config = + let + plugins = import ./plugins { inherit config pkgs lib; }; + in lib.mkIf config.tools.neovim.enable { + programs.neovim.enable = true; + programs.neovim.viAlias = true; + programs.neovim.vimAlias = true; + programs.neovim.vimdiffAlias = true; + programs.neovim.defaultEditor = true; + + home.packages = plugins.requirements; + + programs.neovim.extraLuaConfig = + '' +${import ./config} +${plugins.configuration} + ''; + + programs.neovim.plugins = plugins.list; + }; +} diff --git a/modules/tools/neovim/plugins/config/base16.mustache.lua b/modules/tools/neovim/plugins/config/base16.mustache.lua new file mode 100644 index 0000000..3c13fcc --- /dev/null +++ b/modules/tools/neovim/plugins/config/base16.mustache.lua @@ -0,0 +1,12 @@ +vim.o.termguicolors = true; +vim.opt.termguicolors = true; +vim.o.background = "dark"; +vim.g.base16colorspace = 256 +vim.cmd.colorscheme("base16-scheme"); + +-- Overrides +-- disable the background of line numbers +vim.api.nvim_set_hl(0, "LineNr", { link = "Normal" }); + +-- change the color of the pane separator +vim.api.nvim_set_hl(0, "WinSeparator", { fg = "#{{base02-hex}}", bg = "None" }); diff --git a/modules/tools/neovim/plugins/config/comment.lua b/modules/tools/neovim/plugins/config/comment.lua new file mode 100644 index 0000000..9086261 --- /dev/null +++ b/modules/tools/neovim/plugins/config/comment.lua @@ -0,0 +1 @@ +require("Comment").setup(); diff --git a/modules/tools/neovim/plugins/config/default.nix b/modules/tools/neovim/plugins/config/default.nix new file mode 100644 index 0000000..9ae2485 --- /dev/null +++ b/modules/tools/neovim/plugins/config/default.nix @@ -0,0 +1,27 @@ +{ config }: + +let + fullExtra = if config.tools.neovim.profile == "full" then +'' +${builtins.readFile ./lsp-config.lua} +${builtins.readFile ./dressing.lua} +${builtins.readFile (config.scheme { + template = builtins.readFile ./noice.mustache.lua; +})} +${builtins.readFile ./nvim-ufo.lua} +${builtins.readFile ./which-key.lua} +'' + else ""; +in +'' +${builtins.readFile ./comment.lua} +${builtins.readFile (config.scheme { + template = builtins.readFile ./lualine.mustache.lua; +})} +${import ./treesitter.nix { inherit config; }} +${builtins.readFile (config.scheme { + template = builtins.readFile ./base16.mustache.lua; +})} +${builtins.readFile ./nvim-tree.lua} +${fullExtra} +'' diff --git a/modules/tools/neovim/plugins/config/dressing.lua b/modules/tools/neovim/plugins/config/dressing.lua new file mode 100644 index 0000000..6d14d47 --- /dev/null +++ b/modules/tools/neovim/plugins/config/dressing.lua @@ -0,0 +1 @@ +require("dressing").setup(); diff --git a/modules/tools/neovim/plugins/config/lsp-config.lua b/modules/tools/neovim/plugins/config/lsp-config.lua new file mode 100644 index 0000000..cca4116 --- /dev/null +++ b/modules/tools/neovim/plugins/config/lsp-config.lua @@ -0,0 +1,75 @@ +local lspconfig = require("lspconfig"); + +local filetype_to_lsp = { + lua = { server = "lua_ls", executable = "lua-language-server" }, + cpp = { server = "clangd", executable = "clangd" }, + c = { server = "clangd", executable = "clangd" }, + python = { server = "pyright", executable = "pyright-langserver" }, + javascript = { server = "tsserver", executable = "typescript-language-server" }, + typescript = { server = "tsserver", executable = "typescript-language-server" }, + go = { server = "gopls", executable = "gopls" }, + html = { server = "html", executable = "vscode-html-language-server" }, + css = { server = "cssls", executable = "vscode-css-language-server" }, + json = { server = "jsonls", executable = "vscode-json-language-server" }, + bash = { server = "bashls", executable = "bash-language-server" }, + graphql = { server = "graphql", executable = "graphql-lsp" }, + dockerfile = { server = "dockerls", executable = "docker-langserver" }, + php = { server = "phpactor", executable = "phpactor" }, + rust = { server = "rust_analyzer", executable = "rust-analyzer" }, + haskell = { server = "hls", executable = "haskell-language-server-wrapper" }, + deno = { server = "denols", executable = "deno" }, + vim = { server = "vimls", executable = "vim-language-server" }, + elixir = { server = "elixirls", executable = "elixir-ls" }, + clojure = { server = "clojure_lsp", executable = "clojure-lsp" }, + scala = { server = "scala_metals", executable = "metals" }, + ruby = { server = "sorbet", executable = "srb" }, + zig = { server = "zls", executable = "zls" }, + kotlin = { server = "kotlin_language_server", executable = "kotlin-language-server" }, + java = { server = "jdtls", executable = "jdtls" }, + dart = { server = "dartls", executable = "dart" }, + yaml = { server = "yamlls", executable = "yaml-language-server" }, + perl = { server = "perlls", executable = "perl" }, + r = { server = "r_language_server", executable = "R" }, + tex = { server = "texlab", executable = "texlab" }, + swift = { server = "sourcekit", executable = "sourcekit-lsp" }, + svelte = { server = "svelteserver", executable = "svelteserver" }, + terraform = { server = "terraformls", executable = "terraform-ls" }, + vue = { server = "vls", executable = "vls" }, + markdown = { server = "marksman", executable = "marksman" }, + yaml = { server = "yamlls", executable = "yaml-language-server" }, +}; + +-- Keeping track of all the lsps that have been already configured +local lsp_setup_done = {}; + +-- Function to setup LSP based on filetype +local function setup_lsp(filetype) + local lsp = filetype_to_lsp[filetype]; + if lsp ~= nil and not lsp_setup_done[lsp.server] then + lsp_setup_done[lsp.server] = true; + if vim.fn.executable(lsp.executable) == 1 then + lspconfig[lsp.server].setup({}); + end + end +end + +vim.api.nvim_create_autocmd("FileType", { + pattern = "*", -- Match all file types + callback = function() + setup_lsp(vim.bo.filetype); -- Call the setup_lsp function only if the filetype is in the mapping + end, +}); + +-- Show diagnostics in a floating window when hovering over the line +vim.api.nvim_create_autocmd("CursorHold", { + callback = function() + vim.diagnostic.open_float(nil, { focusable = false }) + end, +}) + +local lsp_keymap_opts = { noremap = true, silent = true }; + +vim.keymap.set("n", "d", vim.lsp.buf.definition, lsp_keymap_opts); +vim.keymap.set("n", "i", vim.lsp.buf.implementation, lsp_keymap_opts); +vim.keymap.set("n", "r", vim.lsp.buf.references, lsp_keymap_opts); +vim.keymap.set("n", "k", vim.lsp.buf.hover, lsp_keymap_opts); diff --git a/modules/tools/neovim/plugins/config/lualine.mustache.lua b/modules/tools/neovim/plugins/config/lualine.mustache.lua new file mode 100644 index 0000000..bf4f1d1 --- /dev/null +++ b/modules/tools/neovim/plugins/config/lualine.mustache.lua @@ -0,0 +1,61 @@ +local lualine_theme = { + normal = { + a = { fg = "#{{base0D-hex}}", bg = "none", gui = "bold" }, + b = { fg = "#{{base05-hex}}", bg = "none" }, + c = { fg = "#{{base05-hex}}", bg = "none" }, + }, + insert = { + a = { fg = "#{{base0B-hex}}", bg = "none", gui = "bold" }, + }, + visual = { + a = { fg = "#{{base0E-hex}}", bg = "none", gui = "bold" }, + }, + replace = { + a = { fg = "#{{base08-hex}}", bg = "none", gui = "bold" }, + }, + command = { + a = { fg = "#{{base0A-hex}}", bg = "none", gui = "bold" }, + }, + inactive = { + a = { fg = "#{{base04-hex}}", bg = "none" }, + b = { fg = "#{{base04-hex}}", bg = "none" }, + c = { fg = "#{{base04-hex}}", bg = "none" }, + }, +}; + +local function macro_recording() + local recording_register = vim.fn.reg_recording() + if recording_register ~= "" then + return "@" .. recording_register + else + return "" + end +end + +require("lualine").setup { + options = { + icons_enabled = true, + theme = lualine_theme, + section_separators = "", + component_separators = "", + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { + "branch", + { + "diff", + colored = true, + symbols = { + added = " ", + modified = " ", + removed = " ", + } + } + }, + lualine_c = { "filename" }, + lualine_x = { macro_recording, "encoding", "fileformat", "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, +}; diff --git a/modules/tools/neovim/plugins/config/noice.mustache.lua b/modules/tools/neovim/plugins/config/noice.mustache.lua new file mode 100644 index 0000000..a258c8e --- /dev/null +++ b/modules/tools/neovim/plugins/config/noice.mustache.lua @@ -0,0 +1,10 @@ +require("noice").setup(); + +vim.api.nvim_set_hl(0, "NoiceCommandOutput", { fg = "#{{base05-hex}}", bg = "#{{base00-hex}}" }); +vim.api.nvim_set_hl(0, "NoiceCmdline", { fg = "#{{base05-hex}}", bg = "#{{base00-hex}}" }); +vim.api.nvim_set_hl(0, "NoiceCmdlinePopup", { fg = "#{{base05-hex}}", bg = "#{{base00-hex}}" }); +vim.api.nvim_set_hl(0, "NoiceCmdlinePopupBorder", { fg = "#{{base03-hex}}", bg = "#{{base00-hex}}" }); +vim.api.nvim_set_hl(0, "NoiceError", { fg = "#{{base08-hex}}", bg = "#{{base00-hex}}" }); +vim.api.nvim_set_hl(0, "NoiceWarning", { fg = "#{{base0A-hex}}", bg = "#{{base00-hex}}" }); +vim.api.nvim_set_hl(0, "NoiceInfo", { fg = "#{{base0C-hex}}", bg = "#{{base00-hex}}" }); +vim.api.nvim_set_hl(0, "NoiceHint", { fg = "#{{base0B-hex}}", bg = "#{{base00-hex}}" }); diff --git a/modules/tools/neovim/plugins/config/nvim-tree.lua b/modules/tools/neovim/plugins/config/nvim-tree.lua new file mode 100644 index 0000000..cdbef6a --- /dev/null +++ b/modules/tools/neovim/plugins/config/nvim-tree.lua @@ -0,0 +1,15 @@ +require("nvim-tree").setup { + filters = { + enable = false + }, + renderer = { + indent_markers = { + enable = true + }, + root_folder_label = function(path) + return vim.fn.fnamemodify(path, ":t") + end, + }, +}; + +vim.keymap.set("n", "", ":NvimTreeToggle", { silent = true }); diff --git a/modules/tools/neovim/plugins/config/nvim-ufo.lua b/modules/tools/neovim/plugins/config/nvim-ufo.lua new file mode 100644 index 0000000..641373f --- /dev/null +++ b/modules/tools/neovim/plugins/config/nvim-ufo.lua @@ -0,0 +1,21 @@ +require("ufo").setup { + provider_selector = function(bufnr, filetype, buftype) + return { + "treesitter", + "indent" + } + end, +}; + +vim.o.foldenable = true +vim.o.foldcolumn = '0' +vim.o.foldlevel = 99 -- Ensure all folds start open +vim.o.foldlevelstart = 99 + +-- press K or capslockK +vim.keymap.set("n", "", function() + local winid = ufo.peekFoldedLinesUnderCursor() + if not winid then + vim.lsp.buf.hover() + end +end) diff --git a/modules/tools/neovim/plugins/config/treesitter.nix b/modules/tools/neovim/plugins/config/treesitter.nix new file mode 100644 index 0000000..be0bdb6 --- /dev/null +++ b/modules/tools/neovim/plugins/config/treesitter.nix @@ -0,0 +1,13 @@ +{ config }: + +'' +require("nvim-treesitter.configs").setup { + auto_install = true, + highlight = { + enable = true, + }, + parser_install_dir = "${config.xdg.dataHome}/nvim", +}; + +vim.opt.runtimepath:append("${config.xdg.dataHome}/nvim"); +'' diff --git a/modules/tools/neovim/plugins/config/which-key.lua b/modules/tools/neovim/plugins/config/which-key.lua new file mode 100644 index 0000000..1290432 --- /dev/null +++ b/modules/tools/neovim/plugins/config/which-key.lua @@ -0,0 +1,5 @@ +local wk = require("which-key"); + +vim.keymap.set("n", "h", function() + wk.show({ global = true }) +end, { silent = true }); diff --git a/modules/tools/neovim/plugins/default.nix b/modules/tools/neovim/plugins/default.nix new file mode 100644 index 0000000..b06cb24 --- /dev/null +++ b/modules/tools/neovim/plugins/default.nix @@ -0,0 +1,31 @@ +{ config, pkgs, lib }: + +{ + configuration = import ./config { inherit config; }; + + list = with pkgs.vimPlugins; lib.mkMerge [ + [ + comment-nvim + lualine-nvim + nvim-treesitter + nvim-web-devicons + nvim-tree-lua + which-key-nvim + (base16-vim.overrideAttrs (old: { + patchPhase = "ln -s ${config.scheme base16-vim} colors/base16-scheme.vim"; + })) + ] + (if config.tools.neovim.profile == "full" then + [ + noice-nvim + dressing-nvim + nvim-lspconfig + nvim-ufo + ] + else []) + ]; + + requirements = with pkgs; [ + gcc # for treesitter + ]; +} diff --git a/modules/tools/nnn/default.nix b/modules/tools/nnn/default.nix new file mode 100644 index 0000000..298f538 --- /dev/null +++ b/modules/tools/nnn/default.nix @@ -0,0 +1,16 @@ +{ config, pkgs, lib, ... }: + +{ + options.tools.nnn = { + 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"; + }; +} diff --git a/modules/tools/system-monitor/default.nix b/modules/tools/system-monitor/default.nix deleted file mode 100644 index a5b569c..0000000 --- a/modules/tools/system-monitor/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - imports = [ - ./htop - ]; -} diff --git a/modules/tools/system-monitor/htop/default.nix b/modules/tools/system-monitor/htop/default.nix deleted file mode 100644 index c19ab60..0000000 --- a/modules/tools/system-monitor/htop/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, lib, config, ... }: - -{ - options.tools.system-monitor.htop = { - enable = lib.mkEnableOption "Enables htop."; - }; - - config = lib.mkIf config.tools.system-monitor.htop.enable { - programs.htop.enable = true; - programs.htop.package = pkgs.htop-vim; - }; -} diff --git a/modules/tools/terminal/alacritty/default.nix b/modules/tools/terminal/alacritty/default.nix deleted file mode 100644 index fa3c080..0000000 --- a/modules/tools/terminal/alacritty/default.nix +++ /dev/null @@ -1,83 +0,0 @@ -{ pkgs, config, lib, ... }: - -{ - options.tools.terminal.alacritty = { - enable = lib.mkEnableOption "Enables alacritty."; - }; - - config = lib.mkIf config.tools.terminal.alacritty.enable { - programs.alacritty.enable = true; - tools.terminal.default = lib.mkDefault "alacritty"; - tools.terminal.command = - lib.mkIf - (config.tools.terminal.default == "alacritty") - "${pkgs.alacritty}/bin/alacritty"; - - programs.alacritty.settings = { - window = { - opacity = 1.0; - padding = { - x = config.desktop.window-manager.gap; - y = config.desktop.window-manager.gap; - }; - decorations = "none"; - }; - - font = { - normal = { - family = config.fonts.normal; - style = "Retina"; - }; - bold = { - family = config.fonts.bold; - style = "Bold"; - }; - italic = { - family = config.fonts.italic; - }; - size = config.fonts.size; - }; - - colors = with config.scheme; { - primary = { - background = "0x${base00}"; - foreground = "0x${base05}"; - }; - normal = { - black = "0x${base00}"; - red = "0x${base08}"; - green = "0x${base0B}"; - yellow = "0x${base0A}"; - blue = "0x${base0D}"; - magenta = "0x${base0E}"; - cyan = "0x${base0C}"; - white = "0x${base05}"; - }; - bright = { - black = "0x${base03}"; - red = "0x${base08}"; - green = "0x${base0B}"; - yellow = "0x${base0A}"; - blue = "0x${base0D}"; - magenta = "0x${base0E}"; - cyan = "0x${base0C}"; - white = "0x${base07}"; - }; - dim = { - black = "0x${base01}"; - red = "0x${base08}"; - green = "0x${base0B}"; - yellow = "0x${base0A}"; - blue = "0x${base0D}"; - magenta = "0x${base0E}"; - cyan = "0x${base0C}"; - white = "0x${base04}"; - }; - }; - - shell = { - program = config.shell.command; - }; - }; - }; -} diff --git a/modules/tools/terminal/default.nix b/modules/tools/terminal/default.nix deleted file mode 100644 index 2e29bce..0000000 --- a/modules/tools/terminal/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ lib, ... }: - -{ - imports = [ - ./alacritty - ./kitty - ./tmux - ]; - - options.tools.terminal = { - command = lib.mkOption { - type = lib.types.str; - description = "Command for the terminal."; - }; - - default = lib.mkOption { - type = lib.types.enum [ - "kitty" - "alacritty" - ]; - description = "Default terminal."; - }; - }; -} diff --git a/modules/tools/terminal/kitty/default.nix b/modules/tools/terminal/kitty/default.nix deleted file mode 100644 index 94f013b..0000000 --- a/modules/tools/terminal/kitty/default.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ pkgs, config, lib, ... }: - -{ - options.tools.terminal.kitty = { - enable = lib.mkEnableOption "Enables kitty. WARNING! Currently faces problems with color rendering with picom."; - }; - - config = lib.mkIf config.tools.terminal.kitty.enable { - programs.kitty.enable = true; - tools.terminal.default = lib.mkDefault "kitty"; - tools.terminal.command = - lib.mkIf - (config.tools.terminal.default == "kitty") - "${pkgs.kitty}/bin/kitty"; - - programs.kitty.settings = with config.scheme.withHashtag; { - window_padding_width = config.desktop.window-manager.gap; - font_size = config.fonts.size; - font_family = config.fonts.normal; - filter_notification = "all"; - update_check_interval = 0; # disable notifications - scrollback_indicator_opacity = "0.5"; - - dynamic_background_opacity = false; - allow_remote_control = false; - enable_audio_bell = false; - - background = base00; - foreground = base05; - text_composition_strategy = "legacy"; - - color0 = base00; # Black - color8 = base00; # Black - color1 = base08; # Red - color9 = base08; # Red - color2 = base0B; # Green - color10 = base0B; # Green - color3 = base0A; # Yellow - color11 = base0A; # Yellow - color4 = base0D; # Blue - color12 = base0D; # Blue - color5 = base0E; # Magenta - color13 = base0E; # Magenta - color6 = base0C; # Cyan - color14 = base0C; # Cyan - color7 = base05; # White - color15 = base05; # White - - selection_background = base03; - selection_foreground = base00; - - shell = config.shell.command; - }; - }; -} diff --git a/modules/tools/terminal/tmux/default.nix b/modules/tools/terminal/tmux/default.nix deleted file mode 100644 index a77bbcb..0000000 --- a/modules/tools/terminal/tmux/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, config, lib, ... }: - -{ - options.tools.terminal.tmux = { - enable = lib.mkEnableOption "Enables tmus."; - }; - - config = lib.mkIf config.tools.terminal.tmux.enable { - programs.tmux.enable = true; - }; -} diff --git a/modules/tools/utils/default.nix b/modules/tools/utils/default.nix deleted file mode 100644 index 5d758fc..0000000 --- a/modules/tools/utils/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - imports = [ - ./fzf - ]; -} diff --git a/modules/tools/utils/fzf/default.nix b/modules/tools/utils/fzf/default.nix deleted file mode 100644 index e6378bc..0000000 --- a/modules/tools/utils/fzf/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ config, lib,... }: - -{ - options.tools.utils.fzf = { - enable = lib.mkEnableOption "Enables fzf."; - }; - - config = lib.mkIf config.tools.utils.fzf.enable { - programs.fzf.enable = true; - programs.fzf.defaultOptions = [ - "--height 100%" - "--layout=reverse" - ''--pointer=\"${if config.fonts.nerdfont.fira-code.enable then " " else ">"}\"'' - ''--header=\" \"'' - ''--prompt=\" \"'' - ''--marker=\"✓ \"'' - "--border=none" - "--cycle" - "--no-info" - "--margin=\"1,2\"" - ]; - - programs.fzf.colors = with config.scheme.withHashtag; { - fg = base05; # Foreground - bg = "-1"; # Background (-1 for transparent) - hl = base0D; # Highlight - - "fg+" = base07; # Foreground for selected item - "bg+" = "-1"; # Background for selected item - "hl+" = base0D; # Highlight for selected item - - gutter = "-1"; # Remove the white margin at the left - - info = base0B; # Info text (usually count of items) - border = base03; # Border color - prompt = base0A; # Prompt text color - pointer = base0F; # Pointer color (e.g., > for selected) - marker = base0C; # Marker color (e.g., for multi-select) - spinner = base0C; # Spinner color (during search) - }; - }; -} diff --git a/modules/tools/viewer/bat/default.nix b/modules/tools/viewer/bat/default.nix deleted file mode 100644 index 4d52a62..0000000 --- a/modules/tools/viewer/bat/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - options.tools.viewer.bat = { - enable = lib.mkEnableOption "Enables bat."; - }; - - config = lib.mkIf config.tools.viewer.bat.enable { - programs.bat.enable = true; - programs.bat.config = { - tabs = "4"; - theme = "custom-theme"; - }; - shell.alias."cat" = "${pkgs.bat}/bin/bat -pp"; - shell.alias."less" = "${pkgs.bat}/bin/bat --paging always"; - home.sessionVariables."PAGER" = "${pkgs.bat}/bin/bat --paging always"; - xdg.configFile."bat/themes/custom-theme.tmTheme".source - = config.scheme { - template = builtins.readFile ./theme.mustache.tmTheme; - }; - }; -} diff --git a/modules/tools/viewer/bat/theme.mustache.tmTheme b/modules/tools/viewer/bat/theme.mustache.tmTheme deleted file mode 100644 index 844b80d..0000000 --- a/modules/tools/viewer/bat/theme.mustache.tmTheme +++ /dev/null @@ -1,120 +0,0 @@ - - - - name - customTheme - settings - - - - settings - - background - #{{base00-hex}} - foreground - #{{base05-hex}} - caret - #{{base07-hex}} - invisibles - #{{base03-hex}} - lineHighlight - #{{base02-hex}} - selection - #{{base03-hex}} - - - - - - scope - comment - settings - - foreground - #{{base04-hex}} - - - - - scope - string - settings - - foreground - #{{base0A-hex}} - - - - - scope - constant.numeric - settings - - foreground - #{{base09-hex}} - - - - - scope - variable - settings - - foreground - #{{base08-hex}} - - - - - scope - keyword - settings - - foreground - #{{base0D-hex}} - - - - - scope - support.function - settings - - foreground - #{{base0E-hex}} - - - - - scope - constant.language - settings - - foreground - #{{base0B-hex}} - - - - - scope - entity.name.tag - settings - - foreground - #{{base0C-hex}} - - - - - scope - invalid - settings - - foreground - #{{base0F-hex}} - - - - - - diff --git a/modules/tools/viewer/default.nix b/modules/tools/viewer/default.nix deleted file mode 100644 index 01fd204..0000000 --- a/modules/tools/viewer/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: - -{ - imports = [ - ./bat - ./feh - ]; -} diff --git a/modules/tools/viewer/feh/default.nix b/modules/tools/viewer/feh/default.nix deleted file mode 100644 index d90e8b1..0000000 --- a/modules/tools/viewer/feh/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - options.tools.viewer.feh = { - enable = lib.mkEnableOption "Enables feh."; - }; - - config = lib.mkIf config.tools.viewer.feh.enable { - programs.feh.enable = true; - }; -} diff --git a/modules/tools/zsh/default.nix b/modules/tools/zsh/default.nix new file mode 100644 index 0000000..0f10e72 --- /dev/null +++ b/modules/tools/zsh/default.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +{ + options.tools.zsh = { + enable = lib.mkEnableOption "Enables zsh."; + }; + + config = lib.mkIf config.tools.zsh.enable { + programs.zsh.enable = true; + programs.zsh.dotDir = ".config/zsh"; + programs.zsh.history.path = "${config.xdg.cacheHome}/zsh/history"; + programs.zsh.initContent = '' +${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"; + }; +} diff --git a/modules/tools/zsh/zshrc b/modules/tools/zsh/zshrc new file mode 100644 index 0000000..3465071 --- /dev/null +++ b/modules/tools/zsh/zshrc @@ -0,0 +1,23 @@ +setopt PROMPT_SUBST + +autoload -U colors && colors + +autoload -Uz vcs_info +precmd() { vcs_info } + +zstyle ':vcs_info:git:*' formats '%F{red}┄[%F{cyan}%b%c%F{blue}%a%F{red}]' +zstyle ':vcs_info:git:*' actionformats '%F{red}┄[%F{cyan}%b%c%F{blue}%a%F{red}]' + +zstyle ':vcs_info:*+set-message:*' hooks git-untracked git-dirty + +zstyle ':vcs_info:git:*' check-for-changes true +zstyle ':vcs_info:git:*' stagedstr ' %F{green}✓%f' +zstyle ':vcs_info:git:*' unstagedstr ' %F{red}✗%f' +zstyle ':vcs_info:git:*' aheadstr ' %F{blue}⬆%f' +zstyle ':vcs_info:git:*' behindstr ' %F{yellow}⬇%f' + +PROMPT='%F{red}╭──[%F{green}%m%F{red}@%F{blue}%n%F{red}]┄[%F{magenta}%~%F{red}]${vcs_info_msg_0_}%(?..%F{red}┄[%F{white}Exit status: %F{yellow}%?%F{red}] ) +╰─>%f ' + +bindkey "^[[3~" delete-char +bindkey "^?" backward-delete-char -- cgit v1.2.3