This commit is contained in:
death916 2025-08-12 00:28:05 -07:00
parent 247f6cc410
commit 14a1a2792c
8 changed files with 489 additions and 5 deletions

View file

@ -15,6 +15,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};
flox.url = "github:flox/flox";
hyprland.url = "github:hyprwm/Hyprland";
};
outputs =
@ -25,6 +26,7 @@
home-manager,
rust-overlay,
flox,
hyprland,
...
}:
let
@ -47,10 +49,12 @@
system
overlays
primaryUser
hyprland # Pass hyprland to specialArgs
;
unstablePkgs = import nixpkgs-unstable { inherit system; };
};
modules = [
hyprland.nixosModules.default # Add this line
./nixos/configuration.nix
./nixos/hardware-configuration.nix
home-manager.nixosModules.home-manager

View file

@ -13,7 +13,10 @@ let
tmuxai-pkg = pkgs.callPackage tmuxaiPackageDir { };
in
{
imports = [ ../modules/home-manager/common.nix ];
imports = [
../modules/home-manager/common.nix
./hyprland.nix # Add this line to import your Hyprland configuration
];
home.username = "death916";
home.homeDirectory = "/home/death916";

445
home-manager/hyprland.nix Normal file
View file

@ -0,0 +1,445 @@
# home-manager/hyprland.nix
{ config, pkgs, inputs, ... }:
{
# Enable Hyprland and XWayland
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true; # For XWayland applications
# Hyprland configuration settings
settings = {
# Monitors
monitor = ",preferred,auto,1"; # Auto-detect primary monitor
# Execute on startup
exec-once = [
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"swww init &" # Wallpaper daemon
"swww img /path/to/your/wallpaper.jpg &" # Set your wallpaper path here
"waybar &" # Start Waybar
"dunst &" # Start Dunst notification daemon
"nm-applet --indicator &" # NetworkManager applet
"blueman-applet &" # Bluetooth applet
];
# General settings
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 2;
"col.active_border" = "rgba(cba6f7ee) rgba(1e66f5ee) 45deg"; # Catppuccin Lavender/Blue
"col.inactive_border" = "rgba(313244aa)"; # Catppuccin Surface0
layout = "dwindle"; # Or "master", "tile"
};
# Decoration
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 3;
passes = 1;
};
drop_shadow = true;
shadow_range = 4;
shadow_render_power = 3;
"col.shadow" = "rgba(1a1a1aee)";
};
# 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"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default"
];
};
# Input
input = {
kb_layout = "us";
follow_mouse = 1;
touchpad = {
natural_scroll = true;
};
sensitivity = 1.0; # 0.0 - 1.0, 1.0 = no modification
};
# Dwindle layout (default)
dwindle = {
pseudotile = true; # Master switch for pseudotiling. Enabling this means windows will not resize when moved into a master area.
force_split = 2; # Master switch for forcing splitting.
};
# Gestures
gestures = {
workspace_swipe = true;
};
# Keybindings
bind = [
# Window management
"SUPER, Q, killactive,"
"SUPER, M, exit,"
"SUPER, F, fullscreen,"
"SUPER, Space, togglefloating,"
"SUPER, P, pseudo," # Master switch for pseudotiling.
"SUPER, J, togglesplit," # Master switch for splitting.
# Move focus
"SUPER, left, movefocus, l"
"SUPER, right, movefocus, r"
"SUPER, up, movefocus, u"
"SUPER, down, movefocus, d"
# Move windows
"SUPER SHIFT, left, movewindow, l"
"SUPER SHIFT, right, movewindow, r"
"SUPER SHIFT, up, movewindow, u"
"SUPER SHIFT, down, movewindow, d"
# Workspaces
"SUPER, 1, workspace, 1"
"SUPER, 2, workspace, 2"
"SUPER, 3, workspace, 3"
"SUPER, 4, workspace, 4"
"SUPER, 5, workspace, 5"
"SUPER, 6, workspace, 6"
"SUPER, 7, workspace, 7"
"SUPER, 8, workspace, 8"
"SUPER, 9, workspace, 9"
"SUPER, 0, workspace, 10"
# Move window to workspace
"SUPER SHIFT, 1, movetoworkspace, 1"
"SUPER SHIFT, 2, movetoworkspace, 2"
"SUPER SHIFT, 3, movetoworkspace, 3"
"SUPER SHIFT, 4, movetoworkspace, 4"
"SUPER SHIFT, 5, movetoworkspace, 5"
"SUPER SHIFT, 6, movetoworkspace, 6"
"SUPER SHIFT, 7, movetoworkspace, 7"
"SUPER SHIFT, 8, movetoworkspace, 8"
"SUPER SHIFT, 9, movetoworkspace, 9"
"SUPER SHIFT, 0, movetoworkspace, 10"
# Scroll through workspaces
"SUPER, mouse_down, workspace, e+1"
"SUPER, mouse_up, workspace, e-1"
# Application launchers
"SUPER, Return, exec, alacritty" # Terminal
"SUPER, D, exec, rofi -show drun" # Rofi application launcher
"SUPER, W, exec, firefox" # Web browser
"SUPER, E, exec, dolphin" # File manager
# Screenshots
"SUPER, Print, exec, grim -g \"$(slurp)\" - | wl-copy" # Screenshot selection to clipboard
"SUPER SHIFT, Print, exec, grim - | wl-copy" # Screenshot full screen to clipboard
];
# Window rules
windowrulev2 = [
"float,title:^(Picture-in-Picture)$"
"float,class:^(confirm)$"
"float,class:^(dialog)$"
"float,class:^(file_progress)$"
"float,class:^(confirmreset)$"
"float,class:^(makeinput)$"
"float,class:^(dialog)$"
"float,class:^(download)$"
"float,class:^(notification)$"
"float,class:^(error)$"
"float,class:^(pinentry)$"
"float,class:^(ssh-askpass)$"
"float,class:^(lxpolkit)$"
"float,class:^(thunar)" # Example: float Thunar if you prefer
"float,class:^(pavucontrol)" # Example: float Pavucontrol
"float,class:^(blueman-applet)"
"float,class:^(nm-applet)"
"nofocus,class:^(nm-applet)"
"nofocus,class:^(blueman-applet)"
];
};
};
# Waybar (status bar)
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 30;
spacing = 4;
modules-left = [ "hyprland/workspaces" "hyprland/window" ];
modules-center = [ "clock" ];
modules-right = [ "pulseaudio" "network" "cpu" "memory" "battery" ];
"hyprland/workspaces" = {
format = "{icon}";
format-icons = {
"1" = "󰎤"; # 1
"2" = "󰎧"; # 2
"3" = "󰎪"; # 3
"4" = "󰎭"; # 4
"5" = "󰎱"; # 5
"6" = "󰎳"; # 6
"7" = "󰎶"; # 7
"8" = "󰎹"; # 8
"9" = "󰎼"; # 9
"10" = "󰎿"; # 10
"active" = "";
"default" = "";
};
};
"hyprland/window" = {
max-length = 50;
};
"clock" = {
format = " {:%H:%M:%S} {:%Y-%m-%d}";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
"pulseaudio" = {
format = "{icon} {volume}%";
format-muted = " Muted";
format-icons = {
"default" = [ "" "" "" ];
};
};
"network" = {
format-wifi = " {essid} ({signalStrength}%)";
format-ethernet = " {ifname}";
format-disconnected = " Disconnected";
};
"cpu" = {
format = " {usage}%";
};
"memory" = {
format = " {}%";
};
"battery" = {
format = "{icon} {capacity}%";
format-charging = " {capacity}%";
format-plugged = " {capacity}%";
format-alt = "{time} {icon}";
format-icons = [ "" "" "" "" "" ];
};
};
};
style = ''
/* Catppuccin Mocha colors */
@define-color rosewater #f5e0dc;
@define-color flamingo #f2cdcd;
@define-color pink #f5c2e7;
@define-color mauve #cba6f7;
@define-color red #f38ba8;
@define-color maroon #eba0ac;
@define-color peach #fab387;
@define-color yellow #f9e2af;
@define-color green #a6e3a1;
@define-color teal #94e2d5;
@define-color sky #89dceb;
@define-color sapphire #74c7ec;
@define-color blue #89b4fa;
@define-color lavender #b4befe;
@define-color text #cdd6f4;
@define-color subtext1 #bac2de;
@define-color subtext0 #a6adc8;
@define-color overlay2 #9399b2;
@define-color overlay1 #7f849c;
@define-color overlay0 #6c7086;
@define-color surface2 #585b70;
@define-color surface1 #45475a;
@define-color surface0 #313244;
@define-color base #1e1e2e;
@define-color mantle #181825;
@define-color crust #11111b;
* {
font-family: "JetBrainsMono Nerd Font", monospace;
font-size: 13px;
}
window#waybar {
background-color: @crust;
border-bottom: 2px solid @surface0;
color: @text;
}
#workspaces button {
padding: 0 5px;
background-color: transparent;
color: @overlay1;
border-radius: 0;
}
#workspaces button.active {
color: @lavender;
border-bottom: 2px solid @lavender;
}
#workspaces button:hover {
background-color: @surface0;
}
#window, #clock, #pulseaudio, #network, #cpu, #memory, #battery {
padding: 0 10px;
background-color: @mantle;
margin: 0 4px;
border-radius: 8px;
}
#pulseaudio.muted {
color: @red;
}
#battery.charging, #battery.plugged {
color: @green;
}
#battery.warning:not(.charging) {
color: @yellow;
}
#battery.critical:not(.charging) {
color: @red;
}
'';
};
# Rofi (application launcher)
programs.rofi = {
enable = true;
theme = "catppuccin"; # Use a Catppuccin theme for Rofi
extraConfig = {
modi = "drun,run,ssh";
show-icons = true;
icon-theme = "Papirus-Dark";
};
};
# Dunst (notification daemon)
services.dunst = {
enable = true;
settings = {
global = {
monitor = 0;
follow = "keyboard";
width = 300;
height = 50;
offset = "10x50";
origin = "top-right";
font = "JetBrainsMono Nerd Font 10";
line_height = 0;
notification_height = 0;
separator_height = 2;
padding = 8;
horizontal_padding = 8;
frame_width = 2;
frame_color = "#cba6f7"; # Catppuccin Lavender
separator_color = "frame";
word_wrap = true;
ellipsize = "middle";
ignore_dbus_close = false;
force_xinerama = false;
corner_radius = 10;
transparency = 5;
idle_threshold = 120;
markup = "full";
format = "<b>%s</b>\n%b";
alignment = "left";
bounce_freq = 0;
show_age_threshold = 60;
icon_position = "left";
max_icon_size = 32;
sticky_history = true;
history_length = 20;
browser = pkgs.firefox;
always_run_script = true;
startup_notification = false;
indicate_hidden = true;
shrink = false;
close_on_click = true;
sort = true;
stack_duplicates = true;
hide_duplicate_count = false;
show_indicators = true;
};
urgency_low = {
background = "#1e1e2e"; # Catppuccin Base
foreground = "#cdd6f4"; # Catppuccin Text
};
urgency_normal = {
background = "#1e1e2e"; # Catppuccin Base
foreground = "#cdd6f4"; # Catppuccin Text
};
urgency_critical = {
background = "#f38ba8"; # Catppuccin Red
foreground = "#1e1e2e"; # Catppuccin Base
};
};
};
# Wallpaper setter
services.swww = {
enable = true;
# You'll set the actual wallpaper in exec-once in Hyprland settings
};
# GTK Theming
gtk = {
enable = true;
theme = {
name = "Catppuccin-Mocha-Standard-Lavender-Dark";
package = pkgs.catppuccin-gtk.override {
accents = [ "lavender" ];
size = "standard";
variant = "mocha";
};
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
cursorTheme = {
name = "Catppuccin-Mocha-Dark-Cursors";
package = pkgs.catppuccin-cursors.override {
accents = [ "lavender" ];
variant = "mocha";
};
size = 24;
};
};
# Fonts
fonts.fontconfig.enable = true;
home.packages = with pkgs; [
# Nerd Fonts for icons in Waybar, Rofi, etc.
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
font-awesome # For some older icons
# Tools for screenshots
grim # Screenshot tool
slurp # Selection tool for grim
# Network/Bluetooth applets
networkmanagerapplet
blueman
];
}

View file

@ -22,6 +22,9 @@
"flakes"
];
nix.settings.substituters = [ "https://hyprland.cachix.org" ];
nix.settings.trusted-public-keys = [ "hyprland.cachix.org-1:fAmf/fNyvJx5Jzlkz2eX2/RjY8w+FzB9q/t0B/s/aA4=" ];
zramSwap.enable = true;
swapDevices = [
{

View file

@ -15,13 +15,15 @@
services.xserver.displayManager.gdm.enable = false;
services.xserver.desktopManager.gnome.enable = false;
#cosmic instead
services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.enable = true;
services.desktopManager.cosmic.xwayland.enable = true;
# services.desktopManager.cosmic.enable = true;
# services.displayManager.cosmic-greeter.enable = true;
# services.desktopManager.cosmic.xwayland.enable = true;
# This is to fix clementine gui not showing up on wayland
environment.variables.QT_QPA_PLATFORM = "wayland";
environment.sessionVariables.NIXOS_OZONE_WL = "1"; # Required for some Electron apps
nix.settings.trusted-substituters = [ "https://cache.flox.dev" ];
nix.settings.trusted-public-keys = [
"flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs="

View file

@ -0,0 +1,16 @@
{ config, pkgs, ... }:
{
# Enable PipeWire for audio
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
};
# Enable Polkit for privilege escalation
security.polkit.enable = true;
# Enable Fonts
fonts.fontDir.enable = true;
}

View file

@ -11,6 +11,6 @@
isNormalUser = true;
home = "/home/${primaryUser}";
description = "${primaryUser}";
extraGroups = [ "wheel" "networkmanager" ];
extraGroups = [ "wheel" "networkmanager" "video" ];
};
}

View file

@ -19,7 +19,18 @@
../modules/nixos/common/base.nix
../modules/nixos/laptop/user.nix
../modules/nixos/common/tailscale.nix
../modules/nixos/laptop/hyprland-deps.nix # New module for Hyprland dependencies
];
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --cmd Hyprland";
user = "death916";
};
};
};
system.stateVersion = "24.11";
}