refactor: clean up

This commit is contained in:
Mohammad Rafiq 2025-03-12 03:49:11 +08:00
parent 45c4e136c4
commit 630b3ce27b
25 changed files with 195 additions and 210 deletions

View file

@ -1,9 +1,9 @@
{
# direnv lets us declare a .envrc in each project directory
# and updates the shell with the packages specified.
programs.direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
# direnv lets us declare a .envrc in each project directory
# and updates the shell with the packages specified.
programs.direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
}

View file

@ -2,10 +2,10 @@
fonts = {
fontconfig = {
enable = true;
defaultFonts.emoji = [ "Terminess Nerd Font" ];
defaultFonts.monospace = [ "Terminess Nerd Font Mono" ];
defaultFonts.sansSerif = [ "Terminess Nerd Font" ];
defaultFonts.serif = [ "Terminess Nerd Font" ];
defaultFonts.emoji = ["Terminess Nerd Font"];
defaultFonts.monospace = ["Terminess Nerd Font Mono"];
defaultFonts.sansSerif = ["Terminess Nerd Font"];
defaultFonts.serif = ["Terminess Nerd Font"];
};
};
}

View file

@ -1,4 +1,8 @@
{ config, lib, ... }: {
{
config,
lib,
...
}: {
home.sessionVariables.NIXOS_OZONE_WL = "1";
wayland.windowManager.hyprland = {
enable = true;
@ -6,19 +10,19 @@
portalPackage = null;
settings = {
env = [
"XCURSOR_SIZE,32"
"XCURSOR_SIZE,32"
# Nvidia Settings
"LIBVA_DRIVER_NAME,nvidia"
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
"NVD_BACKEND,direct # needed for running vaapi-driver on later drivers"
# Nvidia Settings
"LIBVA_DRIVER_NAME,nvidia"
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
"NVD_BACKEND,direct # needed for running vaapi-driver on later drivers"
];
# Monitors
monitor = [
"HDMI-A-2, 3840x2160@60, 0x0, 2.5"
"DP-4, 1920x1080@60, -1280x0, 1.5"
", preferred, auto, 1"
"HDMI-A-2, 3840x2160@60, 0x0, 2.5"
"DP-4, 1920x1080@60, -1280x0, 1.5"
", preferred, auto, 1"
];
# Switching to the current workspace will switch to the previous
@ -27,17 +31,17 @@
# Windows
general = {
# Make there be no gaps in between windows or edges
border_size = 5;
gaps_in = 0;
gaps_out = 0;
# Make there be no gaps in between windows or edges
border_size = 5;
gaps_in = 0;
gaps_out = 0;
resize_on_border = true;
resize_on_border = true;
};
# Programs
exec-once = [
"waybar"
"waybar"
];
# Keybinds
@ -46,32 +50,32 @@
"$browser" = "firefox";
bind = [
"$mainMod, Q, exec, $terminal"
"$mainMod, W, killactive"
"$mainMod, E, exec, $browser"
"$mainMod, M, exit"
"$mainMod, Q, exec, $terminal"
"$mainMod, W, killactive"
"$mainMod, E, exec, $browser"
"$mainMod, M, exit"
# HJKL to move between windows
"$mainMod, H, cyclenext, visible"
"$mainMod, L, cyclenext, visible prev"
# HJKL to move between windows
"$mainMod, H, cyclenext, visible"
"$mainMod, L, cyclenext, visible prev"
# HJKL to move a window
"$mainMod_ALT, H, movewindow, l"
"$mainMod_ALT, J, movewindow, d"
"$mainMod_ALT, K, movewindow, u"
"$mainMod_ALT, L, movewindow, r"
# HJKL to resize a window
"ALT_SHIFT, H, resizeactive, -10% 0"
"ALT_SHIFT, J, resizeactive, 0 -10%"
"ALT_SHIFT, K, resizeactive, 0 10%"
"ALT_SHIFT, L, resizeactive, 10% 0"
# HJKL to move a window
"$mainMod_ALT, H, movewindow, l"
"$mainMod_ALT, J, movewindow, d"
"$mainMod_ALT, K, movewindow, u"
"$mainMod_ALT, L, movewindow, r"
# H and L to move between workspaces on the current monitor including creation
"$mainMod_CTRL, H, workspace, r-1"
"$mainMod_CTRL, L, workspace, r+1"
# HJKL to resize a window
"ALT_SHIFT, H, resizeactive, -10% 0"
"ALT_SHIFT, J, resizeactive, 0 -10%"
"ALT_SHIFT, K, resizeactive, 0 10%"
"ALT_SHIFT, L, resizeactive, 10% 0"
"$mainMod, V, togglefloating"
# H and L to move between workspaces on the current monitor including creation
"$mainMod_CTRL, H, workspace, r-1"
"$mainMod_CTRL, L, workspace, r+1"
"$mainMod, V, togglefloating"
];
bindm = [
@ -79,8 +83,8 @@
];
input = {
numlock_by_default = true;
follow_mouse = 2; # Click on a window to change focus
numlock_by_default = true;
follow_mouse = 2; # Click on a window to change focus
};
};
};

View file

@ -1,6 +1,6 @@
{ inputs, ... }: {
imports = [
inputs.nixvim.homeManagerModules.nixvim
{inputs, ...}: {
imports = [
inputs.nixvim.homeManagerModules.nixvim
./nixvim/conform-nvim.nix # formatter
./nixvim/lualine.nix # custom statusline
./nixvim/noice.nix # custom CMDLINE
@ -45,17 +45,16 @@
};
keymaps = [
{
# make gf create the file if it doesnt exist
# cd to the working directory to handle relative file paths
key = "gf";
action = ":cd %:p:h<CR>:e <cfile><CR>";
options = {
silent = true;
};
}
];
{
# make gf create the file if it doesnt exist
# cd to the working directory to handle relative file paths
key = "gf";
action = ":cd %:p:h<CR>:e <cfile><CR>";
options = {
silent = true;
};
}
];
clipboard.providers.wl-copy.enable = true;
};

View file

@ -2,28 +2,28 @@
programs.nixvim = {
keymaps = [
{
mode = "n";
key = "t";
action = ":NvimTreeToggle<CR>";
options = {
silent = true;
};
mode = "n";
key = "t";
action = ":NvimTreeToggle<CR>";
options = {
silent = true;
};
}
];
plugins = {
web-devicons.enable = true;
nvim-tree = {
enable = true;
autoClose = true;
disableNetrw = true;
hijackNetrw = true;
hijackCursor = true;
view = {
cursorline = true;
side = "right";
width = "25%";
};
enable = true;
autoClose = true;
disableNetrw = true;
hijackNetrw = true;
hijackCursor = true;
view = {
cursorline = true;
side = "right";
width = "25%";
};
};
};
};

View file

@ -19,7 +19,10 @@
view = {
cursorline = true;
side = "right";
width = { min = "25%"; max = "25%"; };
width = {
min = "25%";
max = "25%";
};
};
};
};

View file

@ -1,7 +1,7 @@
{
# man page summaries (activate with tldr <command>)
programs.tealdeer = {
enable = true;
enableAutoUpdates = true;
};
# man page summaries (activate with tldr <command>)
programs.tealdeer = {
enable = true;
enableAutoUpdates = true;
};
}

View file

@ -1,32 +1,32 @@
{ pkgs, ... }: {
# Terminal Multiplexing
programs.tmux = {
enable = true;
plugins = with pkgs.tmuxPlugins; [
catppuccin
{pkgs, ...}: {
# Terminal Multiplexing
programs.tmux = {
enable = true;
plugins = with pkgs.tmuxPlugins; [
catppuccin
# Session Management between Reboots
{
plugin = resurrect;
extraConfig = ''
set -g @resurrect-strategy-nvim 'session'
'';
}
{
plugin = continuum;
extraConfig = ''
set -g @continuum-restore 'on'
'';
}
];
extraConfig = ''
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",tmux-256color:RGB"
set -as terminal-features ",tmux-256color:RGB"
# inherit environment variables from outside so that we can use wl-copy etc
setenv -g WAYLAND_DISPLAY "$WAYLAND_DISPLAY"
setenv -g XDG_RUNTIME_DIR "$XDG_RUNTIME_DIR"
'';
};
# Session Management between Reboots
{
plugin = resurrect;
extraConfig = ''
set -g @resurrect-strategy-nvim 'session'
'';
}
{
plugin = continuum;
extraConfig = ''
set -g @continuum-restore 'on'
'';
}
];
extraConfig = ''
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",tmux-256color:RGB"
set -as terminal-features ",tmux-256color:RGB"
# inherit environment variables from outside so that we can use wl-copy etc
setenv -g WAYLAND_DISPLAY "$WAYLAND_DISPLAY"
setenv -g XDG_RUNTIME_DIR "$XDG_RUNTIME_DIR"
'';
};
}

View file

@ -3,7 +3,7 @@
enable = true;
settings = {
mainBar = {
layer = "top";
layer = "top";
};
};
style = ''

View file

@ -1,4 +1,8 @@
{ inputs, pkgs, ... }: {
{
inputs,
pkgs,
...
}: {
programs.yazi = {
enable = true;
package = inputs.yazi.packages.${pkgs.system}.default;

View file

@ -1,12 +1,10 @@
{ pkgs, ... }: {
{pkgs, ...}: {
home.packages = [
(pkgs.writers.writePython3Bin "git-extract" {
libraries = with pkgs.python3Packages; [
magic
chardet
];
} (builtins.readFile ./git-extract.py))
(pkgs.writeShellScriptBin "rebuild" (builtins.readFile ./rebuild.sh))

View file

@ -1,5 +1,4 @@
{pkgs, ...}: {
home.packages = with pkgs; [
fastfetch # system info
wl-clipboard # provides cli copy and paste commands