added new usb system, started modularizing

This commit is contained in:
2025-06-13 18:52:13 +02:00
parent 58b0456f8c
commit 0a731ef17f
17 changed files with 669 additions and 354 deletions

View File

@@ -1,228 +1,251 @@
{inputs, pkgs, ...}:
{inputs, pkgs, lib, config, ...}:
let
cfg = config.nix-config.hypr;
in
{
home.packages = [
pkgs.hyprshot
pkgs.nautilus
pkgs.gnome-control-center
pkgs.brightnessctl
pkgs.cliphist
pkgs.wl-clipboard
pkgs.gcr # Provides org.gnome.keyring.SystemPrompter
];
options = {
nix-config.hypr.internal-screen.resolution = lib.mkOption { type = lib.types.str; };
nix-config.hypr.internal-screen.scale = lib.mkOption { type = lib.types.str; };
nix-config.hypr.browser = lib.mkOption {
type = lib.types.str;
default = "firefox";
description = "The browser to use in Hyprland.";
};
nix-config.hypr.launcher-cmd = lib.mkOption {
type = lib.types.str;
default = "wofi --show drun -n";
description = "The command to launch the application launcher in Hyprland.";
};
nix-config.hypr.ide = lib.mkOption {
type = lib.types.str;
default = "code";
description = "The IDE to use in Hyprland.";
};
};
config = {
home.packages = [
pkgs.hyprshot
pkgs.nautilus
pkgs.gnome-control-center
pkgs.gnome-bluetooth # needed by gnome-control-center to manage bluetooth
pkgs.brightnessctl
pkgs.cliphist
pkgs.wl-clipboard
pkgs.gcr # Provides org.gnome.keyring.SystemPrompter
];
# Also use gnome keyring
services.gnome-keyring.enable = true;
# Also use gnome keyring
services.gnome-keyring.enable = true;
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = true;
settings = {
"$mod" = "SUPER";
"$browser" = "firefox";
"$launcher-cmd" = "wofi --show drun -n";
"$ide" = "code";
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = true;
settings = {
"$mod" = "SUPER";
# Global bindings
bind = [
# Launch applications
"$mod, space, exec, $launcher-cmd"
"$mod, return, exec, kitty"
"$mod, b, exec, $browser"
"$mod, s, exec, $ide"
"$mod, e, exec, nautilus"
# Global bindings
bind = [
# Launch applications
"$mod, space, exec, ${cfg.launcher-cmd}"
"$mod, return, exec, kitty"
"$mod, b, exec, ${cfg.browser}"
"$mod, s, exec, ${cfg.ide}"
"$mod, e, exec, nautilus"
# Lock screen
"$mod, l, exec, hyprlock"
# Lock screen
"$mod, l, exec, hyprlock"
# Clipboard management
"$mod, V, exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy"
# Clipboard management
"$mod, V, exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy"
# Close window
"$mod, Q, killactive,"
"$mod+Shift, Q, exit," # this is the true kill
# Close window
"$mod, Q, killactive,"
"$mod+Shift, Q, exit," # this is the true kill
# Toggle Floating and reduce size
"$mod, f, togglefloating,"
"$mod, f, resizeactive, 50% 50%,"
# Toggle fullscreen
"$mod+Shift, f, fullscreen,"
# Toggle Floating and reduce size
"$mod, f, togglefloating,"
"$mod, f, resizeactive, 50% 50%,"
# Toggle fullscreen
"$mod+Shift, f, fullscreen,"
# Alt-tab alternative
"$mod, Tab, cyclenext,"
"$mod, Tab, bringactivetotop,"
# Alt-tab alternative
"$mod, Tab, cyclenext,"
"$mod, Tab, bringactivetotop,"
# Move the window
"$mod+Shift, left, movewindow, l"
"$mod+Shift, right, movewindow, r"
"$mod+Shift, up, movewindow, u"
"$mod+Shift, down, movewindow, d"
# Move the window
"$mod+Shift, left, movewindow, l"
"$mod+Shift, right, movewindow, r"
"$mod+Shift, up, movewindow, u"
"$mod+Shift, down, movewindow, d"
"$mod+Ctrl, left, movetoworkspace, -1"
"$mod+Ctrl, right, movetoworkspace, +1"
"$mod+Ctrl, left, movetoworkspace, -1"
"$mod+Ctrl, right, movetoworkspace, +1"
# Switch workspace
"$mod+Alt, left, workspace, -1"
"$mod+Alt, right, workspace, +1"
# Switch workspace
"$mod+Alt, left, workspace, -1"
"$mod+Alt, right, workspace, +1"
# Screenshot
"$mod, Print, exec, hyprshot -m region -o ~/Pictures/Screenshots"
"$mod+Shift, Print, exec, hyprshot -m window -o ~/Pictures/Screenshots"
# Screenshot
"$mod, Print, exec, hyprshot -m region -o ~/Pictures/Screenshots"
"$mod+Shift, Print, exec, hyprshot -m window -o ~/Pictures/Screenshots"
];
];
# repeatable bindings
binde = [
# Fn keys
", XF86MonBrightnessDown, exec, brightnessctl set 5%-"
", XF86MonBrightnessUp, exec, brightnessctl set +5%"
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%-"
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
# repeatable bindings
binde = [
# Fn keys
", XF86MonBrightnessDown, exec, brightnessctl set 5%-"
", XF86MonBrightnessUp, exec, brightnessctl set +5%"
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%-"
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
# Reshape the window in focus
"$mod, MINUS, resizeactive, -2% -2%"
"$mod, KP_Subtract, resizeactive, -2% -2%"
"$mod, PLUS, resizeactive, 2% 2%"
"$mod, KP_Add, resizeactive, 2% 2%"
# Reshape the window in focus
"$mod, MINUS, resizeactive, -2% -2%"
"$mod, KP_Subtract, resizeactive, -2% -2%"
"$mod, PLUS, resizeactive, 2% 2%"
"$mod, KP_Add, resizeactive, 2% 2%"
];
];
# lock-screen bindings
bindl = [
# on lid close, lock the screen
# if another monitor is connected, only turn the internal monitor off and don't lock the screen
", switch:on:Lid Switch, exec, hyprctl dispatch dpms off eDP-1"
# if there is no active monitor, perform a screen lock
", switch:on:Lid Switch, exec, hyprctl monitors | grep 'dpmsStatus: 1' || hyprlock"
", switch:off:Lid Switch, exec, hyprctl dispatch dpms on eDP-1"
];
# lock-screen bindings
bindl = [
# on lid close, lock the screen
# if another monitor is connected, only turn the internal monitor off and don't lock the screen
", switch:on:Lid Switch, exec, hyprctl dispatch dpms off eDP-1"
# if there is no active monitor, perform a screen lock
", switch:on:Lid Switch, exec, hyprctl monitors | grep 'dpmsStatus: 1' || hyprlock"
", switch:off:Lid Switch, exec, hyprctl dispatch dpms on eDP-1"
];
# bindr = [
# # Overview
# "$mod, , overview:toggle"
# ];
# bindr = [
# # Overview
# "$mod, , overview:toggle"
# ];
bindm = [
# move the window
"$mod, mouse:272, movewindow"
];
bindm = [
# move the window
"$mod, mouse:272, movewindow"
];
exec-once = [
"gnome-keyring-daemon --start --components=secrets"
# "${pkgs.hyprpaper}/bin/hyprpaper"
# hyprpaper is handled as its own service
"${pkgs.waybar}/bin/waybar"
# listen to clipboard events and send them to cliphist
"wl-paste --watch cliphist store"
"${pkgs.waybar}/bin/hypridle"
"hyprpaper"
# # Fixes cursor themes in gnome apps under hyprland
# "gsettings set org.gnome.desktop.interface cursor-theme '${config.home.pointerCursor.name}'"
# "gsettings set org.gnome.desktop.interface cursor-size ${toString home.pointerCursor.size}"
"${pkgs.owncloud-client}"
];
exec-once = [
"gnome-keyring-daemon --start --components=secrets"
# "${pkgs.hyprpaper}/bin/hyprpaper"
# hyprpaper is handled as its own service
"${pkgs.waybar}/bin/waybar"
# listen to clipboard events and send them to cliphist
"wl-paste --watch cliphist store"
"${pkgs.waybar}/bin/hypridle"
"hyprpaper"
# # Fixes cursor themes in gnome apps under hyprland
# "gsettings set org.gnome.desktop.interface cursor-theme '${config.home.pointerCursor.name}'"
# "gsettings set org.gnome.desktop.interface cursor-size ${toString home.pointerCursor.size}"
"${pkgs.owncloud-client}"
];
general = {
resize_on_border = true;
gaps_in = 5;
gaps_out = 5;
border_size = 1;
"col.active_border" = "rgb(98971A) rgb(CC241D) 45deg";
layout = "master";
};
misc = {
# disable refreshs when nothing is going on
vfr = false;
disable_hyprland_logo = true;
};
input = {
kb_layout = "de";
# remap caps lock to ctrl
kb_options = "ctrl:nocaps";
numlock_by_default = true;
# mouse input should be unchanged
natural_scroll = false;
sensitivity = 0.3;
touchpad = {
disable_while_typing = false;
natural_scroll = true;
general = {
resize_on_border = true;
gaps_in = 5;
gaps_out = 5;
border_size = 1;
"col.active_border" = "rgb(98971A) rgb(CC241D) 45deg";
layout = "master";
};
};
device = {
name = "syna329a:00-06cb:cd4f-touchpad";
sensitivity = 0.5;
};
misc = {
# disable refreshs when nothing is going on
vfr = false;
disable_hyprland_logo = true;
};
gestures = {
workspace_swipe = true;
workspace_swipe_fingers = 4;
workspace_swipe_touch = true;
};
input = {
kb_layout = "de";
# remap caps lock to ctrl
kb_options = "ctrl:nocaps";
numlock_by_default = true;
# mouse input should be unchanged
natural_scroll = false;
sensitivity = 0.3;
touchpad = {
disable_while_typing = false;
natural_scroll = true;
};
};
decoration = {
rounding = 7;
# active_opacity = 0.95;
inactive_opacity = 0.9;
device = {
name = "syna329a:00-06cb:cd4f-touchpad";
sensitivity = 0.5;
};
shadow = {
gestures = {
workspace_swipe = true;
workspace_swipe_fingers = 4;
workspace_swipe_touch = true;
};
decoration = {
rounding = 7;
# active_opacity = 0.95;
inactive_opacity = 0.9;
shadow = {
enabled = false;
};
# blur is set on a per-program basis
windowrulev2 = [
# kitty should behave like a floating window
"animation popin, class:kitty"
"move cursor -50% -50%, class:kitty"
"float, class:kitty"
"size 50% 50%, class:kitty"
# some more floating windows
"float, class:org.gnome.Settings"
"float, class:desktopclient.owncloud.com"
"float, class:org.keepassxc.KeePassXC"
];
};
monitor = [
# the internal monitor, always at the "center"
"eDP-1, ${cfg.internal-screen.resolution}, 0x0, ${cfg.internal-screen.scale}"
# Samsung monitors at irchel (matching the description)
# "desc:Samsung Electric Company LS27D80xU HK7X800803, 3840x2160, auto-up, 1.8"
"desc:Samsung Electric Company LS27D80xU HNAX600169, 2560x1440@59.95, auto-up, 1"
", preferred, auto-up, auto" # automatically add any newly detected monitor
];
xwayland = {
enabled = false;
};
# blur is set on a per-program basis
windowrulev2 = [
# kitty should behave like a floating window
"animation popin, class:kitty"
"move cursor -50% -50%, class:kitty"
"float, class:kitty"
"size 50% 50%, class:kitty"
# some more floating windows
"float, class:org.gnome.Settings"
"float, class:desktopclient.owncloud.com"
"float, class:org.keepassxc.KeePassXC"
env = [
# force apps to use wayland
"NIXOS_OZONE_WL, 1"
"ELECTRON_OZONE_PLATFORM_HINT, wayland"
# set the scale factor for GDK apps
"GDK_SCALE, 1.7"
# set the scale factor for QT apps
"QT_SCALE_FACTOR, 1.7"
# set the scale factor for GTK apps
];
};
monitor = [
"eDP-1, 3840x2160, 0x0, 1.666667" # the internal laptop monitor
# Samsung monitors at irchel (matching the description)
# "desc:Samsung Electric Company LS27D80xU HK7X800803, 3840x2160, auto-up, 1.8"
"desc:Samsung Electric Company LS27D80xU HNAX600169, 2560x1440@59.95, auto-up, 1"
", preferred, auto-up, auto" # automatically add any newly detected monitor
];
xwayland = {
enabled = false;
};
env = [
# force apps to use wayland
"NIXOS_OZONE_WL, 1"
"ELECTRON_OZONE_PLATFORM_HINT, wayland"
# set the scale factor for GDK apps
"GDK_SCALE, 1.7"
# set the scale factor for QT apps
"QT_SCALE_FACTOR, 1.7"
# set the scale factor for GTK apps
plugins = [
# Global overview
pkgs.hyprlandPlugins.hyprspace
# Touch gestures
pkgs.hyprlandPlugins.hyprgrass
];
};
plugins = [
# Global overview
pkgs.hyprlandPlugins.hyprspace
# Touch gestures
pkgs.hyprlandPlugins.hyprgrass
];
services.swaync.enable = true;
};
services.swaync.enable = true;
}

View File

@@ -1,4 +1,7 @@
{inputs, pkgs, ...}:
{inputs, pkgs, lib, config, ...}:
let
cfg = config.nix-config.style;
in
{
# required to autoload fonts from packages installed via Home Manager
fonts.fontconfig.enable = true;
@@ -14,14 +17,16 @@
settings = {
mainBar = {
margin-top = 2;
margin-bottom = 2;
margin-left = 5;
margin-right = 5;
layer = "top";
position = "top";
spacing = 5;
margin-top = 5;
# margin-bottom = 2;
# margin-left = 5;
# margin-right = 5;
# margin between the modules
spacing = 2;
modules-left = [
"hyprland/workspaces"
@@ -36,8 +41,8 @@
modules-right = [
"tray"
"privacy"
"wireplumber"
"network"
"wireplumber"
"battery"
"backlight"
"idle_inhibitor"
@@ -150,18 +155,29 @@
return-type = "json";
exec-if = "which swaync-client";
exec = "swaync-client -swb";
on-click = "sleep 0.1 && task-waybar";
on-click = "swaync-client -t -sw";
on-click-right = "swaync-client -d -sw";
escape = true;
};
"network" = {
format = "󰤭";
format-wifi = "{icon} {essid}";
format-ethernet = " {ipaddr}";
format-wifi = "{icon}";
format-icons = [ "󰤯" "󰤟" "󰤢" "󰤥" "󰤨" ];
format-ethernet = "󰊗 {ipaddr}/{cidr}";
format-disconnected = "";
tooltip-format = "󰊗 {ifname} via {gwaddr}";
tooltip-format-wifi = "SSID: {essid}({signalStrength}%), {frequency} MHz\nInterface: {ifname}\nIP: {ipaddr}\nGW: {gwaddr}\n\n<span color='#a6da95'>{bandwidthUpBits}</span>\t<span color='#ee99a0'>{bandwidthDownBits}</span>\t<span color='#c6a0f6'>󰹹{bandwidthTotalBits}</span>";
tooltip-format-ethernet = "{ifname} ";
format-disconnected = "󰤭";
tooltip-format = " {ifname} via {gwaddr}";
# TODO - don't escape the strings in the tooltip
tooltip-format-wifi = ''
󰤨 {essid}({signalStrength}%), {frequency} GHz\nInterface: {ifname}
IP: {ipaddr} GW: {gwaddr}
<span color='#a6da95'>{bandwidthUpBits}</span> <span color='#ee99a0'>{bandwidthDownBits}</span> <span color='#c6a0f6'>󰹹{bandwidthTotalBits}</span>
'';
tooltip-format-ethernet = ''
{ifname} - {ipaddr}/{cidr}
<span color='#a6da95'>{bandwidthUpBits}</span> <span color='#ee99a0'>{bandwidthDownBits}</span> <span color='#c6a0f6'>󰹹{bandwidthTotalBits}</span>
'';
tooltip-format-disconnected = "Disconnected";
on-click = "XDG_CURRENT_DESKTOP=GNOME gnome-control-center wifi";
};
@@ -192,22 +208,20 @@
style = ''
* {
font-family: "FiraCode Nerd Font";
font-family: "${cfg.monospaceFont}";
font-weight: bold;
font-size: 20px;
font-size: ${builtins.toString (cfg.fontSizes.desktop + 7)}px;
}
window#waybar {
background-color: transparent;
}
.module {
background: rgba(0, 0, 0, 0.6);
color: white;
border-radius: 7px;
padding: 5px 5px 5px 5px;
margin: 5px 0;
}
box.module button:hover {
box-shadow: inset 0 -3px #ffffff;