aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorLeander Scherer <leander@schererleander.de>2026-01-08 16:04:28 +0100
committerLeander Scherer <leander@schererleander.de>2026-01-08 19:08:13 +0100
commite8f58189eb4d01ee2a7684a30b27fa187f37d1aa (patch)
tree467f70e63908db984c6fabb75f17c0575f476298 /modules
parent00f6f55df8924049b37f76e5a1fec1f4db0f6514 (diff)
refactor(cinnamon): remove hardcoded keyboard layout and disable orca
Diffstat (limited to 'modules')
-rw-r--r--modules/hosts/desktop/cinnamon/default.nix15
-rw-r--r--modules/hosts/desktop/gnome/dconf.nix20
-rw-r--r--modules/hosts/desktop/gnome/default.nix8
-rw-r--r--modules/hosts/desktop/hyprland/default.nix168
-rw-r--r--modules/hosts/desktop/hyprland/hyprlock.nix122
-rw-r--r--modules/hosts/desktop/labwc/default.nix203
-rw-r--r--modules/hosts/desktop/labwc/sfwbar.nix142
-rw-r--r--modules/hosts/desktop/sway/default.nix94
-rw-r--r--modules/hosts/desktop/sway/swayidle.nix49
-rw-r--r--modules/hosts/desktop/sway/swaylock.nix30
-rw-r--r--modules/hosts/desktop/waybar.nix73
11 files changed, 416 insertions, 508 deletions
diff --git a/modules/hosts/desktop/cinnamon/default.nix b/modules/hosts/desktop/cinnamon/default.nix
index 356bf42..5233ad1 100644
--- a/modules/hosts/desktop/cinnamon/default.nix
+++ b/modules/hosts/desktop/cinnamon/default.nix
@@ -10,9 +10,7 @@ let
cfg = config.nx.desktop.cinnamon;
in
{
- options.nx.desktop.cinnamon = {
- enable = mkEnableOption "Enable Cinnamon desktop environment";
- };
+ options.nx.desktop.cinnamon.enable = mkEnableOption "Enable Cinnamon desktop environment";
config = mkIf cfg.enable {
services.xserver.enable = true;
@@ -20,19 +18,10 @@ in
services.xserver.desktopManager.cinnamon.enable = true;
services.speechd.enable = mkForce false;
- services.orca.enable = mkForce true;
+ services.orca.enable = mkForce false;
environment.systemPackages = with pkgs; [
nemo-preview
];
-
- environment.variables.QT_QPA_PLATFORMTHEME = "qt5ct";
-
- services.xserver.xkb = {
- layout = "de";
- variant = "";
- };
-
- console.keyMap = "de";
};
}
diff --git a/modules/hosts/desktop/gnome/dconf.nix b/modules/hosts/desktop/gnome/dconf.nix
deleted file mode 100644
index 74b9b4a..0000000
--- a/modules/hosts/desktop/gnome/dconf.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- config,
- lib,
- username,
- ...
-}:
-
-let
- inherit (lib) mkIf;
- cfg = config.nx.desktop.gnome;
-in
-{
- config = mkIf cfg.enable {
- home-manager.users."${username}".dconf.settings = {
- "org/gnome/desktop/interface" = {
- color-scheme = "prefer-dark";
- };
- };
- };
-}
diff --git a/modules/hosts/desktop/gnome/default.nix b/modules/hosts/desktop/gnome/default.nix
index 2aa62ed..268fdc7 100644
--- a/modules/hosts/desktop/gnome/default.nix
+++ b/modules/hosts/desktop/gnome/default.nix
@@ -10,13 +10,7 @@ let
cfg = config.nx.desktop.gnome;
in
{
- imports = [
- ./dconf.nix
- ];
-
- options.nx.desktop.gnome = {
- enable = mkEnableOption "Enable GNOME desktop environment";
- };
+ options.nx.desktop.gnome.enable = mkEnableOption "Enable GNOME desktop environment";
config = mkIf cfg.enable {
services.displayManager.gdm.enable = true;
diff --git a/modules/hosts/desktop/hyprland/default.nix b/modules/hosts/desktop/hyprland/default.nix
index 2bc2525..1750a59 100644
--- a/modules/hosts/desktop/hyprland/default.nix
+++ b/modules/hosts/desktop/hyprland/default.nix
@@ -7,53 +7,166 @@
}:
let
- inherit (lib) mkEnableOption mkIf;
+ inherit (lib) mkEnableOption mkOption mkIf types optionals;
cfg = config.nx.desktop.hyprland;
in
{
- imports = [
- ./hyprlock.nix
- ];
+ options.nx.desktop.hyprland = {
+ enable = mkEnableOption "Enable hyprland";
+ monitors = mkOption {
+ type = types.listOf types.str;
+ default = [ ];
+ description = "Monitor configuration strings for Hyprland";
+ example = [ "DP-1,highrr,0x0,auto" ];
+ };
+ lockscreen = {
+ background = mkOption {
+ type = types.nullOr types.path;
+ default = null;
+ description = "Background image for hyprlock";
+ };
+ profileImage = mkOption {
+ type = types.nullOr types.path;
+ default = null;
+ description = "Profile image for hyprlock";
+ };
+ };
+ };
- options.nx.desktop.hyprland.enable = mkEnableOption "Enable hyprland and setup";
config = mkIf cfg.enable {
- nx.desktop.hyprlock.enable = true;
+ programs.hyprlock.enable = true;
+
home-manager.users.${username} = {
home.packages = with pkgs; [
hyprshot
hyprpicker
];
+
+ programs.hyprlock = {
+ enable = true;
+ settings = {
+ general = {
+ immediate_render = true;
+ };
+
+ background = [
+ ({
+ monitor = "";
+ color = "rgba(0, 0, 0, 1.0)";
+ } // (if cfg.lockscreen.background != null then { path = "${cfg.lockscreen.background}"; } else { }))
+ ];
+
+ input-field = [
+ {
+ monitor = "";
+ size = "300, 30";
+ outline_thickness = 0;
+ dots_size = 0.25;
+ dots_spacing = 0.55;
+ dots_center = true;
+ dots_rounding = -1;
+ outer_color = "rgba(242, 243, 244, 0)";
+ inner_color = "rgba(242, 243, 244, 0)";
+ font_color = "rgba(242, 243, 244, 0.75)";
+ fade_on_empty = false;
+ placeholder_text = "";
+ hide_input = false;
+ check_color = "rgba(204, 136, 34, 0)";
+ fail_color = "rgba(204, 34, 34, 0)";
+ fail_text = "$FAIL <b>($ATTEMPTS)</b>";
+ fail_transition = 300;
+ capslock_color = -1;
+ numlock_color = -1;
+ bothlock_color = -1;
+ invert_numlock = false;
+ swap_font_color = false;
+ position = "0, -468";
+ halign = "center";
+ valign = "center";
+ }
+ ];
+
+ label = [
+ {
+ monitor = "";
+ text = ''cmd[update:1000] echo "$(date +"%A, %B %d")"'';
+ color = "rgba(242, 243, 244, 0.75)";
+ font_size = 20;
+ position = "0, 405";
+ halign = "center";
+ valign = "center";
+ }
+ {
+ monitor = "";
+ text = ''cmd[update:1000] echo "$(date +"%k:%M")"'';
+ color = "rgba(242, 243, 244, 0.75)";
+ font_size = 93;
+ position = "0, 310";
+ halign = "center";
+ valign = "center";
+ }
+ ] ++ optionals (cfg.lockscreen.profileImage != null) [
+ {
+ monitor = "";
+ text = "${username}";
+ color = "rgba(242, 243, 244, 0.75)";
+ font_size = 12;
+ position = "0, -407";
+ halign = "center";
+ valign = "center";
+ }
+ {
+ monitor = "";
+ text = "Enter Password";
+ color = "rgba(242, 243, 244, 0.75)";
+ font_size = 10;
+ position = "0, -438";
+ halign = "center";
+ valign = "center";
+ }
+ ];
+
+ image = optionals (cfg.lockscreen.profileImage != null) [
+ {
+ monitor = "";
+ path = "${cfg.lockscreen.profileImage}";
+ border_color = "0xffdddddd";
+ border_size = 0;
+ size = 73;
+ rounding = -1;
+ rotate = 0;
+ reload_time = -1;
+ reload_cmd = "";
+ position = "0, -353";
+ halign = "center";
+ valign = "center";
+ }
+ ];
+ };
+ };
+
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = true;
xwayland.enable = true;
settings = {
- monitor = [
- "DP-1,highrr,0x0,auto"
- ];
+ monitor = if cfg.monitors != [ ] then cfg.monitors else [ ",preferred,auto,auto" ];
"$background" = "rgba(000000FF)";
"$accent" = "rgba(FFFFFFFF)";
- exec-once = [
- ];
-
env = [
"XCURSOR_SIZE,24"
];
input = {
- kb_layout = "de";
+ kb_layout = config.console.keyMap;
follow_mouse = 1;
touchpad = {
- natural_scroll = "yes";
+ natural_scroll = true;
};
};
- "device:logitech-g-pro--1" = {
- sensitivity = -0.5;
- };
-
general = {
gaps_in = 5;
gaps_out = 10;
@@ -76,15 +189,10 @@ in
contrast = 1.1;
brightness = 1.0;
};
-
- drop_shadow = false;
- shadow_range = 30;
- shadow_render_power = 4;
- "col.shadow" = "$background";
};
animations = {
- enabled = "yes";
+ enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 7, myBezier"
@@ -101,22 +209,14 @@ in
};
dwindle = {
- pseudotile = "yes";
- preserve_split = "yes";
- };
-
- master = {
- new_is_master = true;
+ pseudotile = true;
+ preserve_split = true;
};
xwayland = {
force_zero_scaling = true;
};
- windowrulev2 = [
- "noborder,class:(steam)"
- ];
-
"$mod" = "SUPER";
bind = [
diff --git a/modules/hosts/desktop/hyprland/hyprlock.nix b/modules/hosts/desktop/hyprland/hyprlock.nix
deleted file mode 100644
index 2d2ab03..0000000
--- a/modules/hosts/desktop/hyprland/hyprlock.nix
+++ /dev/null
@@ -1,122 +0,0 @@
-{
- config,
- lib,
- username,
- ...
-}:
-
-let
- inherit (lib) mkEnableOption mkIf;
- cfg = config.nx.desktop.hyprlock;
-in
-{
- options.nx.desktop.hyprlock.enable = mkEnableOption "Hyprlock is a screen locker for Hyprland." // {
- default = config.nx.desktop.hyprland.enable;
- };
- config = mkIf cfg.enable {
- programs.hyprlock = {
- enable = true;
- };
- home-manager.users.${username}.programs.hyprlock = {
- enable = true;
- settings = {
- general = {
- immediate_render = true;
- };
-
- background = [
- {
- monitor = "";
- path = "/etc/nixos/images/pond.jpg";
- }
- ];
-
- input-field = [
- {
- monitor = "";
- size = "300, 30";
- outline_thickness = 0;
- dots_size = 0.25;
- dots_spacing = 0.55;
- dots_center = true;
- dots_rounding = -1;
- outer_color = "rgba(242, 243, 244, 0)";
- inner_color = "rgba(242, 243, 244, 0)";
- font_color = "rgba(242, 243, 244, 0.75)";
- fade_on_empty = false;
- placeholder_text = "";
- hide_input = false;
- check_color = "rgba(204, 136, 34, 0)";
- fail_color = "rgba(204, 34, 34, 0)";
- fail_text = "$FAIL <b>($ATTEMPTS)</b>";
- fail_transition = 300;
- capslock_color = -1;
- numlock_color = -1;
- bothlock_color = -1;
- invert_numlock = false;
- swap_font_color = false;
- position = "0, -468";
- halign = "center";
- valign = "center";
- }
- ];
-
- label = [
- {
- monitor = "";
- text = ''cmd[update:1000] echo "$(date +"%A, %B %d")"'';
- color = "rgba(242, 243, 244, 0.75)";
- font_size = 20;
- position = "0, 405";
- halign = "center";
- valign = "center";
- }
- {
- monitor = "";
- text = ''cmd[update:1000] echo "$(date +"%k:%M")"'';
- color = "rgba(242, 243, 244, 0.75)";
- font_size = 93;
- position = "0, 310";
- halign = "center";
- valign = "center";
- }
- {
- monitor = "";
- text = "${username}";
- color = "rgba(242, 243, 244, 0.75)";
- font_size = 12;
- position = "0, -407";
- halign = "center";
- valign = "center";
- }
- {
- monitor = "";
- text = "Enter Password";
- color = "rgba(242, 243, 244, 0.75)";
- font_size = 10;
- position = "0, -438";
- halign = "center";
- valign = "center";
- }
- ];
-
- image = [
- {
- monitor = "";
- path = "/etc/nixos/images/pf.jpg";
- border_color = "0xffdddddd";
- border_size = 0;
- size = 73;
- rounding = -1;
- rotate = 0;
- reload_time = -1;
- reload_cmd = "";
- position = "0, -353";
- halign = "center";
- valign = "center";
- }
- ];
- };
- };
- };
-}
diff --git a/modules/hosts/desktop/labwc/default.nix b/modules/hosts/desktop/labwc/default.nix
index fd7c062..b62dbbe 100644
--- a/modules/hosts/desktop/labwc/default.nix
+++ b/modules/hosts/desktop/labwc/default.nix
@@ -7,7 +7,7 @@
}:
let
- inherit (lib) mkEnableOption mkIf;
+ inherit (lib) mkEnableOption mkOption mkIf types optional;
cfg = config.nx.desktop.labwc;
gruvbox-openbox = pkgs.stdenv.mkDerivation {
@@ -30,11 +30,56 @@ let
};
in
{
- imports = [
- ./sfwbar.nix
- ];
+ options.nx.desktop.labwc = {
+ enable = mkEnableOption "Enable labwc";
+ monitors = mkOption {
+ type = types.attrsOf (types.submodule {
+ options = {
+ mode = mkOption {
+ type = types.str;
+ description = "Monitor resolution and refresh rate";
+ example = "1920x1080@240";
+ };
+ position = mkOption {
+ type = types.str;
+ default = "0,0";
+ description = "Monitor position";
+ example = "1920,0";
+ };
+ };
+ });
+ default = { };
+ description = "Monitor configuration for kanshi";
+ };
+ wallpaper = mkOption {
+ type = types.nullOr types.path;
+ default = null;
+ description = "Wallpaper image path";
+ };
+ theme = {
+ gtk = mkOption {
+ type = types.str;
+ default = "Gruvbox-Material-Dark";
+ description = "GTK theme name";
+ };
+ icons = mkOption {
+ type = types.str;
+ default = "Gruvbox-Dark";
+ description = "Icon theme name";
+ };
+ cursor = mkOption {
+ type = types.str;
+ default = "Adwaita";
+ description = "Cursor theme name";
+ };
+ openbox = mkOption {
+ type = types.str;
+ default = "gruvbox-material-dark-blocks";
+ description = "Openbox/LabWC theme name";
+ };
+ };
+ };
- options.nx.desktop.labwc.enable = mkEnableOption "Enable labwc";
config = mkIf cfg.enable {
home-manager.users.${username} = {
home.packages = with pkgs; [
@@ -42,26 +87,26 @@ in
labwc-gtktheme
gruvbox-material-gtk-theme
gruvbox-dark-icons-gtk
- swaybg
wl-clipboard
-
- gruvbox-openbox
- ];
+ sfwbar
+ gtk-layer-shell
+ ] ++ optional (cfg.wallpaper != null) swaybg
+ ++ [ gruvbox-openbox ];
services.cliphist.enable = true;
gtk = {
enable = true;
theme = {
- name = "Gruvbox-Material-Dark";
+ name = cfg.theme.gtk;
package = pkgs.gruvbox-material-gtk-theme;
};
iconTheme = {
- name = "Gruvbox-Dark";
+ name = cfg.theme.icons;
package = pkgs.gruvbox-dark-icons-gtk;
};
cursorTheme = {
- name = "Adwaita";
+ name = cfg.theme.cursor;
package = pkgs.adwaita-icon-theme;
};
gtk3.extraConfig = {
@@ -72,17 +117,15 @@ in
};
};
- services.kanshi = {
+ services.kanshi = mkIf (cfg.monitors != { }) {
enable = true;
profiles = {
- home = {
- outputs = [
- {
- criteria = "DP-1";
- mode = "1920x1080@240";
- position = "1920,0";
- }
- ];
+ default = {
+ outputs = lib.mapAttrsToList (name: monitor: {
+ criteria = name;
+ mode = monitor.mode;
+ position = monitor.position;
+ }) cfg.monitors;
};
};
};
@@ -91,28 +134,21 @@ in
enable = true;
autostart = [
"${pkgs.sfwbar}/bin/sfwbar"
- "${pkgs.swaybg}/bin/swaybg -m fill -i /home/${username}/Developer/nix/images/pond.jpg & disown"
- ];
+ ] ++ optional (cfg.wallpaper != null) "${pkgs.swaybg}/bin/swaybg -m fill -i ${cfg.wallpaper} & disown";
environment = [
- "XKB_DEFAULT_LAYOUT=de"
+ "XKB_DEFAULT_LAYOUT=${config.console.keyMap}"
"XCURSOR_SIZE=24"
"XDG_CURRENT_DESKTOP=wlroots"
];
- menu = [
- ];
-
rc = {
core = {
decoration = "server";
gap = 5;
- adaptiveSync = "no";
- reuseOutputMode = "yes";
};
theme = {
- # "gruvbox-dark", "gruvbox-material-dark", "gruvbox-material-dark-blocks"
- name = "gruvbox-material-dark-blocks";
+ name = cfg.theme.openbox;
};
keyboard = {
@@ -150,6 +186,111 @@ in
};
};
};
+
+ # sfwbar configuration
+ xdg.configFile."sfwbar/sfwbar.config".text = ''
+ # Term setup
+ Set Term = "foot"
+ Set ThicknessHint = "20px"
+
+ # Actions
+ TriggerAction "SIGRTMIN+1", SwitcherEvent "forward"
+ TriggerAction "SIGRTMIN+2", SwitcherEvent "back"
+
+ # Initialization
+ Function("SfwbarInit") {
+ SetLayer "top"
+ SetMirror "*"
+ SetExclusiveZone "auto"
+ }
+
+ # Placer (Window positioning)
+ placer {
+ xorigin = 5
+ yorigin = 5
+ xstep = 5
+ ystep = 5
+ children = true
+ }
+
+ # Task Switcher
+ switcher {
+ interval = 700
+ icons = true
+ labels = false
+ cols = 5
+ }
+
+ # Load Standard Library Winops
+ include("${pkgs.sfwbar}/share/sfwbar/winops.widget")
+
+ # Main Layout
+ layout {
+
+ # Start Menu
+ include("${pkgs.sfwbar}/share/sfwbar/startmenu.widget")
+
+ # Show Desktop
+ include("${pkgs.sfwbar}/share/sfwbar/showdesktop.widget")
+
+ # Taskbar
+ taskbar {
+ rows = 1
+ icons = true
+ labels = false
+ sort = false
+ action[3] = Menu "winops"
+ action[Drag] = Focus
+ }
+
+ # Spacer
+ label {
+ value = ""
+ style = "spacer"
+ }
+
+ # Pager
+ pager {
+ rows = 1
+ pins = "1","2","3","4"
+ preview = true
+ action[Drag] = WorkspaceActivate
+ }
+
+ # Tray
+ tray {
+ rows = 1
+ }
+
+ # Modules
+ include("${pkgs.sfwbar}/share/sfwbar/volume.widget")
+
+ # Clock
+ grid {
+ style = "clock_grid"
+ label {
+ value = Time("%H:%M")
+ tooltip = Time("%H:%M\n%x")
+ }
+ }
+ }
+
+ #CSS
+ #spacer {
+ -GtkWidget-hexpand: true;
+ }
+
+ button#taskbar_item {
+ padding: 5px;
+ border-radius: 0px;
+ border-width: 0px;
+ -GtkWidget-hexpand: false;
+ }
+
+ button#taskbar_item:hover {
+ background-color: rgba(255, 255, 255, 0.1);
+ }
+ '';
};
};
}
diff --git a/modules/hosts/desktop/labwc/sfwbar.nix b/modules/hosts/desktop/labwc/sfwbar.nix
deleted file mode 100644
index 7021374..0000000
--- a/modules/hosts/desktop/labwc/sfwbar.nix
+++ /dev/null
@@ -1,142 +0,0 @@
-{
- config,
- username,
- pkgs,
- lib,
- ...
-}:
-
-let
- inherit (lib) mkEnableOption mkIf;
- cfg = config.nx.desktop.sfwbar;
-in
-{
- options.nx.desktop.sfwbar.enable = mkEnableOption "Enable sfwbar" // {
- default = config.nx.desktop.labwc.enable;
- };
-
- config = mkIf cfg.enable {
- home-manager.users.${username} = {
- home.packages = with pkgs; [
- sfwbar
- gtk-layer-shell
- ];
-
- # CONFIGURATION
- xdg.configFile."sfwbar/sfwbar.config".text = ''
- # Term setup
- Set Term = "foot"
- Set ThicknessHint = "20px"
-
- # Actions
- TriggerAction "SIGRTMIN+1", SwitcherEvent "forward"
- TriggerAction "SIGRTMIN+2", SwitcherEvent "back"
-
- # Initialization
- Function("SfwbarInit") {
- SetLayer "top"
- SetMirror "*"
- SetExclusiveZone "auto"
- }
-
- # Placer (Window positioning)
- placer {
- xorigin = 5
- yorigin = 5
- xstep = 5
- ystep = 5
- children = true
- }
-
- # Task Switcher
- switcher {
- interval = 700
- icons = true
- labels = false
- cols = 5
- }
-
- # Load Standard Library Winops
- include("${pkgs.sfwbar}/share/sfwbar/winops.widget")
-
- # Main Layout
- layout {
-
- # Start Menu
- include("${pkgs.sfwbar}/share/sfwbar/startmenu.widget")
-
- # Show Desktop
- include("${pkgs.sfwbar}/share/sfwbar/showdesktop.widget")
-
- # Taskbar
- taskbar {
- rows = 1
- icons = true
- labels = false
- sort = false
- action[3] = Menu "winops"
- action[Drag] = Focus
- }
-
- # Spacer
- label {
- value = ""
- style = "spacer"
- }
-
- # Pager
- pager {
- rows = 1
- pins = "1","2","3","4"
- preview = true
- action[Drag] = WorkspaceActivate
- }
-
- # System Monitors
- #include("${pkgs.sfwbar}/share/sfwbar/cpu.widget")
- #include("${pkgs.sfwbar}/share/sfwbar/memory.widget")
-
- # Tray
- tray {
- rows = 1
- }
-
- # --- MODULES ---
- #include("${pkgs.sfwbar}/share/sfwbar/upower.widget")
- #include("${pkgs.sfwbar}/share/sfwbar/battery-svg.widget")
-
- #include("${pkgs.sfwbar}/share/sfwbar/idle.widget")
- #include("${pkgs.sfwbar}/share/sfwbar/backlight.widget")
- include("${pkgs.sfwbar}/share/sfwbar/volume.widget")
- #include("${pkgs.sfwbar}/share/sfwbar/network-module.widget")
- #include("${pkgs.sfwbar}/share/sfwbar/sway-lang.widget")
-
- # Clock
- grid {
- style = "clock_grid"
- label {
- value = Time("%H:%M")
- tooltip = Time("%H:%M\n%x")
- }
- }
- }
- #CSS
-
- #spacer {
- -GtkWidget-hexpand: true;
- }
-
- button#taskbar_item {
- padding: 5px;
- border-radius: 0px;
- border-width: 0px;
- -GtkWidget-hexpand: false;
- }
-
- button#taskbar_item:hover {
- background-color: rgba(255, 255, 255, 0.1);
- }
- '';
- };
- };
-}
diff --git a/modules/hosts/desktop/sway/default.nix b/modules/hosts/desktop/sway/default.nix
index c149c21..b9cec12 100644
--- a/modules/hosts/desktop/sway/default.nix
+++ b/modules/hosts/desktop/sway/default.nix
@@ -7,17 +7,39 @@
}:
let
- inherit (lib) mkEnableOption mkIf mkOptionDefault;
- mod = config.home-manager.users.${username}.wayland.windowManager.sway.config.modifier;
+ inherit (lib) mkEnableOption mkOption mkIf mkOptionDefault types;
cfg = config.nx.desktop.sway;
+ mod = "Mod4";
in
{
- imports = [
- ./swayidle.nix
- ./swaylock.nix
- ];
+ options.nx.desktop.sway = {
+ enable = mkEnableOption "Enable sway";
+ monitors = mkOption {
+ type = types.attrsOf (types.submodule {
+ options = {
+ resolution = mkOption {
+ type = types.str;
+ description = "Monitor resolution and refresh rate";
+ example = "1920x1080@240Hz";
+ };
+ position = mkOption {
+ type = types.str;
+ default = "0 0";
+ description = "Monitor position";
+ example = "1920 0";
+ };
+ };
+ });
+ default = { };
+ description = "Monitor configuration";
+ };
+ wallpaper = mkOption {
+ type = types.nullOr types.path;
+ default = null;
+ description = "Wallpaper image path";
+ };
+ };
- options.nx.desktop.sway.enable = mkEnableOption "Enable sway and setup";
config = mkIf cfg.enable {
home-manager.users.${username} = {
home.packages = with pkgs; [
@@ -37,16 +59,14 @@ in
config = {
input = {
"*" = {
- xkb_layout = "de";
+ xkb_layout = config.console.keyMap;
};
};
- output = {
- DP-1 = {
- resolution = "1920x1080@240Hz";
- bg = "/etc/nixos/images/pond.jpg fill";
- };
- };
+ output = lib.mapAttrs (name: monitor: {
+ resolution = monitor.resolution;
+ position = monitor.position;
+ } // (if cfg.wallpaper != null then { bg = "${cfg.wallpaper} fill"; } else { })) cfg.monitors;
gaps = {
inner = 15;
@@ -57,7 +77,7 @@ in
border = 0;
};
- modifier = "Mod4";
+ modifier = mod;
keybindings = mkOptionDefault {
"${mod}+q" = "kill";
@@ -76,7 +96,7 @@ in
bars = [
{
- "command" = "${pkgs.waybar}/bin/waybar";
+ command = "${pkgs.waybar}/bin/waybar";
}
];
};
@@ -114,6 +134,48 @@ in
package = pkgs.adwaita-icon-theme;
size = 24;
};
+
+ # swaylock
+ programs.swaylock = {
+ enable = true;
+ settings = {
+ font = "monospace 12";
+ color = "00000000";
+ ring-color = "ffffffff";
+ key-hl-color = "ff0000ff";
+ bs-hl-color = "ff0000ff";
+ };
+ };
+
+ # swayidle
+ services.swayidle = {
+ enable = true;
+ timeouts = [
+ {
+ timeout = 300;
+ command = "${pkgs.swaylock}/bin/swaylock -f -c 000000";
+ }
+ {
+ timeout = 600;
+ command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'";
+ resumeCommand = "${pkgs.sway}/bin/swaymsg output * dpms on";
+ }
+ {
+ timeout = 900;
+ command = "${pkgs.systemd}/bin/systemctl suspend";
+ }
+ ];
+ events = [
+ {
+ event = "after-resume";
+ command = "${pkgs.sway}/bin/swaymsg output * dpms on";
+ }
+ {
+ event = "before-sleep";
+ command = "${pkgs.swaylock}/bin/swaylock -f -c 000000";
+ }
+ ];
+ };
};
};
}
diff --git a/modules/hosts/desktop/sway/swayidle.nix b/modules/hosts/desktop/sway/swayidle.nix
deleted file mode 100644
index df8dbdc..0000000
--- a/modules/hosts/desktop/sway/swayidle.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- config,
- lib,
- pkgs,
- username,
- ...
-}:
-
-let
- inherit (lib) mkEnableOption mkIf;
- cfg = config.nx.desktop.swayidle;
-in
-{
- options.nx.desktop.swayidle.enable = mkEnableOption "Enable swayidle configuration" // {
- default = config.nx.desktop.sway.enable;
- };
- config = mkIf cfg.enable {
- home-manager.users."${username}" = {
- services.swayidle = {
- enable = true;
- timeouts = [
- {
- timeout = 300;
- command = "${pkgs.swaylock}/bin/swaylock -f -c 000000";
- }
- {
- timeout = 600;
- command = "${pkgs.sway}/bin/swaymsg 'output * dpms off";
- resumeCommand = "${pkgs.sway}/bin/swaymsg output * dpms on";
- }
- {
- timeout = 900;
- command = "${pkgs.systemd}/bin/systemctl suspend";
- }
- ];
- events = [
- {
- event = "after-resume";
- command = "${pkgs.sway}/bin/swaymsg output * dpms on";
- }
- {
- event = "before-sleep";
- command = "${pkgs.swaylock}/bin/swaylock -f -c 000000";
- }
- ];
- };
- };
- };
-}
diff --git a/modules/hosts/desktop/sway/swaylock.nix b/modules/hosts/desktop/sway/swaylock.nix
deleted file mode 100644
index 9ba43a1..0000000
--- a/modules/hosts/desktop/sway/swaylock.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- config,
- username,
- lib,
- ...
-}:
-
-let
- inherit (lib) mkEnableOption mkIf;
- cfg = config.nx.desktop.swaylock;
-in
-{
- options.nx.desktop.swaylock.enable = mkEnableOption "Enable and setup swaylock" // {
- default = config.nx.desktop.sway.enable;
- };
- config = mkIf cfg.enable {
- home-manager.users."${username}" = {
- programs.swaylock = {
- enable = true;
- settings = {
- font = "monospace 12";
- color = "00000000";
- ring-color = "ffffffff";
- key-hl-color = "ff0000ff";
- bs-hl-color = "ff0000ff";
- };
- };
- };
- };
-}
diff --git a/modules/hosts/desktop/waybar.nix b/modules/hosts/desktop/waybar.nix
index 23b0f59..aebc0f7 100644
--- a/modules/hosts/desktop/waybar.nix
+++ b/modules/hosts/desktop/waybar.nix
@@ -11,8 +11,9 @@ let
in
{
options.nx.desktop.waybar.enable = mkEnableOption "Enable and configure Waybar";
+
config = mkIf cfg.enable {
- home-manager.users."${username}" = {
+ home-manager.users.${username} = {
programs.waybar = {
enable = true;
settings = {
@@ -21,7 +22,7 @@ in
layer = "top";
position = "bottom";
modules-center = [ "mpris" ];
- modules-left = [ "sway/workspaces" ];
+ modules-left = [ "wlr/workspaces" ];
modules-right = [
"privacy"
"tray"
@@ -45,20 +46,6 @@ in
icon-size = 16;
};
- cpu = {
- format = "󰻠";
- tooltip = true;
- };
-
- memory = {
- format = "";
- };
-
- temperature = {
- critical-threshold = 80;
- format = "";
- };
-
network = {
format-disconnect = "󰌙";
format-ethernet = "󰌘";
@@ -69,17 +56,15 @@ in
"󰤥"
"󰤨"
];
-
tooltip-format-wifi = "{essid} | {signalStrength}%";
tooltip-format-ethernet = "{ifname}";
};
bluetooth = {
- format = " {status}";
+ format = " {status}";
format-disabled = "";
format-no-controller = "";
- format-connected = " {device_alias}";
- tooltip = false;
+ format-connected = " {device_alias}";
};
clock = {
@@ -91,9 +76,9 @@ in
format = "{icon}";
format-icons = {
default = [
- ""
- ""
- ""
+ ""
+ ""
+ ""
];
};
tooltip-format = "{desc} | {volume}%";
@@ -102,31 +87,31 @@ in
};
style = ''
- * {
- border: none;
- border-radius: 0;
- font-family: monospace;
- font-size: 12px;
- background: none;
- }
+ * {
+ border: none;
+ border-radius: 0;
+ font-family: monospace;
+ font-size: 12px;
+ background: none;
+ }
- window#waybar {
- background: rgba(0, 0, 0, 0.9);
- }
+ window#waybar {
+ background: rgba(0, 0, 0, 0.9);
+ }
- #workspaces button {
- padding-left: 5px;
- padding-right: 5px;
- }
+ #workspaces button {
+ padding-left: 5px;
+ padding-right: 5px;
+ }
- #workspaces button.focused {
- font-weight: bold;
- }
+ #workspaces button.focused {
+ font-weight: bold;
+ }
- #clock, #pulseaudio, #tray, #network, #battery, #bluetooth, #cpu, #memory, #temperature, #custom-expand, #group-expand {
- padding-left: 10px;
- padding-right: 10px;
- }
+ #clock, #pulseaudio, #tray, #network, #battery, #bluetooth {
+ padding-left: 10px;
+ padding-right: 10px;
+ }
'';
};
};