From 170461002890d55718618bec64feaa8856c3a6d4 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:01:27 +0530 Subject: Organised the configuration to allow for different options for different users. --- flake.nix | 15 +++-- home.nix | 40 ----------- modules/default.nix | 2 +- modules/desktop/bspwm/default.nix | 42 ++++++++++++ modules/desktop/default.nix | 28 ++++++++ modules/desktop/polybar/bar/default.nix | 5 ++ modules/desktop/polybar/bar/main.nix | 44 +++++++++++++ modules/desktop/polybar/default.nix | 20 ++++++ modules/desktop/polybar/module/battery.nix | 36 ++++++++++ modules/desktop/polybar/module/bspwm.nix | 21 ++++++ modules/desktop/polybar/module/cpu.nix | 9 +++ modules/desktop/polybar/module/date.nix | 10 +++ modules/desktop/polybar/module/default.nix | 13 ++++ modules/desktop/polybar/module/memory.nix | 9 +++ modules/desktop/polybar/module/separator.nix | 7 ++ modules/desktop/polybar/module/time.nix | 10 +++ modules/desktop/polybar/module/volume.nix | 13 ++++ modules/desktop/polybar/module/xwindow.nix | 7 ++ modules/desktop/sxhkd/default.nix | 41 ++++++++++++ .../desktop/sxhkd/keybindings/brightnessctl.nix | 15 +++++ modules/desktop/sxhkd/keybindings/bspwm.nix | 45 +++++++++++++ modules/desktop/sxhkd/keybindings/pamixer.nix | 20 ++++++ modules/desktop/sxhkd/keybindings/playerctl.nix | 10 +++ modules/desktop/sxhkd/scripts/keybindings.sh | 77 ++++++++++++++++++++++ modules/fonts/default.nix | 14 ++-- modules/fonts/nerdfont/default.nix | 7 -- modules/fonts/nerdfont/fira-code/default.nix | 15 ----- modules/graphical/bspwm/default.nix | 42 ------------ modules/graphical/default.nix | 28 -------- modules/graphical/polybar/bar/default.nix | 5 -- modules/graphical/polybar/bar/main.nix | 44 ------------- modules/graphical/polybar/default.nix | 20 ------ modules/graphical/polybar/module/battery.nix | 36 ---------- modules/graphical/polybar/module/bspwm.nix | 21 ------ modules/graphical/polybar/module/cpu.nix | 9 --- modules/graphical/polybar/module/date.nix | 10 --- modules/graphical/polybar/module/default.nix | 13 ---- modules/graphical/polybar/module/memory.nix | 9 --- modules/graphical/polybar/module/separator.nix | 7 -- modules/graphical/polybar/module/time.nix | 10 --- modules/graphical/polybar/module/volume.nix | 13 ---- modules/graphical/polybar/module/xwindow.nix | 7 -- modules/graphical/sxhkd/default.nix | 41 ------------ .../graphical/sxhkd/keybindings/brightnessctl.nix | 15 ----- modules/graphical/sxhkd/keybindings/bspwm.nix | 45 ------------- modules/graphical/sxhkd/keybindings/pamixer.nix | 20 ------ modules/graphical/sxhkd/keybindings/playerctl.nix | 10 --- modules/graphical/sxhkd/scripts/keybindings.sh | 77 ---------------------- modules/tools/fzf/default.nix | 2 +- users/arpit.nix | 37 +++++++++++ 50 files changed, 538 insertions(+), 558 deletions(-) delete mode 100644 home.nix create mode 100644 modules/desktop/bspwm/default.nix create mode 100644 modules/desktop/default.nix create mode 100644 modules/desktop/polybar/bar/default.nix create mode 100644 modules/desktop/polybar/bar/main.nix create mode 100644 modules/desktop/polybar/default.nix create mode 100644 modules/desktop/polybar/module/battery.nix create mode 100644 modules/desktop/polybar/module/bspwm.nix create mode 100644 modules/desktop/polybar/module/cpu.nix create mode 100644 modules/desktop/polybar/module/date.nix create mode 100644 modules/desktop/polybar/module/default.nix create mode 100644 modules/desktop/polybar/module/memory.nix create mode 100644 modules/desktop/polybar/module/separator.nix create mode 100644 modules/desktop/polybar/module/time.nix create mode 100644 modules/desktop/polybar/module/volume.nix create mode 100644 modules/desktop/polybar/module/xwindow.nix create mode 100644 modules/desktop/sxhkd/default.nix create mode 100644 modules/desktop/sxhkd/keybindings/brightnessctl.nix create mode 100644 modules/desktop/sxhkd/keybindings/bspwm.nix create mode 100644 modules/desktop/sxhkd/keybindings/pamixer.nix create mode 100644 modules/desktop/sxhkd/keybindings/playerctl.nix create mode 100755 modules/desktop/sxhkd/scripts/keybindings.sh delete mode 100644 modules/fonts/nerdfont/default.nix delete mode 100644 modules/fonts/nerdfont/fira-code/default.nix delete mode 100644 modules/graphical/bspwm/default.nix delete mode 100644 modules/graphical/default.nix delete mode 100644 modules/graphical/polybar/bar/default.nix delete mode 100644 modules/graphical/polybar/bar/main.nix delete mode 100644 modules/graphical/polybar/default.nix delete mode 100644 modules/graphical/polybar/module/battery.nix delete mode 100644 modules/graphical/polybar/module/bspwm.nix delete mode 100644 modules/graphical/polybar/module/cpu.nix delete mode 100644 modules/graphical/polybar/module/date.nix delete mode 100644 modules/graphical/polybar/module/default.nix delete mode 100644 modules/graphical/polybar/module/memory.nix delete mode 100644 modules/graphical/polybar/module/separator.nix delete mode 100644 modules/graphical/polybar/module/time.nix delete mode 100644 modules/graphical/polybar/module/volume.nix delete mode 100644 modules/graphical/polybar/module/xwindow.nix delete mode 100644 modules/graphical/sxhkd/default.nix delete mode 100644 modules/graphical/sxhkd/keybindings/brightnessctl.nix delete mode 100644 modules/graphical/sxhkd/keybindings/bspwm.nix delete mode 100644 modules/graphical/sxhkd/keybindings/pamixer.nix delete mode 100644 modules/graphical/sxhkd/keybindings/playerctl.nix delete mode 100755 modules/graphical/sxhkd/scripts/keybindings.sh create mode 100644 users/arpit.nix diff --git a/flake.nix b/flake.nix index 85a123c..670de5f 100644 --- a/flake.nix +++ b/flake.nix @@ -14,15 +14,15 @@ }; }; - outputs = { nixpkgs, home-manager, base16, ... }@inputs: - let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - in { - homeConfigurations."arpit" = home-manager.lib.homeManagerConfiguration { + outputs = { nixpkgs, home-manager, base16, ... }@inputs: { + homeConfigurations = { + arpit = let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + in home-manager.lib.homeManagerConfiguration { inherit pkgs; modules = [ - ./home.nix + ./users/arpit.nix ./modules base16.homeManagerModule { @@ -31,4 +31,5 @@ ]; }; }; + }; } diff --git a/home.nix b/home.nix deleted file mode 100644 index 1e3ca50..0000000 --- a/home.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ config, ... }: - -{ - home.username = "arpit"; - home.homeDirectory = "/home/${config.home.username}"; - home.stateVersion = "25.05"; - - # Fonts - fonts.nerdfont.fira-code.enable = true; - - # Graphics - graphical.enable = true; - - # Enable scripts - scripts.enable = true; - - # Tools - tools.acpi.enable = true; - tools.bat.enable = true; - tools.brave.enable = true; - tools.brightnessctl.enable = true; - tools.feh.enable = true; - tools.fzf.enable = true; - tools.git.enable = true; - tools.git.username = "Arpit Chakladar"; - tools.git.email = "54011232+arpitchakladar@users.noreply.github.com"; - tools.htop.enable = true; - tools.kitty.enable = true; - tools.lsd.enable = true; - tools.neofetch.enable = true; - tools.neovim.enable = true; - tools.neovim.profile = "full"; - tools.nnn.enable = true; - tools.pamixer.enable = true; - tools.playerctl.enable = true; - tools.rofi.enable = true; - tools.zsh.enable = true; - - programs.home-manager.enable = true; -} diff --git a/modules/default.nix b/modules/default.nix index f4628a2..86dbd62 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -2,8 +2,8 @@ { imports = [ + ./desktop ./fonts - ./graphical ./scripts ./tools ]; diff --git a/modules/desktop/bspwm/default.nix b/modules/desktop/bspwm/default.nix new file mode 100644 index 0000000..d402035 --- /dev/null +++ b/modules/desktop/bspwm/default.nix @@ -0,0 +1,42 @@ +{ config, lib, pkgs, ... }: + +{ + config = lib.mkIf config.desktop.enable { + xsession.windowManager.bspwm.enable = true; + + xsession.windowManager.bspwm.settings = with config.scheme.withHashtag; { + window_gap = 10; + 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 = "mod4"; + 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 = '' +for monitor in $(xrandr -q | grep -w 'connected' | cut -d' ' -f1); do + bspc monitor "$monitor" -d '1' '2' '3' '4' '5' '6' +done +polybar-msg cmd restart + ''; + }; +} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix new file mode 100644 index 0000000..dbb8087 --- /dev/null +++ b/modules/desktop/default.nix @@ -0,0 +1,28 @@ +{ lib, config, pkgs, ... }: + +{ + imports = [ + ./bspwm + ./polybar + ./sxhkd + ]; + + options.desktop = { + enable = lib.mkEnableOption "Enables graphical interface."; + }; + + config = lib.mkIf config.desktop.enable { + xdg.enable = true; + xsession.enable = true; + + xsession.windowManager.command = lib.mkForce " +#!/bin/sh +${if config.tools.feh.enable then + "${pkgs.feh}/bin/feh --bg-scale ${../../assets/skeleton-mage.png}" +else "xsetroot -solid \"${config.scheme.withHashtag.base00}\""} +pkill sxhkd +sxhkd & +exec ${pkgs.bspwm}/bin/bspwm +"; + }; +} diff --git a/modules/desktop/polybar/bar/default.nix b/modules/desktop/polybar/bar/default.nix new file mode 100644 index 0000000..23a43c4 --- /dev/null +++ b/modules/desktop/polybar/bar/default.nix @@ -0,0 +1,5 @@ +{ config, lib }: + +{ + "bar/main" = import ./main.nix { inherit config lib; }; +} diff --git a/modules/desktop/polybar/bar/main.nix b/modules/desktop/polybar/bar/main.nix new file mode 100644 index 0000000..326b768 --- /dev/null +++ b/modules/desktop/polybar/bar/main.nix @@ -0,0 +1,44 @@ +{ config, lib }: + +with config.scheme.withHashtag; +let + largerFontSize = toString (builtins.ceil (config.fonts.size * 9.0 / 8.0)); +in { + width = "100%:-20"; + fixed-center = false; + height = 35; + override-redirect = false; + wm-restack = "bspwm"; + enable-ipc = true; + + 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 = "10"; + offset-y = "10"; + + 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 = "bspwm separator"; + modules-center = "xwindow"; + modules-right = "separator volume battery time memory cpu date"; +} diff --git a/modules/desktop/polybar/default.nix b/modules/desktop/polybar/default.nix new file mode 100644 index 0000000..de95a49 --- /dev/null +++ b/modules/desktop/polybar/default.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: + +{ + config = lib.mkIf config.desktop.enable { + services.polybar.enable = true; + services.polybar.package = (pkgs.polybar.override { + pulseSupport = true; + }); + services.polybar.script = "${config.services.polybar.package}/bin/polybar main &"; + services.polybar.config = lib.mkMerge [ + (import ./bar { inherit config lib; }) + (import ./module { inherit config lib; }) + { + settings = { + screenchange-reload = true; + }; + } + ]; + }; +} diff --git a/modules/desktop/polybar/module/battery.nix b/modules/desktop/polybar/module/battery.nix new file mode 100644 index 0000000..5787f24 --- /dev/null +++ b/modules/desktop/polybar/module/battery.nix @@ -0,0 +1,36 @@ +{ config }: + +with config.scheme.withHashtag; +{ + type = "internal/battery"; + battery = "BAT1"; + 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/polybar/module/bspwm.nix b/modules/desktop/polybar/module/bspwm.nix new file mode 100644 index 0000000..ed82946 --- /dev/null +++ b/modules/desktop/polybar/module/bspwm.nix @@ -0,0 +1,21 @@ +{ 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/polybar/module/cpu.nix b/modules/desktop/polybar/module/cpu.nix new file mode 100644 index 0000000..8134df1 --- /dev/null +++ b/modules/desktop/polybar/module/cpu.nix @@ -0,0 +1,9 @@ +{ config }: + +with config.scheme.withHashtag; +{ + type = "internal/cpu"; + interval = 2; + format-prefix = "%{T2}%{F${base03}} %{F-}%{T-}"; + label = "%percentage%%"; +} diff --git a/modules/desktop/polybar/module/date.nix b/modules/desktop/polybar/module/date.nix new file mode 100644 index 0000000..9c56121 --- /dev/null +++ b/modules/desktop/polybar/module/date.nix @@ -0,0 +1,10 @@ +{ 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/polybar/module/default.nix b/modules/desktop/polybar/module/default.nix new file mode 100644 index 0000000..fe5b8a1 --- /dev/null +++ b/modules/desktop/polybar/module/default.nix @@ -0,0 +1,13 @@ +{ config, lib }: + +{ + "module/separator" = import ./separator.nix { inherit config; }; + "module/xwindow" = import ./xwindow.nix { inherit config; }; + "module/bspwm" = import ./bspwm.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/volume" = import ./volume.nix { inherit config; }; + "module/battery" = import ./battery.nix { inherit config; }; +} diff --git a/modules/desktop/polybar/module/memory.nix b/modules/desktop/polybar/module/memory.nix new file mode 100644 index 0000000..a4aa410 --- /dev/null +++ b/modules/desktop/polybar/module/memory.nix @@ -0,0 +1,9 @@ +{ config }: + +with config.scheme.withHashtag; +{ + type = "internal/memory"; + interval = 2; + format-prefix = "%{T2}%{F${base03}} %{F-}%{T-}"; + label = "%gb_used%"; +} diff --git a/modules/desktop/polybar/module/separator.nix b/modules/desktop/polybar/module/separator.nix new file mode 100644 index 0000000..3cd1430 --- /dev/null +++ b/modules/desktop/polybar/module/separator.nix @@ -0,0 +1,7 @@ +{ config }: + +with config.scheme.withHashtag; +{ + type = "custom/text"; + label = " "; +} diff --git a/modules/desktop/polybar/module/time.nix b/modules/desktop/polybar/module/time.nix new file mode 100644 index 0000000..71df1a5 --- /dev/null +++ b/modules/desktop/polybar/module/time.nix @@ -0,0 +1,10 @@ +{ 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/polybar/module/volume.nix b/modules/desktop/polybar/module/volume.nix new file mode 100644 index 0000000..ee18dc0 --- /dev/null +++ b/modules/desktop/polybar/module/volume.nix @@ -0,0 +1,13 @@ +{ config }: + +with config.scheme.withHashtag; +{ + type = "internal/pulseaudio"; + interval = 5; + format-volume = "%{T2}%{F${base03}}%{F-}%{T-} "; + label-volume = "%percentage%%"; + label-muted = "%{T2}%{F${base03}} "; + ramp-volume-0 = " "; + ramp-volume-1 = " "; + ramp-volume-2 = " "; +} diff --git a/modules/desktop/polybar/module/xwindow.nix b/modules/desktop/polybar/module/xwindow.nix new file mode 100644 index 0000000..833899e --- /dev/null +++ b/modules/desktop/polybar/module/xwindow.nix @@ -0,0 +1,7 @@ +{ config }: + +with config.scheme.withHashtag; +{ + type = "internal/xwindow"; + label = "%title:0:30:...%"; +} diff --git a/modules/desktop/sxhkd/default.nix b/modules/desktop/sxhkd/default.nix new file mode 100644 index 0000000..8d0e6de --- /dev/null +++ b/modules/desktop/sxhkd/default.nix @@ -0,0 +1,41 @@ +{ pkgs, config, lib, ... }: + +{ + config = lib.mkIf config.desktop.enable { + services.sxhkd.enable = true; + services.sxhkd.keybindings = + let + modKey = "super"; + createKeybinding = keybinding: createKeybindingBase "${modKey} + ${keybinding}"; + createKeybindingBase = keybinding: description: command: { + "# ${description}\n${keybinding}" = command; + }; + in lib.mkMerge [ + (import ./keybindings/brightnessctl.nix { inherit pkgs createKeybindingBase lib; }) + (import ./keybindings/bspwm.nix { inherit pkgs createKeybinding lib; }) + (import ./keybindings/pamixer.nix { inherit pkgs createKeybindingBase lib; }) + (import ./keybindings/playerctl.nix { inherit pkgs createKeybindingBase lib; }) + + (createKeybinding + "s" + "Show keybindings." + "kitty --title 'Keybindings' --class floating-termial -e ${pkgs.writeShellScript "keybindings.sh" (builtins.readFile ./scripts/keybindings.sh)}" + ) + + (createKeybinding + "r" + "Application launcher." + "rofi -show drun") + + (createKeybinding + "t" + "Launch terminal." + "kitty") + + (createKeybinding + "f" + "Launch File Manager." + "kitty --title 'File Manager' --class floating-termial -e nnn") + ]; + }; +} diff --git a/modules/desktop/sxhkd/keybindings/brightnessctl.nix b/modules/desktop/sxhkd/keybindings/brightnessctl.nix new file mode 100644 index 0000000..acb4ea2 --- /dev/null +++ b/modules/desktop/sxhkd/keybindings/brightnessctl.nix @@ -0,0 +1,15 @@ +{ createKeybindingBase, pkgs, lib }: + +let + brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; +in lib.mkMerge [ + (createKeybindingBase + "XF86MonBrightnessDown" + "Decrease brightness." + "${brightnessctl} set 5%-") + + (createKeybindingBase + "XF86MonBrightnessUp" + "Increase brightness." + "${brightnessctl} set +5%") +] diff --git a/modules/desktop/sxhkd/keybindings/bspwm.nix b/modules/desktop/sxhkd/keybindings/bspwm.nix new file mode 100644 index 0000000..ed62ed4 --- /dev/null +++ b/modules/desktop/sxhkd/keybindings/bspwm.nix @@ -0,0 +1,45 @@ +{ 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/sxhkd/keybindings/pamixer.nix b/modules/desktop/sxhkd/keybindings/pamixer.nix new file mode 100644 index 0000000..3543d8f --- /dev/null +++ b/modules/desktop/sxhkd/keybindings/pamixer.nix @@ -0,0 +1,20 @@ +{ createKeybindingBase, pkgs, lib }: + +let + pamixer = "${pkgs.pamixer}/bin/pamixer"; +in lib.mkMerge [ + (createKeybindingBase + "XF86AudioLowerVolume" + "Decrease volume." + "${pamixer} --decrease 5") + + (createKeybindingBase + "XF86AudioRaiseVolume" + "Increase volume." + "${pamixer} --increase 5") + + (createKeybindingBase + "XF86AudioMute" + "Mute audio." + "${pamixer} --toggle-mute") +] diff --git a/modules/desktop/sxhkd/keybindings/playerctl.nix b/modules/desktop/sxhkd/keybindings/playerctl.nix new file mode 100644 index 0000000..3e5c4e0 --- /dev/null +++ b/modules/desktop/sxhkd/keybindings/playerctl.nix @@ -0,0 +1,10 @@ +{ createKeybindingBase, pkgs, lib }: + +let + playerctl = "${pkgs.playerctl}/bin/playerctl"; +in lib.mkMerge [ + (createKeybindingBase + "XF86AudioPlay" + "Toggle video / audio player." + "${playerctl} play-pause") +] diff --git a/modules/desktop/sxhkd/scripts/keybindings.sh b/modules/desktop/sxhkd/scripts/keybindings.sh new file mode 100755 index 0000000..01bb05f --- /dev/null +++ b/modules/desktop/sxhkd/scripts/keybindings.sh @@ -0,0 +1,77 @@ +#!/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/fonts/default.nix b/modules/fonts/default.nix index c5d552c..eee825d 100644 --- a/modules/fonts/default.nix +++ b/modules/fonts/default.nix @@ -1,10 +1,6 @@ -{ lib, config, ... }: +{ lib, config, pkgs, ... }: { - imports = [ - ./nerdfont - ]; - options.fonts = { normal = lib.mkOption { type = lib.types.str; @@ -29,4 +25,12 @@ default = 16; }; }; + + config = { + fonts.normal = lib.mkDefault "Fira Code Nerd Font"; + + home.packages = with pkgs; [ + nerd-fonts.fira-code + ]; + }; } diff --git a/modules/fonts/nerdfont/default.nix b/modules/fonts/nerdfont/default.nix deleted file mode 100644 index d3bbc9b..0000000 --- a/modules/fonts/nerdfont/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - imports = [ - ./fira-code - ]; -} diff --git a/modules/fonts/nerdfont/fira-code/default.nix b/modules/fonts/nerdfont/fira-code/default.nix deleted file mode 100644 index 9b66183..0000000 --- a/modules/fonts/nerdfont/fira-code/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ lib, config, pkgs, ... }: - -{ - options.fonts.nerdfont.fira-code = { - enable = lib.mkEnableOption "Enables fira code nerd font."; - }; - - config = lib.mkIf config.fonts.nerdfont.fira-code.enable { - fonts.normal = lib.mkDefault "Fira Code Nerd Font"; - - home.packages = with pkgs; [ - nerd-fonts.fira-code - ]; - }; -} diff --git a/modules/graphical/bspwm/default.nix b/modules/graphical/bspwm/default.nix deleted file mode 100644 index f334290..0000000 --- a/modules/graphical/bspwm/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - config = lib.mkIf config.graphical.enable { - xsession.windowManager.bspwm.enable = true; - - xsession.windowManager.bspwm.settings = with config.scheme.withHashtag; { - window_gap = 10; - 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 = "mod4"; - 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 = '' -for monitor in $(xrandr -q | grep -w 'connected' | cut -d' ' -f1); do - bspc monitor "$monitor" -d '1' '2' '3' '4' '5' '6' -done -polybar-msg cmd restart - ''; - }; -} diff --git a/modules/graphical/default.nix b/modules/graphical/default.nix deleted file mode 100644 index 9e18ce0..0000000 --- a/modules/graphical/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ lib, config, pkgs, ... }: - -{ - imports = [ - ./bspwm - ./polybar - ./sxhkd - ]; - - options.graphical = { - enable = lib.mkEnableOption "Enables graphical interface."; - }; - - config = lib.mkIf config.graphical.enable { - xdg.enable = true; - xsession.enable = true; - - xsession.windowManager.command = lib.mkForce " -#!/bin/sh -${if config.tools.feh.enable then - "${pkgs.feh}/bin/feh --bg-scale ${../../assets/skeleton-mage.png}" -else "xsetroot -solid \"${config.scheme.withHashtag.base00}\""} -pkill sxhkd -sxhkd & -exec ${pkgs.bspwm}/bin/bspwm -"; - }; -} diff --git a/modules/graphical/polybar/bar/default.nix b/modules/graphical/polybar/bar/default.nix deleted file mode 100644 index 23a43c4..0000000 --- a/modules/graphical/polybar/bar/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, lib }: - -{ - "bar/main" = import ./main.nix { inherit config lib; }; -} diff --git a/modules/graphical/polybar/bar/main.nix b/modules/graphical/polybar/bar/main.nix deleted file mode 100644 index 326b768..0000000 --- a/modules/graphical/polybar/bar/main.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ config, lib }: - -with config.scheme.withHashtag; -let - largerFontSize = toString (builtins.ceil (config.fonts.size * 9.0 / 8.0)); -in { - width = "100%:-20"; - fixed-center = false; - height = 35; - override-redirect = false; - wm-restack = "bspwm"; - enable-ipc = true; - - 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 = "10"; - offset-y = "10"; - - 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 = "bspwm separator"; - modules-center = "xwindow"; - modules-right = "separator volume battery time memory cpu date"; -} diff --git a/modules/graphical/polybar/default.nix b/modules/graphical/polybar/default.nix deleted file mode 100644 index d96c2ae..0000000 --- a/modules/graphical/polybar/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - config = lib.mkIf config.graphical.enable { - services.polybar.enable = true; - services.polybar.package = (pkgs.polybar.override { - pulseSupport = true; - }); - services.polybar.script = "${config.services.polybar.package}/bin/polybar main &"; - services.polybar.config = lib.mkMerge [ - (import ./bar { inherit config lib; }) - (import ./module { inherit config lib; }) - { - settings = { - screenchange-reload = true; - }; - } - ]; - }; -} diff --git a/modules/graphical/polybar/module/battery.nix b/modules/graphical/polybar/module/battery.nix deleted file mode 100644 index 5787f24..0000000 --- a/modules/graphical/polybar/module/battery.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ config }: - -with config.scheme.withHashtag; -{ - type = "internal/battery"; - battery = "BAT1"; - 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/graphical/polybar/module/bspwm.nix b/modules/graphical/polybar/module/bspwm.nix deleted file mode 100644 index ed82946..0000000 --- a/modules/graphical/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/graphical/polybar/module/cpu.nix b/modules/graphical/polybar/module/cpu.nix deleted file mode 100644 index 8134df1..0000000 --- a/modules/graphical/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/graphical/polybar/module/date.nix b/modules/graphical/polybar/module/date.nix deleted file mode 100644 index 9c56121..0000000 --- a/modules/graphical/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/graphical/polybar/module/default.nix b/modules/graphical/polybar/module/default.nix deleted file mode 100644 index fe5b8a1..0000000 --- a/modules/graphical/polybar/module/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, lib }: - -{ - "module/separator" = import ./separator.nix { inherit config; }; - "module/xwindow" = import ./xwindow.nix { inherit config; }; - "module/bspwm" = import ./bspwm.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/volume" = import ./volume.nix { inherit config; }; - "module/battery" = import ./battery.nix { inherit config; }; -} diff --git a/modules/graphical/polybar/module/memory.nix b/modules/graphical/polybar/module/memory.nix deleted file mode 100644 index a4aa410..0000000 --- a/modules/graphical/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 = "%gb_used%"; -} diff --git a/modules/graphical/polybar/module/separator.nix b/modules/graphical/polybar/module/separator.nix deleted file mode 100644 index 3cd1430..0000000 --- a/modules/graphical/polybar/module/separator.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config }: - -with config.scheme.withHashtag; -{ - type = "custom/text"; - label = " "; -} diff --git a/modules/graphical/polybar/module/time.nix b/modules/graphical/polybar/module/time.nix deleted file mode 100644 index 71df1a5..0000000 --- a/modules/graphical/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/graphical/polybar/module/volume.nix b/modules/graphical/polybar/module/volume.nix deleted file mode 100644 index ee18dc0..0000000 --- a/modules/graphical/polybar/module/volume.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config }: - -with config.scheme.withHashtag; -{ - type = "internal/pulseaudio"; - interval = 5; - format-volume = "%{T2}%{F${base03}}%{F-}%{T-} "; - label-volume = "%percentage%%"; - label-muted = "%{T2}%{F${base03}} "; - ramp-volume-0 = " "; - ramp-volume-1 = " "; - ramp-volume-2 = " "; -} diff --git a/modules/graphical/polybar/module/xwindow.nix b/modules/graphical/polybar/module/xwindow.nix deleted file mode 100644 index 833899e..0000000 --- a/modules/graphical/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/graphical/sxhkd/default.nix b/modules/graphical/sxhkd/default.nix deleted file mode 100644 index 5746394..0000000 --- a/modules/graphical/sxhkd/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ pkgs, config, lib, ... }: - -{ - config = lib.mkIf config.graphical.enable { - services.sxhkd.enable = true; - services.sxhkd.keybindings = - let - modKey = "super"; - createKeybinding = keybinding: createKeybindingBase "${modKey} + ${keybinding}"; - createKeybindingBase = keybinding: description: command: { - "# ${description}\n${keybinding}" = command; - }; - in lib.mkMerge [ - (import ./keybindings/brightnessctl.nix { inherit pkgs createKeybindingBase lib; }) - (import ./keybindings/bspwm.nix { inherit pkgs createKeybinding lib; }) - (import ./keybindings/pamixer.nix { inherit pkgs createKeybindingBase lib; }) - (import ./keybindings/playerctl.nix { inherit pkgs createKeybindingBase lib; }) - - (createKeybinding - "s" - "Show keybindings." - "kitty --title 'Keybindings' --class floating-termial -e ${pkgs.writeShellScript "keybindings.sh" (builtins.readFile ./scripts/keybindings.sh)}" - ) - - (createKeybinding - "r" - "Application launcher." - "rofi -show drun") - - (createKeybinding - "t" - "Launch terminal." - "kitty") - - (createKeybinding - "f" - "Launch File Manager." - "kitty --title 'File Manager' --class floating-termial -e nnn") - ]; - }; -} diff --git a/modules/graphical/sxhkd/keybindings/brightnessctl.nix b/modules/graphical/sxhkd/keybindings/brightnessctl.nix deleted file mode 100644 index acb4ea2..0000000 --- a/modules/graphical/sxhkd/keybindings/brightnessctl.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ createKeybindingBase, pkgs, lib }: - -let - brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; -in lib.mkMerge [ - (createKeybindingBase - "XF86MonBrightnessDown" - "Decrease brightness." - "${brightnessctl} set 5%-") - - (createKeybindingBase - "XF86MonBrightnessUp" - "Increase brightness." - "${brightnessctl} set +5%") -] diff --git a/modules/graphical/sxhkd/keybindings/bspwm.nix b/modules/graphical/sxhkd/keybindings/bspwm.nix deleted file mode 100644 index ed62ed4..0000000 --- a/modules/graphical/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/graphical/sxhkd/keybindings/pamixer.nix b/modules/graphical/sxhkd/keybindings/pamixer.nix deleted file mode 100644 index 3543d8f..0000000 --- a/modules/graphical/sxhkd/keybindings/pamixer.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ createKeybindingBase, pkgs, lib }: - -let - pamixer = "${pkgs.pamixer}/bin/pamixer"; -in lib.mkMerge [ - (createKeybindingBase - "XF86AudioLowerVolume" - "Decrease volume." - "${pamixer} --decrease 5") - - (createKeybindingBase - "XF86AudioRaiseVolume" - "Increase volume." - "${pamixer} --increase 5") - - (createKeybindingBase - "XF86AudioMute" - "Mute audio." - "${pamixer} --toggle-mute") -] diff --git a/modules/graphical/sxhkd/keybindings/playerctl.nix b/modules/graphical/sxhkd/keybindings/playerctl.nix deleted file mode 100644 index 3e5c4e0..0000000 --- a/modules/graphical/sxhkd/keybindings/playerctl.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ createKeybindingBase, pkgs, lib }: - -let - playerctl = "${pkgs.playerctl}/bin/playerctl"; -in lib.mkMerge [ - (createKeybindingBase - "XF86AudioPlay" - "Toggle video / audio player." - "${playerctl} play-pause") -] diff --git a/modules/graphical/sxhkd/scripts/keybindings.sh b/modules/graphical/sxhkd/scripts/keybindings.sh deleted file mode 100755 index 01bb05f..0000000 --- a/modules/graphical/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/tools/fzf/default.nix b/modules/tools/fzf/default.nix index 169a07f..9fc9457 100644 --- a/modules/tools/fzf/default.nix +++ b/modules/tools/fzf/default.nix @@ -10,7 +10,7 @@ programs.fzf.defaultOptions = [ "--height 100%" "--layout=reverse" - ''--pointer=\"${if config.fonts.nerdfont.fira-code.enable then " " else ">"}\"'' + ''--pointer=\" \"'' ''--header=\" \"'' ''--prompt=\" \"'' ''--marker=\"✓ \"'' diff --git a/users/arpit.nix b/users/arpit.nix new file mode 100644 index 0000000..de6136e --- /dev/null +++ b/users/arpit.nix @@ -0,0 +1,37 @@ +{ config, ... }: + +{ + home.username = "arpit"; + home.homeDirectory = "/home/${config.home.username}"; + home.stateVersion = "25.05"; + + # Desktop environment + desktop.enable = true; + + # Enable scripts + scripts.enable = true; + + # Tools + tools.acpi.enable = true; + tools.bat.enable = true; + tools.brave.enable = true; + tools.brightnessctl.enable = true; + tools.feh.enable = true; + tools.fzf.enable = true; + tools.git.enable = true; + tools.git.username = "Arpit Chakladar"; + tools.git.email = "54011232+arpitchakladar@users.noreply.github.com"; + tools.htop.enable = true; + tools.kitty.enable = true; + tools.lsd.enable = true; + tools.neofetch.enable = true; + tools.neovim.enable = true; + tools.neovim.profile = "full"; + tools.nnn.enable = true; + tools.pamixer.enable = true; + tools.playerctl.enable = true; + tools.rofi.enable = true; + tools.zsh.enable = true; + + programs.home-manager.enable = true; +} -- cgit v1.2.3