feat: make options and conditionalize config

This commit is contained in:
2026-01-27 15:05:45 +01:00
parent 9642bae67d
commit 39da2abe9c
10 changed files with 196 additions and 125 deletions
+2
View File
@@ -1,5 +1,7 @@
{ {
imports = [ imports = [
../options.nix
./git.nix ./git.nix
./fish.nix ./fish.nix
./nixvim ./nixvim
+78 -70
View File
@@ -1,80 +1,88 @@
{ pkgs, ... }:
{ {
home.packages = with pkgs; [ nordzy-cursor-theme ]; config,
lib,
pkgs,
...
}:
{
programs.waybar.enable = true; config = lib.mkIf config.kekleo.graphical {
home.packages = with pkgs; [ nordzy-cursor-theme ];
wayland.windowManager.hyprland = programs.waybar.enable = true;
let
# workspaces wayland.windowManager.hyprland =
# binds $mod/alt + [shift +] {1..9} to [move to] workspace {1..9} let
workspaces = builtins.concatLists ( # workspaces
builtins.genList ( # binds $mod/alt + [shift +] {1..9} to [move to] workspace {1..9}
i: workspaces = builtins.concatLists (
let builtins.genList (
ws = toString (i + 1); i:
in let
[ ws = toString (i + 1);
"$mod,${ws},workspace,${ws}" in
"ALT,${ws},workspace,${ws}" [
"$mod SHIFT,${ws},movetoworkspace,${ws}" "$mod,${ws},workspace,${ws}"
"ALTSHIFT,${ws},movetoworkspace,${ws}" "ALT,${ws},workspace,${ws}"
"$mod SHIFT,${ws},movetoworkspace,${ws}"
"ALTSHIFT,${ws},movetoworkspace,${ws}"
]
) 9
);
in
{
enable = true;
package = pkgs.hyprland;
xwayland.enable = true;
settings = {
env = [
"HYPRCURSOR_THEME,Nordzy-cursors"
"HYPRCURSOR_SIZE,26"
];
monitor = [
",1920x1080@60,0x0,1"
];
"$mod" = "SUPER";
"$launcher" = "rofi -show drun";
bind = [
"ALTSHIFT,Q,killactive,"
"ALT,V,togglefloating,"
"ALT,F,fullscreen,1"
"ALTSHIFT,F,fullscreen,0"
"$mod,Return,exec,kitty"
"$mod,F,exec,firefox"
"$mod,R,exec,$launcher"
"ALT,H,movefocus,l"
"ALT,L,movefocus,r"
"ALT,K,movefocus,u"
"ALT,J,movefocus,d"
"ALTSHIFT,H,movewindow,l"
"ALTSHIFT,L,movewindow,r"
"ALTSHIFT,K,movewindow,u"
"ALTSHIFT,J,movewindow,d"
] ]
) 9 ++ workspaces;
);
in
{
enable = true;
package = pkgs.hyprland;
xwayland.enable = true; windowrule = "bordersize 0, fullscreen:1";
settings = { general = {
env = [ gaps_in = 2;
"HYPRCURSOR_THEME,Nordzy-cursors" gaps_out = 2;
"HYPRCURSOR_SIZE,26" "col.active_border" = "0xff888888";
]; };
monitor = [ animations.animation = [
",1920x1080@60,0x0,1" "windows,1,4,default"
]; "border,1,5,default"
"$mod" = "SUPER"; "fadeIn,1,5,default"
"$launcher" = "rofi -show drun"; "workspaces,1,3,default"
bind = [ ];
"ALTSHIFT,Q,killactive,"
"ALT,V,togglefloating,"
"ALT,F,fullscreen,1"
"ALTSHIFT,F,fullscreen,0"
"$mod,Return,exec,kitty"
"$mod,F,exec,firefox"
"$mod,R,exec,$launcher"
"ALT,H,movefocus,l" dwindle.force_split = 2;
"ALT,L,movefocus,r" cursor.no_warps = true;
"ALT,K,movefocus,u"
"ALT,J,movefocus,d"
"ALTSHIFT,H,movewindow,l"
"ALTSHIFT,L,movewindow,r"
"ALTSHIFT,K,movewindow,u"
"ALTSHIFT,J,movewindow,d"
]
++ workspaces;
windowrule = "bordersize 0, fullscreen:1";
general = {
gaps_in = 2;
gaps_out = 2;
"col.active_border" = "0xff888888";
}; };
animations.animation = [
"windows,1,4,default"
"border,1,5,default"
"fadeIn,1,5,default"
"workspaces,1,3,default"
];
dwindle.force_split = 2;
cursor.no_warps = true;
}; };
}; };
} }
+18 -11
View File
@@ -1,15 +1,22 @@
{ pkgs, ... }:
{ {
programs.kitty = { config,
enable = true; lib,
themeFile = "tokyo_night_night"; pkgs,
font = { ...
package = pkgs.nerd-fonts.jetbrains-mono; }:
name = "JetBrainsMono NF"; {
size = 14; config = lib.mkIf config.kekleo.graphical {
}; programs.kitty = {
keybindings = { enable = true;
"ctrl+alt+enter" = "launch --cwd=current"; themeFile = "tokyo_night_night";
font = {
package = pkgs.nerd-fonts.jetbrains-mono;
name = "JetBrainsMono NF";
size = 14;
};
keybindings = {
"ctrl+alt+enter" = "launch --cwd=current";
};
}; };
}; };
} }
+16 -9
View File
@@ -1,3 +1,8 @@
{
config,
lib,
...
}:
{ {
imports = [ imports = [
./opts.nix ./opts.nix
@@ -5,17 +10,19 @@
./plugins ./plugins
]; ];
programs.nixvim = { config = lib.mkIf config.kekleo.neovim {
enable = true; programs.nixvim = {
viAlias = true; enable = true;
vimAlias = true; viAlias = true;
vimdiffAlias = true; vimAlias = true;
defaultEditor = true; vimdiffAlias = true;
defaultEditor = true;
colorschemes.tokyonight.enable = true; colorschemes.tokyonight.enable = true;
clipboard.providers.wl-copy.enable = true; clipboard.providers.wl-copy.enable = true;
globals.mapleader = " "; globals.mapleader = " ";
};
}; };
} }
+38 -32
View File
@@ -1,38 +1,44 @@
{ ... }:
{ {
programs.rofi = { config,
enable = true; lib,
font = "JetBrainsMono Nerd Font 11"; ...
theme = ./tokyonight.rasi; }:
extraConfig = { {
modi = [ config = lib.mkIf config.kekleo.graphical {
"drun" programs.rofi = {
"window" enable = true;
"run" font = "JetBrainsMono Nerd Font 11";
]; theme = ./tokyonight.rasi;
icon-theme = "Papirus-Dark"; extraConfig = {
show-icons = true; modi = [
terminal = "kitty"; "drun"
drun-display-format = "{icon} {name}"; "window"
location = 0; "run"
disable-history = false; ];
sidebar-mode = false; icon-theme = "Papirus-Dark";
display-drun = " "; show-icons = true;
display-run = " "; terminal = "kitty";
display-window = " "; drun-display-format = "{icon} {name}";
location = 0;
disable-history = false;
sidebar-mode = false;
display-drun = " ";
display-run = " ";
display-window = " ";
kb-row-up = "Up,Control+k"; kb-row-up = "Up,Control+k";
kb-row-left = "Left,Control+h"; kb-row-left = "Left,Control+h";
kb-row-right = "Right,Control+l"; kb-row-right = "Right,Control+l";
kb-row-down = "Down,Control+j"; kb-row-down = "Down,Control+j";
kb-accept-entry = "Return"; kb-accept-entry = "Return";
# remove clashing keybinds # remove clashing keybinds
kb-remove-to-eol = ""; kb-remove-to-eol = "";
kb-move-char-back = "Control+b"; kb-move-char-back = "Control+b";
kb-remove-char-back = "BackSpace"; kb-remove-char-back = "BackSpace";
kb-move-char-forward = "Control+f"; kb-move-char-forward = "Control+f";
kb-mode-complete = "Control+o"; kb-mode-complete = "Control+o";
};
}; };
}; };
} }
+2
View File
@@ -1,5 +1,7 @@
{ {
imports = [ imports = [
../options.nix
./fish.nix ./fish.nix
./firefox.nix ./firefox.nix
./hyprland.nix ./hyprland.nix
+8 -1
View File
@@ -1,3 +1,10 @@
{ {
programs.firefox.enable = true; config,
lib,
...
}:
{
config = lib.mkIf config.kekleo.graphical {
programs.firefox.enable = true;
};
} }
+8 -1
View File
@@ -1,3 +1,10 @@
{ {
programs.hyprland.enable = true; config,
lib,
...
}:
{
config = lib.mkIf config.kekleo.graphical {
programs.hyprland.enable = true;
};
} }
+8 -1
View File
@@ -1,3 +1,10 @@
{ {
services.displayManager.ly.enable = true; config,
lib,
...
}:
{
config = lib.mkIf config.kekleo.graphical {
services.displayManager.ly.enable = true;
};
} }
+18
View File
@@ -0,0 +1,18 @@
{
lib,
...
}:
{
options.kekleo = {
graphical = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Enable GUI features and programs";
};
neovim = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Enable neovim";
};
};
}