From dcb0ea196109db8544a3881135b41e39aa04331a Mon Sep 17 00:00:00 2001 From: Armel van Ravels Date: Fri, 16 Jan 2026 21:35:28 +0100 Subject: [PATCH] Modularize config --- home.nix | 89 +++------------------------------------------ programs/direnv.nix | 9 +++++ programs/kitty.nix | 8 ++++ programs/zsh.nix | 11 ++++++ wm/hyperland.nix | 68 ++++++++++++++++++++++++++++++++++ 5 files changed, 102 insertions(+), 83 deletions(-) create mode 100644 programs/direnv.nix create mode 100644 programs/kitty.nix create mode 100644 programs/zsh.nix create mode 100644 wm/hyperland.nix diff --git a/home.nix b/home.nix index f09726a..910901f 100644 --- a/home.nix +++ b/home.nix @@ -7,93 +7,16 @@ home.username = "avravels"; home.homeDirectory = "/home/avravels"; - programs.zsh = { - enable = true; - oh-my-zsh = { - enable = true; - theme = "agnoster"; - }; - }; home.packages = with pkgs; [ - kitty wofi ]; - - programs.kitty = { - enable = true; - settings.confirm_quit = false; - }; - programs.direnv = { - enable = true; - enableZshIntegration = true; - nix-direnv.enable = true; - }; + imports = [ + ./programs/kitty.nix + ./programs/zsh.nix + ./programs/direnv.nix + ./wm/hyperland.nix + ]; - wayland.windowManager.hyprland = { - enable = true; - - settings = { - ### MONITOR - monitor = [ - ",preferred,auto,1" - ]; - - ### VARIABLES - "$mod" = "SUPER"; - "$terminal" = "kitty"; - "$menu" = "wofi --show drun"; - - ### BASIC LAYOUT - general = { - layout = "dwindle"; - resize_on_border = true; - }; - - decoration = { - rounding = 5; # increase/decrease for more/less round - }; - - ### INPUT - input = { - kb_layout = "us"; - }; - - ### KEYBINDINGS - bind = [ - # Apps - "$mod, RETURN, exec, $terminal" - "$mod, D, exec, $menu" - "$mod, Q, killactive" - "$mod, F, fullscreen" - "$mod, M, exit" - - # Focus - "$mod, LEFT, movefocus, l" - "$mod, RIGHT, movefocus, r" - "$mod, UP, movefocus, u" - "$mod, DOWN, movefocus, d" - - # Workspaces - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - - "$mod SHIFT, 1, movetoworkspace, 1" - "$mod SHIFT, 2, movetoworkspace, 2" - "$mod SHIFT, 3, movetoworkspace, 3" - "$mod SHIFT, 4, movetoworkspace, 4" - "$mod SHIFT, 5, movetoworkspace, 5" - ]; - - bindm = [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - ]; - - }; - }; } diff --git a/programs/direnv.nix b/programs/direnv.nix new file mode 100644 index 0000000..a5bb623 --- /dev/null +++ b/programs/direnv.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: + +{ + programs.direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + }; +} \ No newline at end of file diff --git a/programs/kitty.nix b/programs/kitty.nix new file mode 100644 index 0000000..6e3dba5 --- /dev/null +++ b/programs/kitty.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + programs.kitty = { + enable = true; + settings.confirm_quit = false; + }; +} diff --git a/programs/zsh.nix b/programs/zsh.nix new file mode 100644 index 0000000..0465e86 --- /dev/null +++ b/programs/zsh.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +{ + programs.zsh = { + enable = true; + oh-my-zsh = { + enable = true; + theme = "agnoster"; + }; + }; +} \ No newline at end of file diff --git a/wm/hyperland.nix b/wm/hyperland.nix new file mode 100644 index 0000000..e4849f2 --- /dev/null +++ b/wm/hyperland.nix @@ -0,0 +1,68 @@ +{ pkgs, ... }: + +{ + wayland.windowManager.hyprland = { + enable = true; + + settings = { + ### MONITOR + monitor = [ + ",preferred,auto,1" + ]; + + ### VARIABLES + "$mod" = "SUPER"; + "$terminal" = "kitty"; + "$menu" = "wofi --show drun"; + + ### BASIC LAYOUT + general = { + layout = "dwindle"; + resize_on_border = true; + }; + + decoration = { + rounding = 5; # increase/decrease for more/less round + }; + + ### INPUT + input = { + kb_layout = "us"; + }; + + ### KEYBINDINGS + bind = [ + # Apps + "$mod, RETURN, exec, $terminal" + "$mod, D, exec, $menu" + "$mod, Q, killactive" + "$mod, F, fullscreen" + "$mod, M, exit" + + # Focus + "$mod, LEFT, movefocus, l" + "$mod, RIGHT, movefocus, r" + "$mod, UP, movefocus, u" + "$mod, DOWN, movefocus, d" + + # Workspaces + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + + "$mod SHIFT, 1, movetoworkspace, 1" + "$mod SHIFT, 2, movetoworkspace, 2" + "$mod SHIFT, 3, movetoworkspace, 3" + "$mod SHIFT, 4, movetoworkspace, 4" + "$mod SHIFT, 5, movetoworkspace, 5" + ]; + + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + }; + }; +}