Compare commits

...

5 commits

Author SHA1 Message Date
9499ffc8b5
Update to 1.0.0
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 0s
2025-08-18 19:33:52 -07:00
0cc5c347d1
Disable sway 2025-08-18 19:33:06 -07:00
0a0f1377a1
Remove duplicate password field 2025-08-17 22:39:27 -07:00
389b051a7a
Add hypridle and hyprlock 2025-08-17 22:27:12 -07:00
e19b036d3f
Initial add of hyprland module 2025-08-17 20:13:01 -07:00
8 changed files with 508 additions and 4 deletions

View file

@ -1,6 +1,8 @@
{ ... }: { lib, ... }:
{ {
aa.isHeadless = false; aa.isHeadless = false;
aa.windowManagers.sway.clamshell.enable = true; aa.windowManagers.sway.clamshell.enable = true;
aa.programs.opencode.enable = true; aa.programs.opencode.enable = true;
aa.windowManagers.hyprland.enable = true;
aa.windowManagers.sway.enable = lib.mkForce false;
} }

View file

@ -0,0 +1,112 @@
{
config,
pkgs,
lib,
namespace,
...
}:
let
inherit (lib)
mkIf
mkEnableOption
mkOption
types
;
cfg = config.${namespace}.programs.hyprlock;
in
{
options.${namespace}.programs.hyprlock = {
enable = mkEnableOption "hyprlock";
backgroundPath = mkOption {
type = types.str;
default = "screenshot";
description = ''
Path to background image or "screenshot" to use desktop screenshot
'';
};
settings = mkOption {
type = types.attrs;
default = { };
description = ''
Additional hyprlock configuration settings
'';
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.hyprlock ];
catppuccin.hyprlock.enable = true;
programs.hyprlock = {
enable = true;
settings = lib.mkMerge [
{
general = {
hide_cursor = false;
ignore_empty_input = false;
text_trim = true;
fractional_scaling = 2;
fail_timeout = 2000;
};
auth = {
pam = {
enabled = true;
module = "hyprlock";
};
fingerprint = {
enabled = false;
ready_message = "(Scan fingerprint to unlock)";
present_message = "Scanning fingerprint";
};
};
background = [
{
monitor = "";
path = cfg.backgroundPath;
color = "rgba(17, 17, 17, 1.0)";
blur_passes = 2;
blur_size = 7;
noise = 0.0117;
contrast = 0.8916;
brightness = 0.8172;
vibrancy = 0.1696;
vibrancy_darkness = 0.05;
}
];
# Time label
label = [
{
monitor = "";
text = "cmd[update:1000] echo \"$(date +\"%H:%M\")\"";
color = "$text";
font_size = 120;
font_family = "Hack Nerd Font";
position = "0, 300";
halign = "center";
valign = "center";
}
# Date label
{
monitor = "";
text = "cmd[update:1000] echo \"$(date +\"%A, %B %d\")\"";
color = "$text";
font_size = 24;
font_family = "Hack Nerd Font";
position = "0, 200";
halign = "center";
valign = "center";
}
];
}
cfg.settings
];
};
};
}

View file

@ -31,7 +31,7 @@ in
programs.waybar = { programs.waybar = {
enable = true; enable = true;
systemd.enable = true; # systemd.enable = true;
style = builtins.readFile ./waybar_style.css; style = builtins.readFile ./waybar_style.css;
@ -40,7 +40,10 @@ in
layer = "top"; layer = "top";
position = "bottom"; position = "bottom";
height = 20; height = 20;
modules-left = [ "sway/workspaces" ]; modules-left = [
"sway/workspaces"
"hyprland/workspaces"
];
modules-center = [ "clock" ]; modules-center = [ "clock" ];
modules-right = [ modules-right = [
"idle_inhibitor" "idle_inhibitor"
@ -55,6 +58,22 @@ in
"tray" "tray"
]; ];
"hyprland/workspaces" = {
disable-scroll = false;
all-outputs = true;
format = "{icon}";
format-icons = {
"1" = "q";
"2" = "w";
"3" = "e";
"4" = "r";
"5" = "t";
"6" = "y";
"7" = "u";
"8" = "i";
"9" = "o";
};
};
"sway/workspaces" = { "sway/workspaces" = {
disable-scroll = false; disable-scroll = false;
all-outputs = true; all-outputs = true;

View file

@ -50,6 +50,7 @@ window#waybar.hidden {
background-color: rgba(0, 0, 0, 1) background-color: rgba(0, 0, 0, 1)
} }
#workspaces button.active,
#workspaces button.focused { #workspaces button.focused {
color: @yellow; color: @yellow;
} }

View file

@ -0,0 +1,110 @@
{
config,
pkgs,
lib,
namespace,
...
}:
let
inherit (lib)
mkIf
mkEnableOption
mkOption
types
;
cfg = config.${namespace}.services.hypridle;
in
{
options.${namespace}.services.hypridle = {
enable = mkEnableOption "hypridle";
lockTimeout = mkOption {
type = types.int;
default = 300;
description = ''
Timeout in seconds before locking the screen
'';
};
displayTimeout = mkOption {
type = types.int;
default = 330;
description = ''
Timeout in seconds before turning off the display
'';
};
suspendTimeout = mkOption {
type = types.int;
default = 1800;
description = ''
Timeout in seconds before suspending the system
'';
};
brightnessTimeout = mkOption {
type = types.int;
default = 150;
description = ''
Timeout in seconds before dimming screen brightness
'';
};
lockCommand = mkOption {
type = types.str;
default = "${pkgs.hyprlock}/bin/hyprlock";
description = ''
Command to run when locking the screen
'';
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.hypridle ];
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "pidof hyprlock || ${cfg.lockCommand}";
before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on";
ignore_dbus_inhibit = false;
ignore_systemd_inhibit = false;
};
listener = [
# Dim screen brightness
{
timeout = cfg.brightnessTimeout;
on-timeout = "${pkgs.brightnessctl}/bin/brightnessctl -s set 10";
on-resume = "${pkgs.brightnessctl}/bin/brightnessctl -r";
}
# Turn off keyboard backlight (if available)
{
timeout = cfg.brightnessTimeout;
on-timeout = "${pkgs.brightnessctl}/bin/brightnessctl -sd rgb:kbd_backlight set 0";
on-resume = "${pkgs.brightnessctl}/bin/brightnessctl -rd rgb:kbd_backlight";
}
# Lock screen
{
timeout = cfg.lockTimeout;
on-timeout = "loginctl lock-session";
}
# Turn off display
{
timeout = cfg.displayTimeout;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on && ${pkgs.brightnessctl}/bin/brightnessctl -r";
}
# Suspend system
{
timeout = cfg.suspendTimeout;
on-timeout = "systemctl suspend";
}
];
};
};
};
}

View file

@ -0,0 +1,260 @@
{
config,
pkgs,
lib,
namespace,
...
}:
let
inherit (lib)
mkEnableOption
mkOption
mkIf
types
;
cfg = config.${namespace}.windowManagers.hyprland;
left = "h";
right = "l";
up = "k";
down = "j";
modifier = "SUPER";
menu = "${pkgs.fuzzel}/bin/fuzzel";
emoji_picker = "${pkgs.bemoji}/bin/bemoji -t";
terminal = "${pkgs.kitty}/bin/kitty";
generate_grim_command = target: ''
exec mkdir -p ~/screenshots \
&& ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" \
~/screenshots/"$(date -u --iso-8601=seconds)".png && \
${pkgs.libnotify}/bin/notify-send "Screenshot saved"
'';
in
{
options.${namespace}.windowManagers.hyprland = {
enable = mkEnableOption "Hyprland";
wallpaperPath = mkOption {
type = types.str;
default = "hyprland/wallpaper.jpg";
description = ''
Path to wallpaper, relative to xdg.dataHome
'';
};
monitor = mkOption {
type = types.listOf types.str;
default = [
"eDP-1,preferred,auto,1.6"
",preferred,auto,1"
];
description = ''
Monitor configuration for Hyprland
'';
};
};
config = mkIf cfg.enable {
${namespace} = {
fonts.enable = true;
programs = {
kitty.enable = true;
fuzzel.enable = true;
waybar.enable = true;
hyprlock.enable = true;
};
services = {
gammastep.enable = true;
playerctld.enable = true;
swaync.enable = true;
hypridle.enable = true;
};
};
home.packages = with pkgs; [
grim
slurp
wl-clipboard
wtype
xdg-utils
libnotify
];
catppuccin.cursors = {
enable = true;
accent = "dark";
};
catppuccin.gtk.icon.enable = true;
catppuccin.kvantum = {
enable = true;
apply = true;
};
xdg.dataFile.${cfg.wallpaperPath}.source = ./wallpaper.jpg;
catppuccin.hyprland.enable = true;
wayland.windowManager.hyprland = {
enable = true;
systemd.variables = [ "--all" ];
settings = {
"$mod" = modifier;
# Monitor configuration
monitor = cfg.monitor;
# General settings
general = {
gaps_in = 5;
gaps_out = 20;
border_size = 2;
"col.active_border" = "$lavender";
"col.inactive_border" = "$overlay0";
layout = "dwindle";
allow_tearing = false;
};
# Decoration
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 3;
passes = 1;
};
};
# 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"
];
};
# Dwindle layout
dwindle = {
pseudotile = true;
preserve_split = true;
};
# Window rules
windowrulev2 = [
"suppressevent maximize, class:.*"
"idleinhibit fullscreen, class:.*"
];
# Startup
exec-once = [
"systemctl --user import-environment DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"${pkgs.swaynotificationcenter}/bin/swaync"
"${pkgs.waybar}/bin/waybar"
"hyprpaper"
];
# Keybindings
bind = [
# Applications
"$mod, Return, exec, ${terminal}"
"$mod, c, killactive"
"$mod, p, exec, ${menu}"
"$mod, d, exec, ${emoji_picker}"
"$mod, z, exec, hyprctl reload"
# Focus
"$mod, ${left}, movefocus, l"
"$mod, ${down}, movefocus, d"
"$mod, ${up}, movefocus, u"
"$mod, ${right}, movefocus, r"
# Move windows
"$mod SHIFT, ${left}, movewindow, l"
"$mod SHIFT, ${down}, movewindow, d"
"$mod SHIFT, ${up}, movewindow, u"
"$mod SHIFT, ${right}, movewindow, r"
# Workspaces (qwertyuio)
"$mod, q, workspace, 1"
"$mod, w, workspace, 2"
"$mod, e, workspace, 3"
"$mod, r, workspace, 4"
"$mod, t, workspace, 5"
"$mod, y, workspace, 6"
"$mod, u, workspace, 7"
"$mod, i, workspace, 8"
"$mod, o, workspace, 9"
# Move to workspaces
"$mod SHIFT, q, movetoworkspace, 1"
"$mod SHIFT, w, movetoworkspace, 2"
"$mod SHIFT, e, movetoworkspace, 3"
"$mod SHIFT, r, movetoworkspace, 4"
"$mod SHIFT, t, movetoworkspace, 5"
"$mod SHIFT, y, movetoworkspace, 6"
"$mod SHIFT, u, movetoworkspace, 7"
"$mod SHIFT, i, movetoworkspace, 8"
"$mod SHIFT, o, movetoworkspace, 9"
# Layout
"$mod, v, togglesplit"
"$mod, f, fullscreen"
"$mod SHIFT, f, togglefloating"
# "$mod, space, focusmode, toggle"
# "$mod, a, focusparent"
# Screenshots
"$mod, period, exec, ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" ~/screenshots/\"$(date -u --iso-8601=seconds)\".png && ${pkgs.libnotify}/bin/notify-send \"Screenshot saved\""
"$mod SHIFT, period, exec, ${pkgs.grim}/bin/grim ~/screenshots/\"$(date -u --iso-8601=seconds)\".png && ${pkgs.libnotify}/bin/notify-send \"Screenshot saved\""
# Notifications
"$mod SHIFT, n, exec, ${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw"
"$mod SHIFT, d, exec, ${pkgs.swaynotificationcenter}/bin/swaync-client -d -sw"
"$mod SHIFT, x, exec, hyprctl dispatch exit"
"$mod, x, exec, ${pkgs.hyprlock}/bin/hyprlock"
# Scratchpad
"$mod SHIFT, minus, movetoworkspace, special:magic"
"$mod, minus, togglespecialworkspace, magic"
];
# Media keys
bindl = [
", XF86AudioRaiseVolume, exec, ${pkgs.pamixer}/bin/pamixer --increase 5"
", XF86AudioLowerVolume, exec, ${pkgs.pamixer}/bin/pamixer --decrease 5"
", XF86AudioMute, exec, ${pkgs.pamixer}/bin/pamixer --toggle-mute"
", XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl previous"
", XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next"
", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause"
", XF86MonBrightnessDown, exec, ${pkgs.light}/bin/light -U 5"
", XF86MonBrightnessUp, exec, ${pkgs.light}/bin/light -A 5"
];
};
};
# Hyprpaper configuration for wallpaper
services.hyprpaper = {
enable = true;
settings = {
ipc = "on";
splash = false;
splash_offset = 2.0;
preload = [
"${config.xdg.dataHome}/${cfg.wallpaperPath}"
];
wallpaper = [
",${config.xdg.dataHome}/${cfg.wallpaperPath}"
];
};
};
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

View file

@ -7,7 +7,7 @@
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "catppuccin-swaync"; pname = "catppuccin-swaync";
version = "0.2.3"; version = "1.0.0";
src = fetchurl { src = fetchurl {
url = "https://github.com/catppuccin/swaync/releases/download/v${version}/${flavor}.css"; url = "https://github.com/catppuccin/swaync/releases/download/v${version}/${flavor}.css";