hyprland module consolidation and some refactoring

This commit is contained in:
cnst
2024-10-29 18:33:37 +01:00
parent 9609b2a47a
commit 9f05e45d68
46 changed files with 1115 additions and 806 deletions

View File

@@ -0,0 +1,60 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.hyprland.appearance;
in {
options = {
home.programs.hyprland.appearance.enable = mkEnableOption "Enables appearance settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
general = {
gaps_in = 2;
gaps_out = 4;
border_size = 3;
#col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
#col.inactive_border = rgba(595959aa)
"col.active_border" = "rgb(4c7a5d)"; # rgba(b16286ee) 45deg
"col.inactive_border" = "rgb(504945)";
layout = "dwindle";
allow_tearing = false;
resize_on_border = true;
};
decoration = {
rounding = 0;
blur = {
enabled = true;
size = 8;
passes = 1;
vibrancy = 0.1696;
};
drop_shadow = false;
shadow_range = 4;
shadow_render_power = 3;
# col.shadow = rgba(1a1a1aee)
};
animations = {
enabled = true;
bezier = [
"myBezier,0.05, 0.9, 0.1, 1.05"
];
animation = [
"windows, 1, 3, myBezier"
"windowsOut, 1, 3, default, popin 80%"
"border, 1, 3, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 3, default"
];
};
dwindle = {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true; # you probably want this
};
};
};
}

View File

@@ -1,6 +1,49 @@
{umodPath, ...}: {
{
config,
lib,
pkgs,
umodPath,
osConfig,
...
}: let
inherit (lib) mkIf mkEnableOption mkOption types mkDefault;
cfg = config.home.programs.hyprland;
hyprlandPkg = pkgs.hyprland;
isCnst = osConfig.networking.hostName == "cnix";
in {
imports = [
"${umodPath}/programs/hyprland/cnst"
"${umodPath}/programs/hyprland/toothpick"
./appearance.nix
./inputs.nix
./keybinds.nix
./rules.nix
./startup.nix
];
options = {
home.programs.hyprland = {
enable = mkEnableOption "Enable Hyprland";
};
};
config = mkIf cfg.enable {
home.programs.hyprland = {
appearance.enable = mkDefault true;
inputs.enable = mkDefault true;
keybinds.enable = mkDefault true;
rules.enable = mkDefault true;
startup.enable = mkDefault true;
};
wayland.windowManager.hyprland = {
enable = true;
package = hyprlandPkg;
systemd = {
variables = ["--all"];
extraCommands = [
"systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target"
];
};
};
};
}

View File

@@ -0,0 +1,93 @@
{
lib,
config,
osConfig,
...
}: let
inherit (lib) mkIf mkEnableOption;
toothpc = osConfig.networking.hostName == "toothpc";
kbOption =
if osConfig.networking.hostName == "cnixpad"
then "ctrl:swapcaps"
else "";
cfg = config.home.programs.hyprland.inputs;
renderSettings =
if toothpc
then {
explicit_sync = 0;
explicit_sync_kms = 0;
direct_scanout = false;
}
else {
explicit_sync = 2;
explicit_sync_kms = 2;
direct_scanout = false;
};
in {
options = {
home.programs.hyprland.inputs.enable = mkEnableOption "Enables input settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
monitor = map (
m: "${m.name},${
if m.enabled
then "${toString m.width}x${toString m.height}@${toString m.refreshRate},${m.position},1${
if m.bitDepth != null
then ",bitdepth,${toString m.bitDepth}"
else ""
}"
else "disable"
}"
) (config.monitors);
workspace = map (
m: "name:${m.workspace},monitor:${m.name}"
) (lib.filter (m: m.enabled && m.workspace != null) config.monitors);
env = [
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
];
input = {
kb_layout = "se";
kb_variant = "nodeadkeys";
kb_options = kbOption;
follow_mouse = 1;
accel_profile = "flat";
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
touchpad = {
natural_scroll = true;
disable_while_typing = true;
clickfinger_behavior = true;
scroll_factor = 0.5;
};
};
gestures = {
workspace_swipe = true;
workspace_swipe_distance = 400;
workspace_swipe_fingers = 3;
workspace_swipe_cancel_ratio = 0.2;
workspace_swipe_min_speed_to_force = 5;
workspace_swipe_direction_lock = true;
workspace_swipe_direction_lock_threshold = 10;
workspace_swipe_create_new = true;
};
misc = {
vrr = 0;
mouse_move_enables_dpms = 1;
key_press_enables_dpms = 0;
force_default_wallpaper = 0;
disable_hyprland_logo = true;
disable_splash_rendering = true;
disable_autoreload = true;
};
xwayland = {
force_zero_scaling = false;
};
render = renderSettings;
};
};
}

View File

@@ -0,0 +1,134 @@
{
lib,
config,
pkgs,
osConfig,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.hyprland.keybinds;
in {
options = {
home.programs.hyprland.keybinds.enable = mkEnableOption "Enables keybind settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = let
cnixpad = osConfig.networking.hostName == "cnixpad";
toothpc = osConfig.networking.hostName == "toothpc";
modKey =
if (cnixpad || toothpc)
then "ALT_L"
else "SUPER";
term =
if (cnixpad || toothpc)
then "foot"
else "alacritty";
browser =
if toothpc
then "firefox"
else "zen";
in {
"$terminal" = term;
"$fileManager" = "thunar";
"$passwordManager" = "keepassxc";
"$menu" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
"$menuw" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
"$browser" = browser;
"$browserinc" = "${browser} --private-window";
"$yazi" = "alacritty -e yazi";
"$tuirun" = "tuirun-toggle.sh";
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
"$mod" = modKey;
bind = let
grimblast = lib.getExe pkgs.grimblast;
tesseract = lib.getExe pkgs.tesseract;
notify-send = lib.getExe' pkgs.libnotify "notify-send";
in [
# Custom binds
"$mod SHIFT, B, exec, pkill -SIGUSR2 waybar" # Reload waybar
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
"$mod, A, exec, pkill -SIGUSR1 waybar"
"$mod, T, exec, $terminal"
"$mod, W, exec, $browser"
"$mod, K, exec, $passwordManager"
"$mod SHIFT, W, exec, $browserinc"
"$mod, Q, killactive,"
#bind = $mod, M, exec, hyprctl dispatch exit
#bind = $mod, E, exec, $fileManager
"$mod, E, exec, $fileManager"
"$mod, R, exec, $tuirun"
"$mod SHIFT, E, exec, $yazi"
"$mod, F, fullscreen,"
"$mod SHIFT, F, togglefloating,"
"$mod, SPACE, exec, $tuirun"
"$mod, P, pseudo," # dwindle
"$mod, J, togglesplit," # dwindle
"$mod, C, exec, hyprctl dispatch exec copyq toggle"
# "$mod, TAB, exec, $menuw"
# Move focus with mainMod + arrow keys
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
# Switch workspaces with mainMod + [0-9]
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
# Move active window to a workspace with mainMod + SHIFT + [0-9]
"$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"
"$mod SHIFT, 6, movetoworkspace, 6"
"$mod SHIFT, 7, movetoworkspace, 7"
"$mod SHIFT, 8, movetoworkspace, 8"
"$mod SHIFT, 9, movetoworkspace, 9"
"$mod SHIFT, 0, movetoworkspace, 10"
# Laptop controls
",XF86AudioLowerVolume, exec, pamixer -d 5"
",XF86AudioRaiseVolume, exec, pamixer -i 5"
",XF86AudioMute, exec, pamixer -t"
",XF86AudioMicMute, exec, pactl -- set-source-mute 0 toggle"
",XF86MonBrightnessDown, exec, brightnessctl s 5%-"
",XF86MonBrightnessUp, exec, brightnessctl s +5%"
"$mod, XF86MonBrightnessUp, exec, hyprctl dispatch dpms on"
"$mod, XF86MonBrightnessDown, exec, hyprctl dispatch dpms off"
# Screenshotting
",Insert,exec,${grimblast} --notify --freeze copysave area"
"SHIFT,Insert,exec,${grimblast} --notify --freeze copysave output"
# To OCR
"ALT,Insert,exec,${grimblast} --freeze save area - | ${tesseract} - - | wl-copy && ${notify-send} -t 3000 'OCR result copied to buffer'"
# Example special workspace (scratchpad)
"$mod, S, togglespecialworkspace, magic"
"$mod SHIFT, S, movetoworkspace, special:magic"
# Scroll through existing workspaces with mainMod + scroll
# bind = $mod, mouse_down, workspace, e+1
# bind = $mod, mouse_up, workspace, e-1
];
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
};
};
}

View File

@@ -0,0 +1,67 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.hyprland.rules;
in {
options = {
home.programs.hyprland.rules.enable = mkEnableOption "Enables window rule settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
windowrulev2 = [
# === CALCURSE SETTINGS ===
"size 843 650, initialTitle:^(floatcal)$"
"move 100%-w-20 40, initialTitle:^(floatcal)$"
"float, initialTitle:^(floatcal)$"
# === TUIRUN SETTINGS ===
"size 600 300, initialTitle:^(tuirun)$"
"center, initialTitle:^(tuirun)$"
"workspace special:tuirun, initialTitle:^(tuirun)$"
"noborder, initialTitle:^(tuirun)$"
"float, initialTitle:^(tuirun)$"
# === KEEPASSXC SETTINGS ===
"size 843 530, class:^(org.keepassxc.KeePassXC)$"
"move 100%-w-20 40, class:^(org.keepassxc.KeePassXC)$"
"float, class:^(org.keepassxc.KeePassXC)$"
# === SUPPRESS MAXIMIZE EVENT ===
"suppressevent maximize, class:.*" # Suppress maximize events for all windows
# === NWG-LOOK SETTINGS ===
"center, class:^(nwg-look)$"
"float, class:^(nwg-look)$"
# === PAVUCONTROL SETTINGS ===
"move 100%-w-20 40, class:^(pavucontrol)$"
"size 741 585, class:^(pavucontrol)$"
"float, class:^(pavucontrol)$"
# === XARCHIVER SETTINGS ===
"center, class:^(xarchiver)$"
"float, class:^(xarchiver)$"
# === FLOATING APPLICATIONS ===
"float, class:^(org.gnome.FileRoller)$"
"float, class:^(org.freedesktop.impl.portal.desktop.kde)$"
"float, class:^(org.corectrl.CoreCtrl)$"
"float, class:^(feh)$"
"float, class:^(polkit-gnome-authentication-agent-1)$"
"float, class:^(org.gnome.Calculator)$"
"float, class:^(Lxappearance)$"
"float, class:^(imv)$"
"float, class:^(com.github.hluk.copyq)$"
"float, class:^(blueman-manager)$"
"float, class:^(floatranger)$"
"float, class:^(floatnnn)$"
];
windowrule = [];
};
};
}

View File

@@ -0,0 +1,40 @@
{
lib,
config,
osConfig,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.hyprland.startup;
isCnix = osConfig.networking.hostName == "cnix";
isCnixpad = osConfig.networking.hostName == "cnixpad";
isToothpc = osConfig.networking.hostName == "toothpc";
in {
options = {
home.programs.hyprland.startup.enable = mkEnableOption "Enables startup settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
exec-once =
[
"systemctl --user start polkit-gnome-authentication-agent-1"
"udiskie -Nt"
"wl-clip-persist --clipboard regular --all-mime-type-regex '^(?!x-kde-passwordManagerHint).+'"
"hyprctl dispatch exec 'sleep 5s && keepassxc'"
]
++ lib.optionals isCnix [
"mullvad-vpn"
"blueman-applet"
"pamixer --set-volume 50"
"hyprctl dispatch exec 'sleep 3s && solaar -w hide'"
]
++ lib.optionals isCnixpad [
"blueman-applet"
]
++ lib.optionals isToothpc [
"mullvad-vpn"
"hyprctl dispatch exec 'sleep 3s && solaar -w hide'"
];
};
};
}

View File

@@ -0,0 +1,54 @@
{
config,
lib,
pkgs,
umodPath,
osConfig,
...
}: let
inherit (lib) mkIf mkEnableOption mkOption types mkDefault;
cfg = config.home.programs.hyprland;
hyprlandPkg = pkgs.hyprland;
isCnst = osConfig.networking.hostName == "cnix";
in {
imports = ++ lib.optionals isCnst [
"${umodPath}/programs/hyprland/cnst/appearance.nix"
"${umodPath}/programs/hyprland/cnst/inputs.nix"
"${umodPath}/programs/hyprland/cnst/keybinds.nix"
"${umodPath}/programs/hyprland/cnst/rules.nix"
"${umodPath}/programs/hyprland/cnst/startup.nix"
];
options = {
home.programs.hyprland = {
enable = mkEnableOption "Enable Hyprland";
user = mkOption {
type = types.str;
description = "The user-specific configuration directory for Hyprland.";
example = "cnst";
};
};
};
config = mkIf cfg.enable {
home.programs.hyprland.user = {
appearance.enable = mkDefault true;
inputs.enable = mkDefault true;
keybinds.enable = mkDefault true;
rules.enable = mkDefault true;
startup.enable = mkDefault true;
};
wayland.windowManager.hyprland = {
enable = true;
package = hyprlandPkg;
systemd = {
variables = ["--all"];
extraCommands = [
"systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target"
];
};
};
};
}

View File

@@ -0,0 +1,38 @@
{
config,
lib,
pkgs,
umodPath,
user,
...
}: let
inherit (lib) mkIf mkEnableOption mkOption types mkDefault;
cfg = config.home.programs.hyprland.user;
in {
imports = [
"${umodPath}/programs/hyprland/cnst/appearance.nix"
"${umodPath}/programs/hyprland/cnst/inputs.nix"
"${umodPath}/programs/hyprland/cnst/keybinds.nix"
"${umodPath}/programs/hyprland/cnst/rules.nix"
"${umodPath}/programs/hyprland/cnst/startup.nix"
];
options.home.programs.hyprland.user = {
enable = mkEnableOption "Enable Hyprland user-specific configuration";
appearance.enable = mkDefault true;
inputs.enable = mkDefault true;
keybinds.enable = mkDefault true;
rules.enable = mkDefault true;
startup.enable = mkDefault true;
};
config = mkIf cfg.enable {
home.programs.hyprland.${user} = {
appearance.enable = cfg.appearance.enable;
inputs.enable = cfg.inputs.enable;
keybinds.enable = cfg.keybinds.enable;
rules.enable = cfg.rules.enable;
startup.enable = cfg.startup.enable;
};
};
}

View File

@@ -0,0 +1,6 @@
{umodPath, ...}: {
imports = [
"${umodPath}/programs/hyprland/cnst"
"${umodPath}/programs/hyprland/toothpick"
];
}

View File

@@ -0,0 +1,60 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.hyprland.toothpick.appearance;
in {
options = {
home.programs.hyprland.toothpick.appearance.enable = mkEnableOption "Enables appearance settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
general = {
gaps_in = 2;
gaps_out = 4;
border_size = 3;
#col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
#col.inactive_border = rgba(595959aa)
"col.active_border" = "rgb(4c7a5d)"; # rgba(b16286ee) 45deg
"col.inactive_border" = "rgb(504945)";
layout = "dwindle";
allow_tearing = false;
resize_on_border = true;
};
decoration = {
rounding = 0;
blur = {
enabled = true;
size = 8;
passes = 1;
vibrancy = 0.1696;
};
drop_shadow = false;
shadow_range = 4;
shadow_render_power = 3;
# col.shadow = rgba(1a1a1aee)
};
animations = {
enabled = true;
bezier = [
"myBezier,0.05, 0.9, 0.1, 1.05"
];
animation = [
"windows, 1, 3, myBezier"
"windowsOut, 1, 3, default, popin 80%"
"border, 1, 3, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 3, default"
];
};
dwindle = {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true; # you probably want this
};
};
};
}

View File

@@ -7,22 +7,22 @@
...
}: let
inherit (lib) mkIf mkEnableOption mkDefault;
cfg = config.home.programs.hyprland.cnst;
cfg = config.home.programs.hyprland.toothpick;
in {
imports = [
"${umodPath}/programs/hyprland/cnst/appearance.nix"
"${umodPath}/programs/hyprland/cnst/inputs.nix"
"${umodPath}/programs/hyprland/cnst/keybinds.nix"
"${umodPath}/programs/hyprland/cnst/rules.nix"
"${umodPath}/programs/hyprland/cnst/startup.nix"
"${umodPath}/programs/hyprland/toothpick/appearance.nix"
"${umodPath}/programs/hyprland/toothpick/inputs.nix"
"${umodPath}/programs/hyprland/toothpick/keybinds.nix"
"${umodPath}/programs/hyprland/toothpick/rules.nix"
"${umodPath}/programs/hyprland/toothpick/startup.nix"
];
options = {
home.programs.hyprland.cnst.enable = mkEnableOption "Enable Hyprland";
home.programs.hyprland.toothpick.enable = mkEnableOption "Enable Hyprland";
};
config = mkIf cfg.enable {
home.programs.hyprland.cnst = {
home.programs.hyprland.toothpick = {
appearance.enable = mkDefault cfg.enable;
inputs.enable = mkDefault cfg.enable;
keybinds.enable = mkDefault cfg.enable;

View File

@@ -0,0 +1,81 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.hyprland.toothpick.inputs;
in {
options = {
home.programs.hyprland.toothpick.inputs.enable = mkEnableOption "Enables input settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
monitor = map (
m: "${m.name},${
if m.enabled
then "${toString m.width}x${toString m.height}@${toString m.refreshRate},${m.position},1${
if m.bitDepth != null
then ",bitdepth,${toString m.bitDepth}"
else ""
}"
else "disable"
}"
) (config.monitors);
workspace = map (
m: "name:${m.workspace},monitor:${m.name}"
) (lib.filter (m: m.enabled && m.workspace != null) config.monitors);
env = [
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
];
input = {
kb_layout = "se";
kb_variant = "nodeadkeys";
follow_mouse = 1;
accel_profile = "flat";
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
touchpad = {
natural_scroll = true;
disable_while_typing = true;
clickfinger_behavior = true;
scroll_factor = 0.5;
};
};
gestures = {
workspace_swipe = true;
workspace_swipe_distance = 400;
workspace_swipe_fingers = 3;
workspace_swipe_cancel_ratio = 0.2;
workspace_swipe_min_speed_to_force = 5;
workspace_swipe_direction_lock = true;
workspace_swipe_direction_lock_threshold = 10;
workspace_swipe_create_new = true;
};
misc = {
vrr = 0;
mouse_move_enables_dpms = 1;
key_press_enables_dpms = 0;
force_default_wallpaper = 0;
disable_hyprland_logo = true;
disable_splash_rendering = true;
};
xwayland = {
force_zero_scaling = false;
};
render = {
explicit_sync = 0;
explicit_sync_kms = 0;
direct_scanout = false;
};
cursor = {
no_hardware_cursors = true;
# no_break_fs_vrr = true;
# min_refresh_rate = 60;
};
};
};
}

View File

@@ -0,0 +1,115 @@
{
lib,
config,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.hyprland.toothpick.keybinds;
in {
options = {
home.programs.hyprland.toothpick.keybinds.enable = mkEnableOption "Enables keybind settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
"$terminal" = "foot";
"$fileManager" = "thunar";
"$passwordManager" = "keepassxc";
"$tuirun" = "tuirun-toggle.sh";
"$menu" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
"$browser" = "firefox";
"$browserinc" = "firefox --private-window";
"$ranger" = "rangerscript";
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
"$mod" = "ALT_L";
bind = let
grimblast = lib.getExe pkgs.grimblast;
tesseract = lib.getExe pkgs.tesseract;
notify-send = lib.getExe' pkgs.libnotify "notify-send";
in [
# Custom binds
"$mod SHIFT, B, exec, pkill -SIGUSR2 waybar" # Reload waybar
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
"$mod, A, exec, pkill -SIGUSR1 waybar"
"$mod, T, exec, $terminal"
"$mod, W, exec, $browser"
"$mod, K, exec, $passwordManager"
"$mod SHIFT, W, exec, $browserinc"
"$mod, Q, killactive,"
#bind = $mod, M, exec, hyprctl dispatch exit
#bind = $mod, E, exec, $fileManager
"$mod, E, exec, $fileManager"
"$mod SHIFT, E, exec, $ranger"
"$mod, F, fullscreen,"
"$mod SHIFT, F, togglefloating,"
"$mod, SPACE, exec, $tuirun"
"$mod, P, pseudo," # dwindle
"$mod, J, togglesplit," # dwindle
"$mod, C, exec, hyprctl dispatch exec copyq toggle"
# Move focus with mainMod + arrow keys
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
# Switch workspaces with mainMod + [0-9]
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
# Move active window to a workspace with mainMod + SHIFT + [0-9]
"$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"
"$mod SHIFT, 6, movetoworkspace, 6"
"$mod SHIFT, 7, movetoworkspace, 7"
"$mod SHIFT, 8, movetoworkspace, 8"
"$mod SHIFT, 9, movetoworkspace, 9"
"$mod SHIFT, 0, movetoworkspace, 10"
# Laptop controls
",XF86AudioLowerVolume, exec, pamixer -d 5"
",XF86AudioRaiseVolume, exec, pamixer -i 5"
",XF86AudioMute, exec, pamixer -m"
",XF86AudioMicMute, exec, pactl -- set-source-mute 0 toggle"
",XF86MonBrightnessDown, exec, brightnessctl s 10%-"
",XF86MonBrightnessUp, exec, brightnessctl s +10%"
"$mod, XF86MonBrightnessUp, exec, hyprctl dispatch dpms on"
"$mod, XF86MonBrightnessDown, exec, hyprctl dispatch dpms off"
# Screenshotting
",Print,exec,${grimblast} --notify --freeze copysave area"
"SHIFT,Print,exec,${grimblast} --notify --freeze copysave output"
# To OCR
"ALT,Print,exec,${grimblast} --freeze save area - | ${tesseract} - - | wl-copy && ${notify-send} -t 3000 'OCR result copied to buffer'"
# Example special workspace (scratchpad)
"$mod, S, togglespecialworkspace, magic"
"$mod SHIFT, S, movetoworkspace, special:magic"
# Scroll through existing workspaces with mainMod + scroll
# bind = $mod, mouse_down, workspace, e+1
# bind = $mod, mouse_up, workspace, e-1
];
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
};
};
}

View File

@@ -0,0 +1,59 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.hyprland.toothpick.rules;
in {
options = {
home.programs.hyprland.toothpick.rules.enable = mkEnableOption "Enables window rule settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
# CALCURSE SETTINGS
windowrulev2 = [
"float,initialTitle:(floatcal)"
"size 843 650,initialTitle:(floatcal)"
"move 100%-w-20 40,initialTitle:(floatcal)"
"float,initialTitle:(tuirun)"
"size 600 300,initialTitle:(tuirun)"
"center,initialTitle:(tuirun)"
# "workspace special:tuirun,initialTitle:(tuirun)"
"noborder,initialTitle:(tuirun)"
#windowrulev2 = move 1708 32,class:(floatcal)
"float,class:(org.keepassxc.KeePassXC)"
"size 843 530,class:(org.keepassxc.KeePassXC)"
"move 100%-w-20 40,class:(org.keepassxc.KeePassXC)"
# RANGER/NNN SETTINGS
"float,class:(floatranger)"
"float,class:(floatnnn)"
#windowrulev2 = size 843 650,class:(floatranger)
#windowrulev2 = move 1708 32,class:(floatranger)
#windowrulev2 = move 1708 32;size 843 650;dimaround;float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
"suppressevent maximize, class:.* # You'll probably like this."
#windowrulev2 = noshadow, floating:0
"float,class:^(imv)$"
"float,class:^(com.github.hluk.copyq)$"
"float,class:^(blueman-manager)$"
"center,class:^(nwg-look)$"
"float,class:^(nwg-look)$"
"float,class:^(Lxappearance)$"
"float,class:(pavucontrol)$"
"move 100%-w-20 40,class:(pavucontrol)$"
"float,class:^(polkit-gnome-authentication-agent-1)$"
"float,class:^(org.gnome.Calculator)$"
"size 741 585,class:(pavucontrol)$"
"float,class:^(org.corectrl.CoreCtrl)$"
"float,class:^(feh)$"
];
windowrule = [
"center, ^(xarchiver)$"
"float, ^(xarchiver)$"
"float, ^(org.gnome.FileRoller)$"
];
};
};
}

View File

@@ -0,0 +1,29 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.hyprland.toothpick.startup;
in {
options = {
home.programs.hyprland.toothpick.startup.enable = mkEnableOption "Enables startup settings in Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = {
exec-once = [
# STARTUP
# exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
"systemctl --user start polkit-gnome-authentication-agent-1"
# exec-once = lxqt-policykit-agent &
"mullvad-vpn"
"pamixer --set-volume 50"
# exec-once = swaybg -i ~/media/images/wallpaper.png
"wl-clip-persist --clipboard regular --all-mime-type-regex '^(?!x-kde-passwordManagerHint).+'"
# exec-once = hyprctl dispatch exec "sleep 4s && copyq --start-server"
"hyprctl dispatch exec 'sleep 5s && keepassxc'"
"hyprctl dispatch exec 'sleep 3s && solaar -w hide'"
];
};
};
}

View File

@@ -1,5 +1,5 @@
{
inputs,
# inputs,
pkgs,
config,
lib,
@@ -8,8 +8,8 @@
inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.hyprlock;
hyprlockFlake = inputs.hyprlock.packages.${pkgs.system}.hyprlock;
# hyprlockPkg = pkgs.hyprlock;
# hyprlockFlake = inputs.hyprlock.packages.${pkgs.system}.hyprlock;
hyprlockPkg = pkgs.hyprlock;
in {
options = {
home.programs.hyprlock.enable = mkEnableOption "Enables hyprlock";
@@ -17,7 +17,7 @@ in {
config = mkIf cfg.enable {
programs.hyprlock = {
enable = true;
package = hyprlockFlake;
package = hyprlockPkg;
settings = {
general = {
disable_loading_bar = true;

View File

@@ -19,10 +19,6 @@ in {
feh = {
enable = true;
};
# system information
fastfetch = {
enable = true;
};
# a monitor of resources
btop = {
enable = true;
@@ -33,12 +29,12 @@ in {
};
home.packages = with pkgs; [
# misc.gui
virt-manager
# virt-manager
xfce.thunar
file-roller # archiver
gnome-calculator
keepassxc
networkmanagerapplet # tray icon for NetworkManager
# networkmanagerapplet # tray icon for NetworkManager
nwg-look # GTK settings
pavucontrol # GUI sound control
qbittorrent
@@ -47,6 +43,7 @@ in {
# misc.tui
ranger
xcur2png
cmatrix
calcurse # calendar
chatgpt-cli
exiftool

View File

@@ -12,7 +12,7 @@ in {
};
config = mkIf cfg.enable {
home = {
packages = [pkgs.glib]; # gsettings
# packages = [pkgs.glib]; # gsettings
pointerCursor = {
# package = pkgs.catppuccin-cursors.latteDark;
# name = "catppuccin-latte-dark-cursors";

View File

@@ -2,14 +2,14 @@
config,
lib,
pkgs,
inputs,
# inputs,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.services.hypridle;
hypridleFlake = inputs.hypridle.packages.${pkgs.system}.hypridle;
# hypridlePkg = pkgs.hypridle;
# hypridleFlake = inputs.hypridle.packages.${pkgs.system}.hypridle;
hypridlePkg = pkgs.hypridle;
in {
options = {
home.services.hypridle.enable = mkEnableOption "Enables hypridle";
@@ -17,7 +17,7 @@ in {
config = mkIf cfg.enable {
services.hypridle = {
enable = true;
package = hypridleFlake;
package = hypridlePkg;
settings = {
general = {
lock_cmd = "hyprlock";

View File

@@ -2,14 +2,14 @@
config,
lib,
pkgs,
inputs,
# inputs,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.services.hyprpaper;
hyprpaperFlake = inputs.hyprpaper.packages.${pkgs.system}.default;
# hyprpaperPkg = pkgs.hyprpaper;
# hyprpaperFlake = inputs.hyprpaper.packages.${pkgs.system}.default;
hyprpaperPkg = pkgs.hyprpaper;
in {
options = {
home.services.hyprpaper.enable = mkEnableOption "Enables hyprpaper";
@@ -17,7 +17,7 @@ in {
config = mkIf cfg.enable {
services.hyprpaper = {
enable = true;
package = hyprpaperFlake;
package = hyprpaperPkg;
settings = {
ipc = "on";
splash = false;

View File

@@ -72,7 +72,10 @@ in {
};
chaotic = mkIf (cfg.variant == "cachyos") {
scx.enable = true;
scx = {
enable = true;
scheduler = "scx_lavd";
};
};
};
}

View File

@@ -12,11 +12,10 @@ in {
enable = mkEnableOption "AMD graphics support";
packageSet = mkOption {
type = types.enum ["standard" "chaotic" "minimal"];
default = "minimal";
type = types.enum ["standard" "chaotic"];
default = "standard";
description = ''
Which set of AMD graphics packages to use:
- minimal: Only basic drivers and libraries
- standard: Additional AMD-specific tools and utilities
- chaotic: Chaotic Mesa git version with additional optimizations
'';
@@ -26,35 +25,37 @@ in {
config = mkIf cfg.enable (mkMerge [
{
# Base configuration that applies regardless of package set
# Base configuration
hardware.graphics = {
enable = true;
enable32Bit = true;
};
}
# Standard Package Set
(mkIf (cfg.packageSet == "standard") {
hardware.graphics = {
extraPackages = with pkgs; [
libva
vaapiVdpau
libvdpau-va-gl
amdvlk
vulkan-tools
];
extraPackages32 = with pkgs.pkgsi686Linux; [
vaapiVdpau
libvdpau-va-gl
];
};
hardware.graphics.extraPackages = with pkgs; [
libva
vaapiVdpau
libvdpau-va-gl
vulkan-loader
vulkan-validation-layers
vulkan-extension-layer
];
hardware.graphics.extraPackages32 = with pkgs.pkgsi686Linux; [
vaapiVdpau
libvdpau-va-gl
];
environment.systemPackages = with pkgs; [
vulkan-tools
wayland
wayland-protocols
];
})
# Chaotic Package Set
(mkIf (cfg.packageSet == "chaotic") {
chaotic = {
scx = {
enable = true;
scheduler = "scx_lavd";
};
mesa-git = {
enable = true;
extraPackages = with pkgs; [
@@ -65,18 +66,14 @@ in {
latencyflex-vulkan
mesa_git
mesa_git.opencl
vulkanPackages_latest.gfxreconstruct
vulkanPackages_latest.spirv-cross
vulkanPackages_latest.vulkan-loader
vulkanPackages_latest.vulkan-headers
vulkanPackages_latest.vulkan-validation-layers
vulkanPackages_latest.vulkan-extension-layer
vulkanPackages_latest.vulkan-utility-libraries
vulkanPackages_latest.vulkan-volk
vulkanPackages_latest.spirv-headers
vulkanPackages_latest.spirv-tools
vulkanPackages_latest.vulkan-extension-layer
vulkanPackages_latest.vulkan-headers
vulkanPackages_latest.vulkan-loader
vulkanPackages_latest.vulkan-tools
vulkanPackages_latest.vulkan-tools-lunarg
vulkanPackages_latest.vulkan-utility-libraries
vulkanPackages_latest.vulkan-validation-layers
vulkanPackages_latest.vulkan-volk
];
extraPackages32 = with pkgs.pkgsi686Linux; [
pkgs.mesa32_git
@@ -88,6 +85,14 @@ in {
];
};
};
environment.systemPackages = with pkgs; [
vulkanPackages_latest.vulkan-tools
vulkanPackages_latest.vulkan-tools-lunarg
vulkanPackages_latest.gfxreconstruct
vulkanPackages_latest.spirv-cross
wayland-protocols_git
wayland_git
];
})
]);
}

View File

@@ -9,11 +9,6 @@ in {
options = {
nixos.hardware.network = {
enable = mkEnableOption "Enable the custom networking module";
hostName = mkOption {
type = types.str;
default = "default-hostname";
description = "Hostname for the nixos.";
};
interfaces = mkOption {
type = types.attrsOf (types.submodule {
options = {
@@ -53,7 +48,6 @@ in {
networking = {
networkmanager.enable = true;
inherit (cfg) hostName;
nftables.enable = true;
firewall = {
enable = true;

View File

@@ -7,7 +7,7 @@
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.nixos.programs.hyprland;
hyprsysteminfoFlake = inputs.hyprsysteminfo.packages.${pkgs.system}.default;
# hyprsysteminfoFlake = inputs.hyprsysteminfo.packages.${pkgs.system}.default;
in {
options = {
nixos.programs.hyprland.enable = mkEnableOption "Enables hyprland";
@@ -17,14 +17,14 @@ in {
programs.hyprland = {
enable = true;
xwayland.enable = true;
package = inputs.hyprland.packages.${pkgs.system}.default;
portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
package = pkgs.hyprland;
portalPackage = pkgs.xdg-desktop-portal-hyprland;
};
environment = {
variables.NIXOS_OZONE_WL = "1";
systemPackages = [
pkgs.hyprwayland-scanner
hyprsysteminfoFlake
# pkgs.hyprwayland-scanner
# hyprsysteminfoFlake
];
};
};

View File

@@ -14,8 +14,6 @@ in {
environment.systemPackages = with pkgs; [
lutris
bottles
wineWowPackages.waylandFull
wineWowPackages.stagingFull
];
};
}

View File

@@ -27,6 +27,7 @@ in {
(mkIf cfg.desktop.enable [
pkgs.protonup
pkgs.winetricks
pkgs.wine
])
];
};

View File

@@ -24,7 +24,7 @@ in {
default = false;
description = "Enables autologin for a specified user.";
};
autologin.user = mkOption {
user = mkOption {
type = types.str;
default = "cnst";
description = "The username to auto-login when autologin is enabled.";
@@ -39,14 +39,14 @@ in {
# Conditionally include initial_session if autologin is enabled
(mkIf cfg.autologin.enable {
initial_session = {
command = "${pkgs.hyprland}/bin/Hyprland";
user = cfg.autologin.user;
command = "${lib.getExe config.programs.hyprland.package}";
user = cfg.user;
};
})
{
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet -r --remember-session --asterisks";
user = "greeter";
user = cfg.user;
};
}
];

View File

@@ -22,6 +22,7 @@ in {
};
config = {
services.xserver = {
enable = true;
videoDrivers = cfg.videoDrivers;
xkb.layout = cfg.xkbLayout;
};

View File

@@ -34,7 +34,7 @@ in {
clang-tools
marksman
pyright
nodePackages_latest.intelephense
# nodePackages_latest.intelephense
# Formatters
alejandra

View File

@@ -23,7 +23,7 @@ in {
enable = true;
xdgOpenUsePortal = cfg.xdgOpenUsePortal;
config = {
common.default = "*";
common.default = ["gtk"];
hyprland.default = ["hyprland" "gtk"];
};
extraPortals = [pkgs.xdg-desktop-portal-gtk];