An opinionated NixOS configuration with Hyprland, featuring: - Modular flake-based architecture - Parameterized user configuration (username, timezone, locale, etc.) - Classical/antiquity theme with Thomas Cole wallpapers - Full Hyprland setup with waybar, rofi, swaync - Custom utility scripts (screenshots, screen recording, WiFi QR) - Neovim with LSP support - Interactive installer for existing NixOS systems - ISO builder for fresh installations Flake outputs: - nixosConfigurations.example - Test configuration - nixosConfigurations.installer - ISO installer - packages.iso - Bootable ISO image - apps.default - Interactive installer - lib.mkHost - Host builder function - templates.default - Starter template Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
259 lines
7.1 KiB
Nix
259 lines
7.1 KiB
Nix
# Hyprland user configuration
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
nomarchyConfig,
|
|
...
|
|
}: let
|
|
username = nomarchyConfig.username;
|
|
homeDir = "/home/${username}";
|
|
|
|
# Keyboard layouts
|
|
kbLayouts = builtins.concatStringsSep "," nomarchyConfig.keyboardLayouts;
|
|
kbVariants = builtins.concatStringsSep "," nomarchyConfig.keyboardVariants;
|
|
|
|
# Detect location for gammastep (default to UTC/0,0 if not set)
|
|
location = nomarchyConfig.location or {lat = 0; lon = 0;};
|
|
in {
|
|
wayland.windowManager.hyprland = {
|
|
enable = true;
|
|
systemd.enable = true;
|
|
|
|
settings = {
|
|
"$mod" = "SUPER";
|
|
"$terminal" = "ghostty";
|
|
"$fileManager" = "dolphin";
|
|
"$menu" = "rofi -show drun";
|
|
"$browser" = "firefox";
|
|
|
|
monitor = ",preferred,auto,auto";
|
|
|
|
exec-once = [
|
|
"$terminal"
|
|
"waybar & hyprpaper & firefox"
|
|
"nm-applet --indicator"
|
|
"blueman-applet"
|
|
"wl-paste --type text --watch cliphist store"
|
|
"wl-paste --type image --watch cliphist store"
|
|
"swaync"
|
|
"gammastep -l ${toString location.lat}:${toString location.lon} -t 6500:3500"
|
|
];
|
|
|
|
env = [
|
|
"XCURSOR_SIZE,24"
|
|
"HYPRCURSOR_SIZE,24"
|
|
];
|
|
|
|
general = {
|
|
gaps_in = 5;
|
|
gaps_out = 20;
|
|
border_size = 2;
|
|
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
|
|
"col.inactive_border" = "rgba(595959aa)";
|
|
resize_on_border = false;
|
|
allow_tearing = false;
|
|
layout = "dwindle";
|
|
};
|
|
|
|
decoration = {
|
|
rounding = 10;
|
|
active_opacity = 1.0;
|
|
inactive_opacity = 1.0;
|
|
|
|
shadow = {
|
|
enabled = true;
|
|
range = 4;
|
|
render_power = 3;
|
|
color = "rgba(1a1a1aee)";
|
|
};
|
|
|
|
blur = {
|
|
enabled = true;
|
|
size = 3;
|
|
passes = 1;
|
|
vibrancy = 0.1696;
|
|
};
|
|
};
|
|
|
|
animations = {
|
|
enabled = true;
|
|
bezier = [
|
|
"easeOutQuint,0.23,1,0.32,1"
|
|
"easeInOutCubic,0.65,0.05,0.36,1"
|
|
"linear,0,0,1,1"
|
|
"almostLinear,0.5,0.5,0.75,1.0"
|
|
"quick,0.15,0,0.1,1"
|
|
];
|
|
animation = [
|
|
"global, 1, 10, default"
|
|
"border, 1, 5.39, easeOutQuint"
|
|
"windows, 1, 4.79, easeOutQuint"
|
|
"windowsIn, 1, 4.1, easeOutQuint, popin 87%"
|
|
"windowsOut, 1, 1.49, linear, popin 87%"
|
|
"fadeIn, 1, 1.73, almostLinear"
|
|
"fadeOut, 1, 1.46, almostLinear"
|
|
"fade, 1, 3.03, quick"
|
|
"layers, 1, 3.81, easeOutQuint"
|
|
"layersIn, 1, 4, easeOutQuint, fade"
|
|
"layersOut, 1, 1.5, linear, fade"
|
|
"fadeLayersIn, 1, 1.79, almostLinear"
|
|
"fadeLayersOut, 1, 1.39, almostLinear"
|
|
"workspaces, 1, 1.94, almostLinear, fade"
|
|
"workspacesIn, 1, 1.21, almostLinear, fade"
|
|
"workspacesOut, 1, 1.94, almostLinear, fade"
|
|
];
|
|
};
|
|
|
|
dwindle = {
|
|
pseudotile = true;
|
|
preserve_split = true;
|
|
};
|
|
|
|
master = {
|
|
new_status = "master";
|
|
};
|
|
|
|
misc = {
|
|
force_default_wallpaper = 1;
|
|
disable_hyprland_logo = true;
|
|
disable_splash_rendering = true;
|
|
};
|
|
|
|
input = {
|
|
kb_layout = kbLayouts;
|
|
kb_variant = kbVariants;
|
|
kb_options = "grp:ralt_toggle";
|
|
repeat_delay = 150;
|
|
repeat_rate = 50;
|
|
follow_mouse = 1;
|
|
sensitivity = 0;
|
|
|
|
touchpad = {
|
|
natural_scroll = false;
|
|
};
|
|
};
|
|
|
|
device = {
|
|
name = "epic-mouse-v1";
|
|
sensitivity = "-0.5";
|
|
};
|
|
|
|
bindm = [
|
|
"$mod, mouse:272, movewindow"
|
|
"$mod, mouse:273, resizewindow"
|
|
];
|
|
|
|
bindel = [
|
|
",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
|
|
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
|
",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
|
",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
|
",XF86MonBrightnessUp, exec, brightnessctl s 10%+"
|
|
",XF86MonBrightnessDown, exec, brightnessctl s 10%-"
|
|
];
|
|
|
|
bindl = [
|
|
", XF86AudioNext, exec, playerctl next"
|
|
", XF86AudioPause, exec, playerctl play-pause"
|
|
", XF86AudioPlay, exec, playerctl play-pause"
|
|
", XF86AudioPrev, exec, playerctl previous"
|
|
];
|
|
|
|
bind = [
|
|
"$mod, Q, exec, $terminal"
|
|
"$mod, W, killactive,"
|
|
"$mod, M, exit,"
|
|
"$mod, E, exec, $fileManager"
|
|
"$mod, V, togglefloating,"
|
|
"$mod, R, exec, $menu"
|
|
"$mod, P, pseudo,"
|
|
"$mod, J, togglesplit,"
|
|
"$mod, B, exec, $browser"
|
|
"$mod, F, fullscreen, 0"
|
|
"$mod SHIFT, F, fullscreen, 1"
|
|
|
|
# Focus movement
|
|
"$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, 6, workspace, 6"
|
|
"$mod, 7, workspace, 7"
|
|
"$mod, 8, workspace, 8"
|
|
"$mod, 9, workspace, 9"
|
|
"$mod, 0, workspace, 10"
|
|
|
|
# Move 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"
|
|
|
|
# Scroll through workspaces
|
|
"$mod, mouse_down, workspace, e+1"
|
|
"$mod, mouse_up, workspace, e-1"
|
|
|
|
# Screenshots
|
|
", Print, exec, grim - | wl-copy -t image/png"
|
|
"$mod, Print, exec, ~/.local/bin/screenshot-region"
|
|
"$mod SHIFT, Print, exec, grim -g \"$(slurp)\" - | wl-copy -t image/png"
|
|
"$mod ALT, Print, exec, ~/.local/bin/screenshot-window"
|
|
|
|
# Screen recording toggle
|
|
"$mod SHIFT, R, exec, ~/.local/bin/screen-record"
|
|
|
|
# Quick Actions menu
|
|
"$mod, Space, exec, ~/.local/bin/quick-actions"
|
|
"$mod, slash, exec, ~/.local/bin/quick-actions"
|
|
|
|
# Power menu
|
|
"$mod, Escape, exec, ~/.local/bin/power-menu"
|
|
|
|
# Notification center
|
|
"$mod, A, exec, swaync-client -t -sw"
|
|
];
|
|
};
|
|
};
|
|
|
|
# Hyprpaper for wallpapers
|
|
services.hyprpaper = {
|
|
enable = true;
|
|
settings = {
|
|
splash = false;
|
|
# Default wallpaper - users can override
|
|
preload = [
|
|
"${homeDir}/.config/nomarchy/wallpapers/default.jpg"
|
|
];
|
|
wallpaper = ["eDP-1,${homeDir}/.config/nomarchy/wallpapers/default.jpg"];
|
|
};
|
|
};
|
|
|
|
# Ghostty terminal
|
|
programs.ghostty = {
|
|
enable = true;
|
|
settings = {
|
|
font-size = 14;
|
|
background-opacity = 0.85;
|
|
keybind = "shift+enter=text:\n";
|
|
};
|
|
};
|
|
}
|