From 4607b47fcaf9d16caf47d39dc3e1c10201fdf29a Mon Sep 17 00:00:00 2001 From: unexplrd Date: Fri, 14 Mar 2025 18:49:25 +0200 Subject: [PATCH] niri --- hosts/dunamis/configuration.nix | 2 +- hosts/dunamis/stylix-light.nix | 50 + hosts/dunamis/stylix.nix | 6 +- .../dunamis/users/user/home-configuration.nix | 2 +- hosts/sarien/configuration.nix | 2 +- .../sarien/users/user/home-configuration.nix | 2 +- modules/home/desktop/niri/default.nix | 1212 ++++++++--------- modules/nixos/desktop/niri.nix | 1 + 8 files changed, 611 insertions(+), 666 deletions(-) create mode 100644 hosts/dunamis/stylix-light.nix diff --git a/hosts/dunamis/configuration.nix b/hosts/dunamis/configuration.nix index 7783dcf..2069a5d 100644 --- a/hosts/dunamis/configuration.nix +++ b/hosts/dunamis/configuration.nix @@ -17,7 +17,7 @@ ]; desktop = { - hyprland.enable = true; + niri.enable = true; }; nix = { diff --git a/hosts/dunamis/stylix-light.nix b/hosts/dunamis/stylix-light.nix new file mode 100644 index 0000000..6669bcc --- /dev/null +++ b/hosts/dunamis/stylix-light.nix @@ -0,0 +1,50 @@ +{ + pkgs, + inputs, + config, + ... +}: { + imports = with inputs; [ + stylix.nixosModules.stylix + ]; + environment.systemPackages = with pkgs; [ + nerd-fonts.iosevka + ]; + stylix = { + enable = true; + base16Scheme = "${pkgs.base16-schemes}/share/themes/tomorrow.yaml"; + polarity = "light"; + cursor = { + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Ice"; + size = 24; + }; + image = builtins.fetchurl { + url = "https://w.wallhaven.cc/full/2y/wallhaven-2y7xv6.jpg"; + name = "wallhaven-2y7xv6.jpg"; + sha256 = "8c2118165298ff8f25138a2fed78e5f95e2494cfbf516b20ab1ff52dbad51afe"; + }; + opacity.terminal = 0.9; + fonts = { + sizes = { + applications = 13; + desktop = 14; + popups = 13; + terminal = 15; + }; + serif = { + package = pkgs.nerd-fonts.iosevka; + name = "Iosevka Nerd Font Propo"; + }; + sansSerif = config.stylix.fonts.serif; + monospace = { + package = pkgs.nerd-fonts.iosevka-term; + name = "IosevkaTerm Nerd Font Mono"; + }; + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; + }; + }; + }; +} diff --git a/hosts/dunamis/stylix.nix b/hosts/dunamis/stylix.nix index 97fc6fd..eecd009 100644 --- a/hosts/dunamis/stylix.nix +++ b/hosts/dunamis/stylix.nix @@ -4,8 +4,8 @@ config, ... }: { - imports = [ - inputs.stylix.nixosModules.stylix + imports = with inputs; [ + stylix.nixosModules.stylix ]; environment.systemPackages = with pkgs; [ nerd-fonts.iosevka @@ -21,7 +21,7 @@ }; image = builtins.fetchurl { url = "https://w.wallhaven.cc/full/2y/wallhaven-2y7xv6.jpg"; - name = "wallhaven-2y7xv6"; + name = "wallhaven-2y7xv6.jpg"; sha256 = "8c2118165298ff8f25138a2fed78e5f95e2494cfbf516b20ab1ff52dbad51afe"; }; opacity.terminal = 0.9; diff --git a/hosts/dunamis/users/user/home-configuration.nix b/hosts/dunamis/users/user/home-configuration.nix index 9d5ec8e..e3da1f8 100644 --- a/hosts/dunamis/users/user/home-configuration.nix +++ b/hosts/dunamis/users/user/home-configuration.nix @@ -6,7 +6,7 @@ ./programs.nix ./flatpak.nix ]; - desktop.hyprland.enable = true; + desktop.niri.enable = true; home = { stateVersion = "25.05"; sessionPath = [ diff --git a/hosts/sarien/configuration.nix b/hosts/sarien/configuration.nix index 6525e63..8c580e7 100644 --- a/hosts/sarien/configuration.nix +++ b/hosts/sarien/configuration.nix @@ -18,7 +18,7 @@ ]; desktop = { - hyprland.enable = true; + niri.enable = true; }; nix = { diff --git a/hosts/sarien/users/user/home-configuration.nix b/hosts/sarien/users/user/home-configuration.nix index 9d5ec8e..e3da1f8 100644 --- a/hosts/sarien/users/user/home-configuration.nix +++ b/hosts/sarien/users/user/home-configuration.nix @@ -6,7 +6,7 @@ ./programs.nix ./flatpak.nix ]; - desktop.hyprland.enable = true; + desktop.niri.enable = true; home = { stateVersion = "25.05"; sessionPath = [ diff --git a/modules/home/desktop/niri/default.nix b/modules/home/desktop/niri/default.nix index cc1f14b..6b38711 100644 --- a/modules/home/desktop/niri/default.nix +++ b/modules/home/desktop/niri/default.nix @@ -4,22 +4,33 @@ pkgs, lib, ... -}: -with lib; let +}: let cfg = config.desktop.niri; + hostname = osConfig.networking.hostName; + cursor_size = config.stylix.cursor.size; + colors = config.lib.stylix.colors; + keyboard = + if hostname == "eldrid" + then "chromeos" + else "platform"; + xdgPictures = + config.xdg.userDirs.pictures; + ifLaptop = lib.mkIf (hostname != "dunamis"); terminal = "ghostty"; - launcher = "walker"; + launcher = "fuzzel"; browser = "app.zen_browser.zen"; lockscreen = "gtklock"; in { options = { desktop.niri.enable = - mkEnableOption "enable niri desktop"; + lib.mkEnableOption "enable niri desktop"; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { stylix.targets = { waybar.enable = false; hyprlock.enable = false; + wpaperd.enable = true; + qt.enable = false; }; services = { playerctld.enable = true; @@ -29,6 +40,17 @@ in { enable = true; components = ["secrets"]; }; + gammastep = { + enable = true; + provider = "manual"; + latitude = 49.6; + longitude = 36.1; + tray = true; + temperature = { + day = 6500; + night = 3000; + }; + }; udiskie = { enable = true; automount = false; @@ -36,7 +58,7 @@ in { tray = "auto"; }; wlsunset = { - enable = true; + enable = false; latitude = "49.6"; longitude = "36.1"; temperature = { @@ -48,7 +70,7 @@ in { swaync = { enable = true; settings = { - # cssPriority = "user"; + cssPriority = "user"; image-visibility = "when-available"; keyboard-shortcut = true; relative-timestamps = true; @@ -71,7 +93,7 @@ in { notification-icon-size = 32; notification-body-image-height = 100; notification-body-image-width = 200; - notification-window-width = 300; + notification-window-width = 400; # Control center settings control-center-positionX = "right"; @@ -154,10 +176,9 @@ in { border-radius: 7px; } - .notification-content, - .floating-notifications { - border: transparent; - background: transparent; + .floating-notifications, + .notification-content { + border-radius: 7px; } .control-center-list { @@ -265,6 +286,25 @@ in { }; }; }; + programs.fuzzel = { + enable = true; + settings = { + main = { + terminal = "${terminal} -e"; + fields = "filename,name,generic,keywords,categories,exec"; + dpi-aware = false; + horizontal-pad = 4; + vertical-pad = 4; + show-actions = true; + match-mode = "fuzzy"; + icon-theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}"; + }; + border = lib.mkDefault { + width = 3; + radius = 12; + }; + }; + }; programs.hyprlock = { enable = false; settings = { @@ -349,7 +389,7 @@ in { ]; }; }; - + # ifLaptop xdg.configFile = { niri = { target = "niri/config.kdl"; @@ -359,419 +399,453 @@ in { down = "e"; up = "i"; right = "o"; - in '' - environment { - DISPLAY ":123" - QT_QPA_PLATFORM "wayland" - // QT_STYLE_OVERRIDE "adwaita" - // QT_QPA_PLATFORMTHEME "qt5ct" - GDK_BACKEND "wayland" - MOZ_ENABLE_WAYLAND "1" - MOZ_WEBRENDER "1" - XDG_SESSION_TYPE "wayland" - CLUTTER_BACKEND "wayland" - SDL_VIDEODRIVER "wayland" - } - input { - keyboard { - xkb { - layout "us,ua" - // variant "colemak_dh," - options "grp:menu_toggle" - } - repeat-delay 200 - repeat-rate 50 - track-layout "global" - - } - touchpad { - // off - tap - // dwt - // dwtp - natural-scroll - accel-speed 0.2 - accel-profile "flat" - // scroll-method "two-finger" - // disabled-on-external-mouse - } - mouse { - // off - // natural-scroll - accel-speed 0.0 - accel-profile "flat" - // scroll-method "no-scroll" - } - /-touch { - off + niriConfig = '' + environment { + DISPLAY ":123" + QT_QPA_PLATFORM "wayland" + QT_QPA_PLATFORMTHEME "gtk3" + GDK_BACKEND "wayland" + MOZ_ENABLE_WAYLAND "1" + MOZ_WEBRENDER "1" + XDG_SESSION_TYPE "wayland" + CLUTTER_BACKEND "wayland" + SDL_VIDEODRIVER "wayland" } + input { + keyboard { + xkb { + layout "us,ua" + // variant "colemak_dh," + options "grp:menu_toggle" + } + repeat-delay 200 + repeat-rate 50 + track-layout "global" - warp-mouse-to-focus - - // focus-follows-mouse - } - - output "eDP-1" { - // off - scale 1.2 - transform "normal" - // position x=1920 y=0 - } - output "Samsung Electric Company S24R65x H4TMA03291" { - position x=0 y=0 - variable-refresh-rate - } - output "Philips Consumer Electronics Company 27M2N5500 UK02418033254" { - mode "2560x1440@180.000" - variable-refresh-rate - position x=0 y=0 - scale 1.33 - } - output "PNP(AOC) 27V2G5 0x0000026C" { - position x=1920 y=0 - mode "1920x1080@74.973" - variable-refresh-rate - } - - cursor { - xcursor-theme "${config.stylix.cursor.name}" - xcursor-size ${cursor_size} - } - - layout { - gaps 11 - center-focused-column "never" // "on-overflow" - preset-column-widths { - proportion 0.33333 - proportion 0.5 - proportion 0.66667 - } - - // default-column-width { proportion 0.9; } - default-column-width {} - - focus-ring { - //off - width 3 - active-gradient from="#${config.lib.stylix.colors.base0D}" to="#${config.lib.stylix.colors.base04}" angle=40 relative-to="workspace-view" - inactive-color "#${config.lib.stylix.colors.base03}" - } - - // You can also add a border. It's similar to the focus ring, but always visible. - border { - // The settings are the same as for the focus ring. - // If you enable the border, you probably want to disable the focus ring. + } + touchpad { + // off + tap + // dwt + // dwtp + natural-scroll + accel-speed 0.2 + accel-profile "flat" + // scroll-method "two-finger" + // disabled-on-external-mouse + } + mouse { + // off + // natural-scroll + accel-speed 0.0 + accel-profile "flat" + // scroll-method "no-scroll" + } + /-touch { off + } - width 4 - inactive-color "#${config.lib.stylix.colors.base00}" - // active-gradient from="#${config.lib.stylix.colors.base0D}" to="#${config.lib.stylix.colors.base0C}" angle=40 relative-to="workspace-view" + warp-mouse-to-focus + + // focus-follows-mouse + } + + output "eDP-1" { + // off + scale 1.2 + transform "normal" + // position x=1920 y=0 + } + output "Samsung Electric Company S24R65x H4TMA03291" { + position x=0 y=0 + variable-refresh-rate + } + output "Philips Consumer Electronics Company 27M2N5500 UK02418033254" { + mode "2560x1440@180.000" + variable-refresh-rate + position x=0 y=0 + scale 1.33 + } + output "PNP(AOC) 27V2G5 0x0000026C" { + position x=1920 y=0 + mode "1920x1080@74.973" + variable-refresh-rate + } + + cursor { + xcursor-theme "${config.stylix.cursor.name}" + xcursor-size ${cursor_size} } - struts { - left 52 - right 52 + layout { + gaps 11 + center-focused-column "never" // "on-overflow" + preset-column-widths { + proportion 0.33333 + proportion 0.5 + proportion 0.66667 + } + + // default-column-width { proportion 0.9; } + default-column-width {} + tab-indicator { + active-color "#${config.lib.stylix.colors.base0A}" + inactive-color "#${config.lib.stylix.colors.base05}" + width 8 + gap 8 + corner-radius 4 + gaps-between-tabs 4 + length total-proportion=0.9 + position "left" + place-within-column + } + focus-ring { + //off + width 3 + active-gradient from="#${config.lib.stylix.colors.base0D}" to="#${config.lib.stylix.colors.base0F}" angle=40 relative-to="workspace-view" + inactive-color "#${config.lib.stylix.colors.base03}" + } + struts { + left 52 + right 52 + } + } + + prefer-no-csd + + hotkey-overlay { + skip-at-startup + } + window-rule { + geometry-corner-radius 12 + clip-to-geometry true + } + window-rule { + match is-window-cast-target=true + focus-ring { + width 3 + active-color "#${config.lib.stylix.colors.base0F}" + inactive-color "#${config.lib.stylix.colors.base03}" } - } + border { + width 3 + active-color "#${config.lib.stylix.colors.base0F}" + inactive-color "#${config.lib.stylix.colors.base03}" + } + shadow { + on + color "#${config.lib.stylix.colors.base0F}" + inactive-color "#${config.lib.stylix.colors.base03}" + } + } - prefer-no-csd + screenshot-path "${config.xdg.userDirs.pictures}/screenshots/screenshot-%Y-%m-%d-%H-%M-%S.png" + // screenshot-path null - hotkey-overlay { - skip-at-startup - } - window-rule { - geometry-corner-radius 12 - clip-to-geometry true - } + animations { + // off + slowdown 0.7 + } - screenshot-path "${config.xdg.userDirs.pictures}/screenshots/screenshot-%Y-%m-%d-%H-%M-%S.png" - // screenshot-path null - - animations { - // off - slowdown 0.7 - } - - window-rule { - match app-id=r#"^org\.wezfurlong\.wezterm$"# - default-column-width { proportion 1.0; } - } - window-rule { - match app-id=r#"^re\.sonny\.Junction$"# + window-rule { + match title="TelegramDesktop" + match app-id="org.telegram.desktop" open-floating true - open-focused true - } + } + window-rule { + match title="Картинка в картинці" + open-floating true + } + window-rule { + match title="Picture-in-Picture" + open-floating true + } + window-rule { + match app-id=r#"^org\.wezfurlong\.wezterm$"# + default-column-width { proportion 1.0; } + } + window-rule { + match app-id=r#"^re\.sonny\.Junction$"# + open-floating true + open-focused true + } - window-rule { - match app-id=r#"^com\.mitchellh\.ghostty$"# - draw-border-with-background false - } + window-rule { + match app-id=r#"^com\.mitchellh\.ghostty$"# + draw-border-with-background false + } - window-rule { - match app-id=r#"^org\.keepassxc\.KeePassXC$"# - match app-id=r#"^org\.gnome\.World\.Secrets$"# - match app-id=r#"^org\.telegram\.desktop$"# - match app-id=r#"^signal$"# - match app-id=r#"^Bitwarden$"# - // block-out-from "screen-capture" - block-out-from "screencast" - } - workspace "general" - workspace "browse" - workspace "chat" - workspace "code" - workspace "uni" - workspace "games" - workspace "sysadmin" - workspace "media" - workspace "bg" + window-rule { + match app-id=r#"^org\.keepassxc\.KeePassXC$"# + match app-id=r#"^org\.gnome\.World\.Secrets$"# + match app-id=r#"^Bitwarden$"# + match app-id="org.telegram.desktop" + match app-id="org.signal.Signal" + match app-id="WebCord" + // block-out-from "screen-capture" + block-out-from "screencast" + } + // workspace "general" + // workspace "browse" + // workspace "chat" + // workspace "code" + // workspace "uni" + // workspace "games" + // workspace "sysadmin" + // workspace "media" + // workspace "bg" - window-rule { - match app-id=r#"^org\.telegram\.desktop$"# - match app-id=r#"^im\.riot\.Riot$"# - match app-id=r#"^WebCord$"# - match app-id=r#"^signal$"# - open-on-workspace "chat" - } + // window-rule { + // match app-id=r#"^org\.telegram\.desktop$"# + // match app-id=r#"^im\.riot\.Riot$"# + // match app-id=r#"^WebCord$"# + // match app-id=r#"^signal$"# + // open-on-workspace "chat" + // } - window-rule { - match app-id=r#"^com\.heroicgameslauncher\.hgl$"# - match app-id=r#"^net\.lutris\.Lutris$"# - match app-id="steam" - // match app-id=r#"^$"# - open-on-workspace "games" - } + // window-rule { + // match app-id=r#"^com\.heroicgameslauncher\.hgl$"# + // match app-id=r#"^net\.lutris\.Lutris$"# + // match app-id="steam" + // // match app-id=r#"^$"# + // open-on-workspace "games" + // } - window-rule { - match app-id=r#"^com\.obsproject\.Studio$"# - open-on-workspace "bg" - } + // window-rule { + // match app-id=r#"^com\.obsproject\.Studio$"# + // open-on-workspace "bg" + // } - binds { - Mod+Shift+Slash { show-hotkey-overlay; } + binds { + Mod+Shift+Slash { show-hotkey-overlay; } - Mod+Return repeat=false { spawn "${terminal}"; } - Mod+Space repeat=false { spawn "${launcher}"; } - Mod+Shift+Space repeat=false { spawn "walker" "-m" "windows"; } - Super+Alt+L repeat=false { spawn "${lockscreen}"; } - Super+Alt+B repeat=false { spawn "${browser}"; } - Super+Alt+V repeat=false { spawn "copyq" "toggle"; } - Mod+Alt+Q { quit; } - Mod+Alt+P { power-off-monitors; } + Mod+Return repeat=false { spawn "${terminal}"; } + Mod+Space repeat=false { spawn "${launcher}"; } + Mod+Shift+Space repeat=false { spawn "walker" "-m" "windows"; } + Super+Alt+L repeat=false { spawn "${lockscreen}"; } + Super+Alt+B repeat=false { spawn "${browser}"; } + Super+Alt+V repeat=false { spawn "copyq" "toggle"; } + Mod+Alt+Q { quit; } + Mod+Alt+P { power-off-monitors; } - XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; } - XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; } - XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } - XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } - XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; } - XF86AudioPause allow-when-locked=true { spawn "playerctl" "pause"; } - XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; } - XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; } + XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; } + XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; } + XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } + XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } + XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; } + XF86AudioPause allow-when-locked=true { spawn "playerctl" "pause"; } + XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; } + XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; } - XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "s" "5%+"; } - XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "s" "5%-"; } - Alt+XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "s" "5%+" "-d" "platform::kbd_backlight"; } - Alt+XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "s" "5%-" "-d" "platform::kbd_backlight"; } + XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "s" "5%+"; } + XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "s" "5%-"; } + Alt+XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "s" "5%+" "-d" "${keyboard}::kbd_backlight"; } + Alt+XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "s" "5%-" "-d" "${keyboard}::kbd_backlight"; } - Mod+Left { focus-column-left; } - Mod+Down { focus-window-or-workspace-down; } - Mod+Up { focus-window-or-workspace-up; } - Mod+Right { focus-column-right; } - Mod+${left} { focus-column-left; } - Mod+${down} { focus-window-or-workspace-down; } - Mod+${up} { focus-window-or-workspace-up; } - Mod+${right} { focus-column-right; } + Mod+Left { focus-column-left; } + Mod+Down { focus-window-or-workspace-down; } + Mod+Up { focus-window-or-workspace-up; } + Mod+Right { focus-column-right; } + Mod+${left} { focus-column-left; } + Mod+${down} { focus-window-or-workspace-down; } + Mod+${up} { focus-window-or-workspace-up; } + Mod+${right} { focus-column-right; } - Mod+Ctrl+Left { move-column-left; } - Mod+Ctrl+Down { move-window-down-or-to-workspace-down; } - Mod+Ctrl+Up { move-window-up-or-to-workspace-up; } - Mod+Ctrl+Right { move-column-right; } - Mod+Ctrl+${left} { move-column-left; } - Mod+Ctrl+${down} { move-window-down-or-to-workspace-down; } - Mod+Ctrl+${up} { move-window-up-or-to-workspace-up; } - Mod+Ctrl+${right} { move-column-right; } + Mod+Ctrl+Left { move-column-left; } + Mod+Ctrl+Down { move-window-down-or-to-workspace-down; } + Mod+Ctrl+Up { move-window-up-or-to-workspace-up; } + Mod+Ctrl+Right { move-column-right; } + Mod+Ctrl+${left} { move-column-left; } + Mod+Ctrl+${down} { move-window-down-or-to-workspace-down; } + Mod+Ctrl+${up} { move-window-up-or-to-workspace-up; } + Mod+Ctrl+${right} { move-column-right; } - Mod+Home { focus-column-first; } - Mod+End { focus-column-last; } - Mod+Ctrl+Home { move-column-to-first; } - Mod+Ctrl+End { move-column-to-last; } + Mod+Home { focus-column-first; } + Mod+End { focus-column-last; } + Mod+Ctrl+Home { move-column-to-first; } + Mod+Ctrl+End { move-column-to-last; } - Mod+Shift+Left { focus-monitor-left; } - Mod+Shift+Down { focus-monitor-down; } - Mod+Shift+Up { focus-monitor-up; } - Mod+Shift+Right { focus-monitor-right; } - Mod+Shift+${left} { focus-monitor-left; } - Mod+Shift+${down} { focus-monitor-down; } - Mod+Shift+${up} { focus-monitor-up; } - Mod+Shift+${right} { focus-monitor-right; } + Mod+Shift+Left { focus-monitor-left; } + Mod+Shift+Down { focus-monitor-down; } + Mod+Shift+Up { focus-monitor-up; } + Mod+Shift+Right { focus-monitor-right; } + Mod+Shift+${left} { focus-monitor-left; } + Mod+Shift+${down} { focus-monitor-down; } + Mod+Shift+${up} { focus-monitor-up; } + Mod+Shift+${right} { focus-monitor-right; } - Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } - Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } - Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } - Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } - Mod+Shift+Ctrl+${left} { move-column-to-monitor-left; } - Mod+Shift+Ctrl+${down} { move-column-to-monitor-down; } - Mod+Shift+Ctrl+${up} { move-column-to-monitor-up; } - Mod+Shift+Ctrl+${right} { move-column-to-monitor-right; } + Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } + Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } + Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } + Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } + Mod+Shift+Ctrl+${left} { move-column-to-monitor-left; } + Mod+Shift+Ctrl+${down} { move-column-to-monitor-down; } + Mod+Shift+Ctrl+${up} { move-column-to-monitor-up; } + Mod+Shift+Ctrl+${right} { move-column-to-monitor-right; } - // Mod+Page_Down { focus-workspace-down; } - // Mod+Page_Up { focus-workspace-up; } - // Mod+N { focus-workspace-down; } - // Mod+E { focus-workspace-up; } - Mod+Ctrl+Page_Down { move-column-to-workspace-down; } - Mod+Ctrl+Page_Up { move-column-to-workspace-up; } - // Mod+Ctrl+N { move-column-to-workspace-down; } - // Mod+Ctrl+U { move-column-to-workspace-up; } + // Mod+Page_Down { focus-workspace-down; } + // Mod+Page_Up { focus-workspace-up; } + // Mod+N { focus-workspace-down; } + // Mod+E { focus-workspace-up; } + Mod+Ctrl+Page_Down { move-column-to-workspace-down; } + Mod+Ctrl+Page_Up { move-column-to-workspace-up; } - Mod+Shift+Page_Down { move-workspace-down; } - Mod+Shift+Page_Up { move-workspace-up; } - // Mod+Shift+N { move-workspace-down; } - // Mod+Shift+U { move-workspace-up; } + Mod+Shift+Page_Down { move-workspace-down; } + Mod+Shift+Page_Up { move-workspace-up; } + // Mod+Shift+N { move-workspace-down; } + // Mod+Shift+U { move-workspace-up; } - Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } - Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } - Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; } - Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; } + Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } + Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } + Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; } + Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; } - Mod+WheelScrollRight { focus-column-right; } - Mod+WheelScrollLeft { focus-column-left; } - Mod+Ctrl+WheelScrollRight { move-column-right; } - Mod+Ctrl+WheelScrollLeft { move-column-left; } + Mod+WheelScrollRight { focus-column-right; } + Mod+WheelScrollLeft { focus-column-left; } + Mod+Ctrl+WheelScrollRight { move-column-right; } + Mod+Ctrl+WheelScrollLeft { move-column-left; } - Mod+Shift+WheelScrollDown { focus-column-right; } - Mod+Shift+WheelScrollUp { focus-column-left; } - Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } - Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } + Mod+Shift+WheelScrollDown { focus-column-right; } + Mod+Shift+WheelScrollUp { focus-column-left; } + Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } + Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } - Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } - Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } + Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } + Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } - Mod+1 { focus-workspace "general"; } - Mod+2 { focus-workspace "browse"; } - Mod+3 { focus-workspace "chat"; } - Mod+4 { focus-workspace "code"; } - Mod+5 { focus-workspace "uni"; } - Mod+6 { focus-workspace "games"; } - Mod+7 { focus-workspace "sysadmin"; } - Mod+8 { focus-workspace "media"; } - Mod+9 { focus-workspace "bg"; } - Mod+Ctrl+1 { move-column-to-workspace "general"; } - Mod+Ctrl+2 { move-column-to-workspace "browse"; } - Mod+Ctrl+3 { move-column-to-workspace "chat"; } - Mod+Ctrl+4 { move-column-to-workspace "code"; } - Mod+Ctrl+5 { move-column-to-workspace "uni"; } - Mod+Ctrl+6 { move-column-to-workspace "games"; } - Mod+Ctrl+7 { move-column-to-workspace "sysadmin"; } - Mod+Ctrl+8 { move-column-to-workspace "media"; } - Mod+Ctrl+9 { move-column-to-workspace "bg"; } + // Mod+1 { focus-workspace "general"; } + // Mod+2 { focus-workspace "browse"; } + // Mod+3 { focus-workspace "chat"; } + // Mod+4 { focus-workspace "code"; } + // Mod+5 { focus-workspace "uni"; } + // Mod+6 { focus-workspace "games"; } + // Mod+7 { focus-workspace "sysadmin"; } + // Mod+8 { focus-workspace "media"; } + // Mod+9 { focus-workspace "bg"; } + // Mod+Ctrl+1 { move-column-to-workspace "general"; } + // Mod+Ctrl+2 { move-column-to-workspace "browse"; } + // Mod+Ctrl+3 { move-column-to-workspace "chat"; } + // Mod+Ctrl+4 { move-column-to-workspace "code"; } + // Mod+Ctrl+5 { move-column-to-workspace "uni"; } + // Mod+Ctrl+6 { move-column-to-workspace "games"; } + // Mod+Ctrl+7 { move-column-to-workspace "sysadmin"; } + // Mod+Ctrl+8 { move-column-to-workspace "media"; } + // Mod+Ctrl+9 { move-column-to-workspace "bg"; } - // Mod+Q { focus-workspace 1; } - // Mod+W { focus-workspace 2; } - // Mod+F { focus-workspace 3; } - // Mod+P { focus-workspace 4; } - // Mod+B { focus-workspace 5; } - // Mod+J { focus-workspace 6; } - // Mod+L { focus-workspace 7; } - // Mod+Y { focus-workspace 8; } - // Mod+Apostrophe { focus-workspace 9; } - // Mod+Ctrl+Q { move-column-to-workspace 1; } - // Mod+Ctrl+W { move-column-to-workspace 2; } - // Mod+Ctrl+F { move-column-to-workspace 3; } - // Mod+Ctrl+P { move-column-to-workspace 4; } - // Mod+Ctrl+B { move-column-to-workspace 5; } - // Mod+Ctrl+J { move-column-to-workspace 6; } - // Mod+Ctrl+L { move-column-to-workspace 7; } - // Mod+Ctrl+Y { move-column-to-workspace 8; } - // Mod+Ctrl+Apostrophe { move-column-to-workspace 9; } + Mod+Q { focus-workspace 1; } + Mod+W { focus-workspace 2; } + Mod+F { focus-workspace 3; } + Mod+P { focus-workspace 4; } + Mod+B { focus-workspace 5; } + Mod+J { focus-workspace 6; } + Mod+L { focus-workspace 7; } + Mod+U { focus-workspace 8; } + Mod+Y { focus-workspace 9; } + Mod+Ctrl+Shift+Q { move-column-to-workspace 1; } + Mod+Ctrl+Shift+W { move-column-to-workspace 2; } + Mod+Ctrl+Shift+F { move-column-to-workspace 3; } + Mod+Ctrl+Shift+P { move-column-to-workspace 4; } + Mod+Ctrl+Shift+B { move-column-to-workspace 5; } + Mod+Ctrl+Shift+J { move-column-to-workspace 6; } + Mod+Ctrl+Shift+L { move-column-to-workspace 7; } + Mod+Ctrl+Shift+U { move-column-to-workspace 8; } + Mod+Ctrl+Shift+Y { move-column-to-workspace 9; } - // Mod+Ctrl+1 { move-window-to-workspace 1; } + // Mod+Ctrl+1 { move-window-to-workspace 1; } - Mod+Tab { focus-workspace-previous; } + Mod+Tab { focus-workspace-previous; } - Mod+Ctrl+Comma { consume-or-expel-window-left; } - Mod+Ctrl+Period { consume-or-expel-window-right; } + Mod+Ctrl+Comma { consume-or-expel-window-left; } + Mod+Ctrl+Period { consume-or-expel-window-right; } - Mod+Comma { set-column-width "-10%"; } - Mod+Period { set-column-width "+10%"; } - Mod+T { switch-preset-column-width; } - Mod+H { set-column-width "50%"; } - Mod+Shift+Comma { set-window-height "-10%"; } - Mod+Shift+Period { set-window-height "+10%"; } - Mod+Shift+T { reset-window-height; } + Mod+Comma { set-column-width "-10%"; } + Mod+Period { set-column-width "+10%"; } + Mod+T { switch-preset-column-width; } + Mod+H { set-column-width "50%"; } + Mod+Shift+Comma { set-window-height "-10%"; } + Mod+Shift+Period { set-window-height "+10%"; } + Mod+Shift+T { reset-window-height; } - Mod+M { maximize-column; } - Mod+G { switch-focus-between-floating-and-tiling; } - Mod+C { center-column; } - Mod+Ctrl+M { fullscreen-window; } - Mod+Ctrl+G { toggle-window-floating; } + Mod+V { toggle-column-tabbed-display; } + Mod+M { maximize-column; } + Mod+G { switch-focus-between-floating-and-tiling; } + Mod+C { center-column; } + Mod+Ctrl+M { fullscreen-window; } + Mod+Ctrl+G { toggle-window-floating; } - Mod+Ctrl+Q { close-window; } - Mod+Minus { set-column-width "-10%"; } - Mod+Equal { set-column-width "+10%"; } + Mod+Ctrl+Q { close-window; } + Mod+Minus { set-column-width "-10%"; } + Mod+Equal { set-column-width "+10%"; } - Mod+Escape { switch-layout "next"; } - // Mod+Shift+Space { switch-layout "prev"; } + Mod+Escape { switch-layout "next"; } + // Mod+Shift+Space { switch-layout "prev"; } - Print { screenshot; } - Ctrl+Print { screenshot-screen; } - Alt+Print { screenshot-window; } - } - ''; + Print { screenshot; } + Ctrl+Print { screenshot-screen; } + Alt+Print { screenshot-window; } + } + ''; + in + if hostname != "dunamis" + then (builtins.replaceStrings ["// variant \"colemak_dh,\" "] ["variant \"colemak_dh,\""] niriConfig) + else niriConfig; }; }; programs.waybar = { enable = true; - #package = pkgs.waybar-0.11.0"; systemd = { enable = true; target = "graphical-session.target"; }; - settings = let - hostname = osConfig.networking.hostName; - in { + settings = { bar-0 = { layer = "top"; position = "bottom"; - height = 40; - spacing = 6; - margin-left = 8; - margin-right = 8; - margin-bottom = 8; + height = 32; + spacing = 4; + margin-left = 63; + margin-right = 63; reload_style_on_change = true; modules-left = [ - #"custom/notification" - "clock" + "niri/language" + "niri/workspaces" "wlr/taskbar" ]; - modules-center = [ - "custom/notification" - "group/niri" - "privacy" - ]; + # modules-center = []; modules-right = [ - "tray" "wireplumber" - (lib.mkIf (hostname != "dunamis") - "group/laptop") + (ifLaptop "group/laptop") + "tray" + "privacy" + (ifLaptop "power-profiles-daemon") "idle_inhibitor" + "custom/notification" + "clock" ]; "niri/workspaces" = { format = "{icon}"; format-icons = { - general = "󰾞"; - browse = "󰜏"; - chat = "󰭹"; + "1" = "I"; + "2" = "II"; + "3" = "III"; + "4" = "IV"; + "5" = "V"; + "6" = "VI"; + "7" = "VII"; + "8" = "IIX"; + "9" = "IX"; + "10" = "X"; + general = "󰘧"; + web = "󰖟"; + chat = "󰻞"; code = "󰅩"; - uni = "󰁰"; - games = "󰺵"; - sysadmin = "󰒓"; - media = "󱖑"; - bg = "󰣆"; - # focused = "󰗝"; - # active = "󰻃"; - default = "󰘧"; + uni = "󱆀"; + games = "󰺶"; + system = "󰢻"; + media = "󱜐"; + tray = "󱊖"; }; }; "niri/language" = { @@ -780,73 +854,37 @@ in { format-uk = "🇺🇦"; }; "custom/separator" = { - format = "|"; + format = "󰝠"; interval = "once"; tooltip = false; }; - "group/niri" = { - orientation = "inherit"; - modules = [ - "niri/language" - "niri/workspaces" - ]; - }; "group/laptop" = { orientation = "inherit"; - drawer = { - transition-duration = 500; - children-class = "laptop"; - transition-left-to-right = false; - }; modules = [ "battery" - "power-profiles-daemon" - "custom/separator" - "custom/kbd-backlight" - "custom/separator" "backlight" - "custom/separator" ]; }; + "backlight" = { + format = "{percent}% {icon}"; + format-icons = ["" ""]; + }; "idle_inhibitor" = { format = "{icon}"; format-icons = { - activated = "󰈈"; - deactivated = "󰈉"; + activated = "󰅶"; + deactivated = "󰾪"; }; }; "tray" = { icon-size = 24; - spacing = 3; + spacing = 2; }; "clock" = { interval = 1; format = "{:%H:%M:%S}"; tooltip-format = "{:%d.%m.%Y}"; }; - # "backlight" = { - # device = "intel_backlight"; - # format = "{percent}% {icon}"; - # format-icons = ["󰃞" "󰃟" "󰃝" "󰃠"]; - # on-scroll-up = "light -A 2%"; - # on-scroll-down = "light -U 2%"; - # }; - "custom/backlight" = { - format = "{}% {icon}"; - format-icons = ["󰃠"]; - exec = "~/.local/bin/brightness.nu get-percentage"; - on-scroll-up = "~/.local/bin/brightness.nu change 2"; - on-scroll-down = "~/.local/bin/brightness.nu change 2"; - interval = 1; - }; - "custom/kbd-backlight" = { - format = "{}% {icon}"; - format-icons = ["󰌌"]; - exec = "~/.local/bin/keyboard-brightness.nu get-percentage"; - on-scroll-up = "~/.local/bin/keyboard-brightness.nu change"; - on-scroll-down = "~/.local/bin/keyboard-brightness.nu change -1"; - interval = 1; - }; battery = { states = { good = 95; @@ -883,7 +921,7 @@ in { format = "{volume}% {icon}"; format-muted = "󰖁"; format-icons = ["󰕿" "󰖀" "󰕾"]; - on-click = "pwvucontrol"; + on-click = "${pkgs.pwvucontrol}/bin/pwvucontrol"; on-click-right = "wpctl set-mute @DEFAULT_SINK@ toggle"; }; "custom/notification" = { @@ -903,7 +941,7 @@ in { escape = true; }; "privacy" = { - # icon-spacing = 4; + icon-spacing = 2; icon-size = 16; transition-duration = 250; screenshare = { @@ -926,46 +964,44 @@ in { }; }; }; - style = let - stylix = config.lib.stylix.colors; - in '' - @define-color base00 #${stylix.base00}; - @define-color base01 #${stylix.base01}; - @define-color base02 #${stylix.base02}; - @define-color base03 #${stylix.base03}; - @define-color base04 #${stylix.base04}; - @define-color base05 #${stylix.base05}; - @define-color base06 #${stylix.base06}; - @define-color base07 #${stylix.base07}; - @define-color base08 #${stylix.base08}; - @define-color base09 #${stylix.base09}; - @define-color base0A #${stylix.base0A}; - @define-color base0B #${stylix.base0B}; - @define-color base0C #${stylix.base0C}; - @define-color base0D #${stylix.base0D}; - @define-color base0E #${stylix.base0E}; - @define-color base0F #${stylix.base0F}; + style = '' + @define-color base00 #${colors.base00}; + @define-color base01 #${colors.base01}; + @define-color base02 #${colors.base02}; + @define-color base03 #${colors.base03}; + @define-color base04 #${colors.base04}; + @define-color base05 #${colors.base05}; + @define-color base06 #${colors.base06}; + @define-color base07 #${colors.base07}; + @define-color base08 #${colors.base08}; + @define-color base09 #${colors.base09}; + @define-color base0A #${colors.base0A}; + @define-color base0B #${colors.base0B}; + @define-color base0C #${colors.base0C}; + @define-color base0D #${colors.base0D}; + @define-color base0E #${colors.base0E}; + @define-color base0F #${colors.base0F}; * { - font-family: Iosevka Nerd Font Propo, FontAwesome; + font-family: ${config.stylix.fonts.sansSerif.name}, FontAwesome; + font-weight: 500; font-size: 100%; - /* margin: 0px 2px 2px 2px; */ } - window#waybar { background-color: transparent; - /* border-top: 3px solid @overlay0; */ color: @base05; - /* padding: 0px 2px 0px 0px; */ transition-property: background-color; transition-duration: 0.5s; } - - .modules-right, - .modules-center, - .modules-left { - border-radius: 8px; + .modules-left, + .modules-right { + border-top-left-radius: 12px; + border-top-right-radius: 12px; + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; + background-color: @base00; + color: @base05; + padding: 0 0.5em; } - tooltip { background: @base01; border: 1px solid @base0E; @@ -975,85 +1011,39 @@ in { } button { box-shadow: inset 0 -3px transparent; - border-radius: 12px; + border-radius: 16px; } - - /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ button:hover { background: inherit; box-shadow: inset 0 -3px transparent; } - #mode { background-color: rgba(0, 0, 0, 0.2); box-shadow: inset 0 -3px @base05; } - - #clock, #battery, - #cpu, - #memory, - #disk, - #temperature, #backlight, - #custom-kbd-backlight, #workspaces, - #network, - #pulseaudio, - #wireplumber, - #custom-media, - #laptop, - #tray, - #mode, - #privacy - #privacy-item, - #idle_inhibitor, - #backlight-slider, - #custom-notification, - #scratchpad, - #power-profiles-daemon, #taskbar, #language, - #upower, - #mpris, - #mpd { - padding: 0 0.8em; - border-radius: 12px; - color: @base05; - background-color: @base00; - } - - /* #upower, */ + #clock, #battery, #backlight, - #custom-kbd-backlight, - #backlight-slider, - #cpu, - #memory, - #disk, - #network, #wireplumber, - #power-profiles-daemon { - padding-right: 0.8em; + #custom-separator { + padding: 0 0.3em; } - - #language { - padding-right: 0; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - } - #workspaces { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - } - - #taskbar, - #workspaces { - padding: 0 0.5em; - } - #taskbar button, + #privacy, + #tray button, + #privacy-item, + #idle_inhibitor, + #custom-notification, + #power-profiles-daemon, #workspaces button { - padding: 0 0.2em; + padding: 0 0.2em; + } + #taskbar button { + padding: 0 0.1em; } #workspaces button.active { color: @base0D; @@ -1065,81 +1055,39 @@ in { window#empty { background-color: transparent; } - #battery.critical:not(.charging) { - background-color: @base09; - color: @base00; + color: @base09; animation-name: blink; animation-duration: 0.5s; animation-timing-function: steps(12); animation-iteration-count: infinite; animation-direction: alternate; } - #power-profiles-daemon.performance { - background-color: @base00; - color: @base08; + color: @base0D; } - #power-profiles-daemon.balanced { - background-color: @base00; - color: @base0E; + color: @base0B; } - #power-profiles-daemon.power-saver { - background-color: @base00; - color: @base08; + color: @base0A; } - label:focus { background-color: #000000; } - #tray > .passive { -gtk-icon-effect: dim; } - #tray > .needs-attention { -gtk-icon-effect: highlight; - background-color: #eb4d4b; + background-color: @base08; } - - #idle_inhibitor { - padding: 0 0.9em; - } - - - #idle_inhibitor:hover { - box-shadow: inset 0 -3px @base05; - } - - #idle_inhibitor.activated { - background-color: @base05; - color: @base00; - } - - #idle_inhibitor.activated:hover { - box-shadow: inset 0 -3px @base00; - } - - #laptop, - #privacy { - padding: 0em; - } - #privacy-item.screenshare { - background-color: @base00; color: @base0C; } - #privacy-item.audio-in { - background-color: @base00; color: @base0E; } - - #privacy-item.audio-out { - background-color: @base; - } ''; }; programs.walker = { @@ -1485,30 +1433,36 @@ in { programs.wpaperd.enable = true; home.packages = with pkgs; [ - celluloid + (ifLaptop brightnessctl) nautilus - gtklock helvum loupe - niri evince junction + celluloid + mission-center + dconf libnotify + playerctl wdisplays pwvucontrol wl-clipboard-rs + libqalculate ]; gtk = { enable = true; iconTheme = { - name = "Papirus-Dark"; + name = + if config.stylix.polarity == "dark" + then "Papirus-Dark" + else "Papirus-Light"; package = pkgs.papirus-icon-theme; }; }; qt = { enable = true; - # platformTheme.name = "gtk3"; + platformTheme.name = "gtk3"; }; dconf.settings = { "org/gnome/desktop/interface" = { @@ -1541,136 +1495,76 @@ in { "x-scheme-handler/unknown" = web_browser; }; }; + desktopEntries = { + zen-browser-profile = { + name = "Zen Browser (Choose profile)"; + icon = "app.zen_browser.zen"; + exec = "flatpak run --branch=stable --arch=x86_64 --command=launch-script.sh --file-forwarding app.zen_browser.zen --ProfileManager @@u %u @@"; + }; + logseq-wayland = { + name = "Logseq Desktop (Wayland)"; + icon = "com.logseq.Logseq"; + exec = "flatpak run --branch=stable --arch=x86_64 --command=run.sh --file-forwarding com.logseq.Logseq @@u %U @@ --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WaylandWindowDecorations"; + }; + }; }; systemd.user = { settings.Manager.DefaultEnvironment = { - # QT_QPA_PLATFORMTHEME = "gtk3"; QT_QPA_PLATFORM = "wayland"; DISPLAY = ":123"; }; - targets.tray = { - # workaround for udiskie - Unit = { - Description = "Home Manager System Tray"; - }; - }; - services = { - udiskie = { + targets.tray.Unit.Description = "Home Manager System Tray"; # workaround for udiskie + services = let + mkGraphicalService = config: graphicalService // config; + graphicalService = { + Install.WantedBy = ["niri.service"]; Unit = { + Requisite = ["graphical-session.target"]; PartOf = ["graphical-session.target"]; After = ["graphical-session.target"]; - Requisite = ["graphical-session.target"]; - }; - Install = { - WantedBy = ["niri.service"]; - }; - }; - waybar = { - Unit = { - PartOf = ["graphical-session.target"]; - After = ["graphical-session.target"]; - Requisite = ["graphical-session.target"]; - }; - Install = { - WantedBy = ["niri.service"]; - }; - }; - copyq = { - Unit = { - PartOf = ["graphical-session.target"]; - After = ["graphical-session.target"]; - Requisite = ["graphical-session.target"]; - }; - Install = { - WantedBy = ["niri.service"]; }; Service = { - Environment = lib.mkForce "QT_QPA_PLATFORM=wayland"; Restart = "on-failure"; - RestartSec = 1; TimeoutStopSec = 10; - }; - }; - wpaperd = { - Unit = { - PartOf = ["graphical-session.target"]; - After = ["graphical-session.target"]; - Requisite = ["graphical-session.target"]; - }; - Install = { - WantedBy = ["niri.service"]; - }; - Service = { - Type = "simple"; - ExecStart = "${pkgs.wpaperd}/bin/wpaperd"; - Restart = "on-failure"; RestartSec = 1; - TimeoutStopSec = 10; }; }; - network-manager-applet = { - Unit = { - PartOf = ["graphical-session.target"]; - After = ["graphical-session.target"]; - Requisite = ["graphical-session.target"]; - }; - Install = { - WantedBy = ["niri.service"]; - }; + in { + udiskie = mkGraphicalService {}; + waybar = mkGraphicalService {}; + network-manager-applet = mkGraphicalService {}; + # wlsunset = mkGraphicalService {}; + # hypridle = mkGraphicalService {}; + copyq = mkGraphicalService { + Service = + graphicalService.Service + // { + Environment = lib.mkForce "QT_QPA_PLATFORM=wayland"; + }; }; - gnome-polkit-agent = { - Unit = { - PartOf = ["graphical-session.target"]; - After = ["graphical-session.target"]; - Requisite = ["graphical-session.target"]; - }; - Install = { - WantedBy = ["niri.service"]; - }; - Service = { - Type = "simple"; - ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; - Restart = "on-failure"; - RestartSec = 1; - TimeoutStopSec = 10; - }; + xwayland-satellite = mkGraphicalService { + Service = + graphicalService.Service + // { + Type = "simple"; + ExecStart = "${lib.getExe pkgs.xwayland-satellite} :123"; + }; }; - wlsunset = { - Unit = { - PartOf = ["graphical-session.target"]; - After = ["graphical-session.target"]; - Requisite = ["graphical-session.target"]; - }; - Install = { - WantedBy = ["niri.service"]; - }; + wpaperd = mkGraphicalService { + Service = + graphicalService.Service + // { + Restart = "always"; + RestartSec = "10"; + }; }; - hypridle = { - Unit = { - PartOf = ["graphical-session.target"]; - After = ["graphical-session.target"]; - Requisite = ["graphical-session.target"]; - }; - Install = { - WantedBy = ["niri.service"]; - }; - }; - xwayland-satellite = { - Unit = { - PartOf = ["graphical-session.target"]; - After = ["graphical-session.target"]; - Requisite = ["graphical-session.target"]; - }; - Install = { - WantedBy = ["niri.service"]; - }; - Service = { - Type = "simple"; - ExecStart = "${lib.getExe pkgs.xwayland-satellite} :123"; - Restart = "on-failure"; - RestartSec = 1; - TimeoutStopSec = 10; - }; + gnome-polkit-agent = mkGraphicalService { + Service = + graphicalService.Service + // { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + }; }; }; }; diff --git a/modules/nixos/desktop/niri.nix b/modules/nixos/desktop/niri.nix index 102b8f6..c0775f4 100644 --- a/modules/nixos/desktop/niri.nix +++ b/modules/nixos/desktop/niri.nix @@ -13,6 +13,7 @@ in { mkEnableOption "enable niri desktop"; }; config = mkIf cfg.enable { + programs.niri.enable = true; environment.systemPackages = with pkgs; [ brightnessctl gcr_4