initial commit

This commit is contained in:
GammaKinematics 2026-03-30 13:10:42 +07:00
commit 90cff4f16a
59 changed files with 6855 additions and 0 deletions

View file

@ -0,0 +1,152 @@
# Hyprland keybindings configuration
{ ... }:
{
wayland.windowManager.hyprland.settings = {
# Variables
"$mod" = "SUPER";
"$terminal" = "foot";
"$browser" = "zen";
# Keybindings
bind = [
# Rofi
"$mod, Space, exec, rofi -show system:rofi-system"
"$mod ALT, Space, exec, rofi-websearch"
# Foot terminal - go to workspace 50, launch if not running
"$mod, A, exec, hyprctl dispatch workspace 50; hyprctl clients -j | grep -q foot || $terminal"
# Zed - go to workspace 60, launch if not running
"$mod, Z, exec, hyprctl dispatch workspace 60; hyprctl clients -j | grep -q dev.zed.Zed || zeditor"
# Zen Browser - workspace 70 (DP-3), launch if no browser on that workspace
"$mod, B, exec, hyprctl dispatch workspace 70; hyprctl clients -j | jq -e '.[] | select(.class == \"zen-twilight\" and .workspace.id == 70)' > /dev/null || hyprctl dispatch exec [workspace 70 silent] -- $browser"
# Zen Browser - workspace 71 (eDP-1), launch new window if no browser on that workspace
"$mod ALT, B, exec, hyprctl dispatch workspace 71; hyprctl clients -j | jq -e '.[] | select(.class == \"zen-twilight\" and .workspace.id == 71)' > /dev/null || hyprctl dispatch exec [workspace 71 silent] -- $browser --new-window"
# Nautilus - go to workspace 80, launch if not running
"$mod, N, exec, hyprctl dispatch workspace 80; hyprctl clients -j | grep -q org.gnome.Nautilus || nautilus"
# Haruna - go to workspace 90
"$mod, M, workspace, 90"
"$mod, Escape, exec, hyprlock"
# Switch to KiCad workspaces (both monitors)
"$mod, K, workspace, 101"
"$mod, K, workspace, 102"
# Launch KiCad project selector
"$mod CTRL, K, exec, kicad-projects"
# Launch library editors
"$mod, L, exec, kicad-lib-launch"
# Show project manager
"$mod SHIFT, K, togglespecialworkspace, kicad-pm"
# Swap SCH/PCB positions
"$mod ALT, K, exec, kicad-swap"
# Cycle through project instances
"$mod, bracketright, exec, kicad-cycle f"
"$mod, bracketleft, exec, kicad-cycle b"
# FreeCAD - go to workspace 110, launch if not running
"$mod, F, exec, hyprctl dispatch workspace 110; hyprctl clients -j | grep -q org.freecad.FreeCAD || env QT_QPA_PLATFORM=xcb FreeCAD --single-instance"
# Window management
"$mod, Q, killactive"
"$mod, W, fullscreen"
"$mod, R, togglefloating"
"$mod, P, pseudo"
"$mod, E, togglesplit"
# Focus movement
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
# Workspace switching
"$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 window to workspace
"$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"
# Special workspace (scratchpad)
"$mod, S, togglespecialworkspace, magic"
"$mod SHIFT, S, movetoworkspace, special:magic"
# Exit Hyprland
"$mod SHIFT, E, exit"
# Scroll through workspaces on current monitor (vertical model)
"$mod, mouse_down, workspace, m-1"
"$mod, mouse_up, workspace, m+1"
# Keyboard workspace navigation (up/down)
"$mod CTRL, up, workspace, m-1"
"$mod CTRL, down, workspace, m+1"
"$mod CTRL SHIFT, up, movetoworkspace, m-1"
"$mod CTRL SHIFT, down, movetoworkspace, m+1"
# Clipboard history (SUPER+SHIFT+V)
"$mod SHIFT, V, exec, cliphist list | rofi -dmenu -p 'Clipboard' | cliphist decode | wl-copy"
# Screenshot bindings (saves to ~/Pictures/Screenshots/)
", Print, exec, mkdir -p ~/Pictures/Screenshots && grimblast --notify copysave area ~/Pictures/Screenshots/$(date +%F_%T).png"
"SHIFT, Print, exec, mkdir -p ~/Pictures/Screenshots && grimblast --notify copysave output ~/Pictures/Screenshots/$(date +%F_%T).png"
"CTRL, Print, exec, grimblast --notify save area - | swappy -f -"
# System menu (rofi)
"$mod, X, exec, rofi -show system -modes 'system:rofi-system'"
# On-screen keyboard toggle (for tablet mode)
# "$mod, K, exec, pkill wvkbd-mobintl || wvkbd-mobintl"
# Refresh waybar (for dock/undock)
"$mod CTRL, Space, exec, pkill waybar; waybar-start"
];
# Mouse bindings
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
# Repeat bindings (hold key for continuous action)
binde = [
"$mod ALT, left, resizeactive, -20 0"
"$mod ALT, right, resizeactive, 20 0"
"$mod ALT, up, resizeactive, 0 -20"
"$mod ALT, down, resizeactive, 0 20"
];
# Media/hardware key bindings (bindl = works even when locked)
bindl = [
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
];
# Volume keys with repeat (binde = repeat when held)
bindel = [
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
];
};
}

View file

@ -0,0 +1,41 @@
# Hypridle - Idle daemon configuration
{ pkgs, ... }:
{
services.hypridle = {
enable = true;
package = pkgs.hypridle;
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on";
};
listener = [
# Dim screen after 2.5 minutes
{
timeout = 150;
on-timeout = "brightnessctl -s set 10";
on-resume = "brightnessctl -r";
}
# Lock after 5 minutes
{
timeout = 300;
on-timeout = "loginctl lock-session";
}
# Screen off after 5.5 minutes
{
timeout = 330;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
# Suspend after 30 minutes
{
timeout = 1800;
on-timeout = "systemctl suspend";
}
];
};
};
}

View file

@ -0,0 +1,54 @@
# Hyprland ecosystem configuration (stable packages)
# Core hyprland WM and hypr* tools only
{ pkgs, ... }:
{
imports = [
./bindings.nix
./settings.nix
./monitors.nix
./rules.nix
./hyprlock.nix
./hypridle.nix
./hyprpaper.nix
];
# ============================================================================
# Hyprland Window Manager (home-manager config)
# ============================================================================
# Package/portal set at NixOS level in hyprsuck.nix
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = true;
};
# ============================================================================
# Hyprland ecosystem packages (stable)
# ============================================================================
home.packages = with pkgs; [
# Tablet mode
iio-hyprland
# Monitor hotplug
hyprland-monitor-attached
];
wayland.windowManager.hyprland.settings = {
exec-once = [
"iio-hyprland"
"hyprland-monitor-attached"
];
};
# Polkit authentication agent
services.hyprpolkitagent = {
enable = true;
package = pkgs.hyprpolkitagent;
};
# Blue light filter
services.hyprsunset = {
enable = true;
package = pkgs.hyprsunset;
};
}

View file

@ -0,0 +1,39 @@
# Hyprlock - Screen locker configuration
{ pkgs, ... }:
{
# Disable Stylix's hyprlock theming (we use screenshot blur)
stylix.targets.hyprlock.enable = false;
programs.hyprlock = {
enable = true;
package = pkgs.hyprlock;
settings = {
general = {
hide_cursor = true;
grace = 5; # seconds before lock takes effect
};
background = [
{
path = "screenshot";
blur_passes = 3;
blur_size = 8;
}
];
input-field = [
{
size = "200, 50";
position = "0, -80";
monitor = "";
dots_center = true;
fade_on_empty = false;
outline_thickness = 2;
placeholder_text = "Password...";
shadow_passes = 2;
}
];
};
};
}

View file

@ -0,0 +1,22 @@
# Hyprpaper - Wallpaper manager configuration
{ config, pkgs, ... }:
let
flakeDir = "${config.home.homeDirectory}/NixOS";
in
{
services.hyprpaper = {
enable = true;
package = pkgs.hyprpaper;
settings = {
ipc = "on";
splash = false;
# Change the wallpaper filename here
preload = [ "${flakeDir}/Wallpapers/Shift.png" ];
wallpaper = [ ", ${flakeDir}/Wallpapers/Shift.png" ];
};
};
}

View file

@ -0,0 +1,15 @@
# Hyprland monitor configuration
{ ... }:
{
wayland.windowManager.hyprland.settings = {
# Monitor configuration
# eDP-1: Laptop display in portrait mode (rotated 270deg)
# DP-3: External monitor in landscape, positioned to the right
monitor = [
"eDP-1, 1920x1200@60, 0x0, 1.25, transform, 3"
"DP-3, 1920x1080@100, 960x-250, 1"
", preferred, auto, 1" # Fallback for any other monitor
];
};
}

View file

@ -0,0 +1,59 @@
# Hyprland window rules and workspace configuration
{ ... }:
{
wayland.windowManager.hyprland.settings = {
# Window rules (old syntax for Hyprland 0.52.1)
windowrule = [
"float, class:^(pavucontrol)$"
"float, class:^(org.keepassxc.KeePassXC)$"
"float, title:^(Picture-in-Picture)$"
"pin, title:^(Picture-in-Picture)$"
# Foot terminal → workspace 50 (DP-3)
"workspace 50 silent, class:^(foot)$"
# Zed → workspace 60 (DP-3)
"workspace 60 silent, class:^(dev.zed.Zed)$"
# FreeCAD → workspace 110 (DP-3)
"workspace 110 silent, class:^(org.freecad.FreeCAD)$"
# Nautilus → workspace 80 (eDP-1)
"workspace 80 silent, class:^(org.gnome.Nautilus)$"
# Haruna → workspace 104, tabbed/grouped
"workspace 90 silent, class:^(org.kde.haruna)$"
"group set, class:^(org.kde.haruna)$"
# Schematic/Symbol Editor → workspace 102 (eDP-1), maximized, grouped
"workspace 102 silent, class:^(KiCad|kicad)$, title:.*Schematic Editor.*"
"maximize, class:^(KiCad|kicad)$, title:.*Schematic Editor.*"
"group set, class:^(KiCad|kicad)$, title:.*Schematic Editor.*"
"workspace 102 silent, class:^(KiCad|kicad)$, title:.*Symbol Editor.*"
"maximize, class:^(KiCad|kicad)$, title:.*Symbol Editor.*"
"group set, class:^(KiCad|kicad)$, title:.*Symbol Editor.*"
# PCB/Footprint Editor → workspace 101 (DP-3), maximized, grouped
"workspace 101 silent, class:^(KiCad|kicad)$, title:.*PCB Editor.*"
"maximize, class:^(KiCad|kicad)$, title:.*PCB Editor.*"
"group set, class:^(KiCad|kicad)$, title:.*PCB Editor.*"
"workspace 101 silent, class:^(KiCad|kicad)$, title:.*Footprint Editor.*"
"maximize, class:^(KiCad|kicad)$, title:.*Footprint Editor.*"
"group set, class:^(KiCad|kicad)$, title:.*Footprint Editor.*"
];
# Workspace rules
workspace = [
"50, monitor:eDP-1, defaultName:terminal"
"60, monitor:DP-3, defaultName:code"
"70, monitor:DP-3, defaultName:browser"
"71, monitor:eDP-1, defaultName:browser"
"80, monitor:eDP-1, defaultName:files"
"90, monitor:DP-3, defaultName:video"
"101, monitor:DP-3, defaultName:kicad_prim"
"102, monitor:eDP-1, defaultName:kicad_sec"
"110, monitor:DP-3, defaultName:freecad"
];
};
}

View file

@ -0,0 +1,81 @@
# Hyprland general settings
# Input, appearance, layout, gestures, misc
{ ... }:
{
wayland.windowManager.hyprland.settings = {
# Input configuration
input = {
kb_layout = "us";
numlock_by_default = true;
follow_mouse = 1;
sensitivity = 0;
touchpad = {
natural_scroll = true;
};
};
# General settings
general = {
gaps_in = 5;
gaps_out = 5;
border_size = 2;
layout = "dwindle";
};
# Decoration
decoration = {
rounding = 10;
# blur = {
# enabled = true;
# size = 3;
# passes = 1;
# };
# shadow = {
# enabled = true;
# range = 4;
# render_power = 3;
# };
};
# Animations
animations = {
enabled = true;
# bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
# "windows, 1, 7, myBezier"
# "windowsOut, 1, 7, default, popin 80%"
# "border, 1, 10, default"
# "fade, 1, 7, default"
"workspaces, 1, 4, default, slidevert"
];
};
# Layout settings
dwindle = {
pseudotile = true;
preserve_split = true;
};
# Gestures (Hyprland 0.51+ new syntax)
gestures = {
workspace_swipe_distance = 500;
workspace_swipe_invert = false;
workspace_swipe_create_new = false;
};
# New gesture bindings (replaces workspace_swipe)
# Vertical 3-finger swipe for workspace switching
gesture = [
"3, vertical, workspace"
];
# Misc
misc = {
force_default_wallpaper = 0;
disable_hyprland_logo = true;
};
};
}