From 6fc045c1700a1137ef2774983d0d3b1e8cb5e856 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Tue, 19 Aug 2025 19:04:39 +0200 Subject: [PATCH] nixosConfigurations/common/desktop/niri: adjustments Signed-off-by: Sefa Eyeoglu --- .../andromeda/configuration.nix | 2 +- nixosConfigurations/andromeda/default.nix | 2 +- .../andromeda/desktop/niri.nix | 3 + .../andromeda/desktop/sway.nix | 13 -- .../common/desktop/default.nix | 3 + nixosConfigurations/common/desktop/fuzzel.nix | 1 - nixosConfigurations/common/desktop/niri.nix | 11 + nixosConfigurations/common/desktop/sway.nix | 204 ------------------ nixosConfigurations/common/desktop/waybar.nix | 8 +- nixosConfigurations/common/pulsar-x2v2.nix | 12 +- nixosConfigurations/dyson/configuration.nix | 3 +- nixosConfigurations/dyson/default.nix | 1 - nixosConfigurations/dyson/desktop/sway.nix | 15 -- 13 files changed, 28 insertions(+), 250 deletions(-) create mode 100644 nixosConfigurations/andromeda/desktop/niri.nix delete mode 100644 nixosConfigurations/andromeda/desktop/sway.nix delete mode 100644 nixosConfigurations/common/desktop/sway.nix delete mode 100644 nixosConfigurations/dyson/desktop/sway.nix diff --git a/nixosConfigurations/andromeda/configuration.nix b/nixosConfigurations/andromeda/configuration.nix index a636d05a..e5852fbb 100644 --- a/nixosConfigurations/andromeda/configuration.nix +++ b/nixosConfigurations/andromeda/configuration.nix @@ -5,7 +5,7 @@ }: { imports = [ ./borg.nix - ./desktop/sway.nix + ./desktop/niri.nix ./desktop/swayidle.nix ./desktop/waybar.nix ./disks.nix diff --git a/nixosConfigurations/andromeda/default.nix b/nixosConfigurations/andromeda/default.nix index 6af9e121..3e21fcdb 100644 --- a/nixosConfigurations/andromeda/default.nix +++ b/nixosConfigurations/andromeda/default.nix @@ -24,6 +24,7 @@ ../common/desktop/kitty.nix ../common/desktop/mako.nix ../common/desktop/messengers.nix + ../common/desktop/niri.nix ../common/desktop/obs.nix ../common/desktop/orca-slicer.nix ../common/desktop/pipewire @@ -33,7 +34,6 @@ ../common/desktop/qt ../common/desktop/screenshot-bash.nix ../common/desktop/session-lock.nix - ../common/desktop/sway.nix ../common/desktop/swayidle.nix ../common/desktop/vr.nix ../common/desktop/waybar.nix diff --git a/nixosConfigurations/andromeda/desktop/niri.nix b/nixosConfigurations/andromeda/desktop/niri.nix new file mode 100644 index 00000000..011b8f01 --- /dev/null +++ b/nixosConfigurations/andromeda/desktop/niri.nix @@ -0,0 +1,3 @@ +{...}: { + hm.programs.niri.settings.outputs."LG Electronics LG ULTRAGEAR 104MANJ7FL47".variable-refresh-rate = true; +} diff --git a/nixosConfigurations/andromeda/desktop/sway.nix b/nixosConfigurations/andromeda/desktop/sway.nix deleted file mode 100644 index a0b0d838..00000000 --- a/nixosConfigurations/andromeda/desktop/sway.nix +++ /dev/null @@ -1,13 +0,0 @@ -{...}: { - hm.wayland.windowManager.sway.config.output = { - "LG Electronics LG ULTRAGEAR 104MANJ7FL47" = { - mode = "2560x1440@144Hz"; - position = "0,0"; - adaptive_sync = "on"; - }; - "Samsung Electric Company S24E650 H4ZJ803253" = { - mode = "1920x1080@60Hz"; - position = "2560,0"; - }; - }; -} diff --git a/nixosConfigurations/common/desktop/default.nix b/nixosConfigurations/common/desktop/default.nix index e807228e..f3570f76 100644 --- a/nixosConfigurations/common/desktop/default.nix +++ b/nixosConfigurations/common/desktop/default.nix @@ -26,6 +26,9 @@ xdg-utils ]; + # TODO: move somewhere better + services.dbus.implementation = "broker"; + programs.appimage = { enable = true; binfmt = true; diff --git a/nixosConfigurations/common/desktop/fuzzel.nix b/nixosConfigurations/common/desktop/fuzzel.nix index 1f79d1e1..6f8edce5 100644 --- a/nixosConfigurations/common/desktop/fuzzel.nix +++ b/nixosConfigurations/common/desktop/fuzzel.nix @@ -15,7 +15,6 @@ main = { font = "Monocraft:size=13"; terminal = config.hm.wayland.windowManager.sway.config.terminal; - launch-prefix = "uwsm app --"; }; border = { width = 2; diff --git a/nixosConfigurations/common/desktop/niri.nix b/nixosConfigurations/common/desktop/niri.nix index d7a28c33..94b20786 100644 --- a/nixosConfigurations/common/desktop/niri.nix +++ b/nixosConfigurations/common/desktop/niri.nix @@ -27,6 +27,13 @@ in { hm.imports = [inputs.niri.homeModules.config]; nixpkgs.overlays = [inputs.niri.overlays.niri]; + primaryUser.extraGroups = ["video" "input"]; + + environment.sessionVariables = { + "_JAVA_AWT_WM_NONREPARENTING" = "1"; + "NIXOS_OZONE_WL" = "1"; + }; + programs.niri = { enable = true; package = pkgs.niri-unstable; @@ -202,6 +209,10 @@ in { action = focus-workspace-up; }; } + { + "Mod+Tab".action = focus-monitor-next; + "Mod+Shift+Tab".action = focus-monitor-previous; + } (mkMoveFocusBinds' "WheelScrollLeft" "column-left") (mkMoveFocusBinds' "WheelScrollRight" "column-right") (mkWorkspaceBinds 1) diff --git a/nixosConfigurations/common/desktop/sway.nix b/nixosConfigurations/common/desktop/sway.nix deleted file mode 100644 index d3e25c43..00000000 --- a/nixosConfigurations/common/desktop/sway.nix +++ /dev/null @@ -1,204 +0,0 @@ -{ - config, - lib, - lib', - pkgs, - ... -}: let - inherit (lib) getExe mapAttrsToList singleton; - inherit (lib'.sway) mkDirectionKeys mkExec mkWorkspaceKeys; - - wallpaper = pkgs.fetchurl { - name = "sway-wallpaper.jpg"; - url = "https://scrumplex.rocks/img/richard-horvath-catppuccin.jpg"; - hash = "sha256-HQ+ZvNPUCnYkAl21JR6o83OBsAJAvpBt93OUSm0ibLU="; - }; -in { - primaryUser.extraGroups = ["video" "input"]; - - environment.sessionVariables = { - "_JAVA_AWT_WM_NONREPARENTING" = "1"; - "NIXOS_OZONE_WL" = "1"; - }; - - programs.sway = { - enable = true; - extraOptions = ["-Dlegacy-wl-drm"]; - wrapperFeatures.gtk = true; - extraPackages = []; - }; - - hm.catppuccin.sway.enable = true; - - hm.wayland.windowManager.sway = { - enable = true; - package = config.programs.sway.package; - systemd.enable = false; - config = { - terminal = "uwsm app -T"; - modifier = "Mod4"; - startup = [ - {command = "uwsm finalize";} - ]; - - input."type:keyboard" = { - xkb_layout = "us"; - xkb_variant = "altgr-intl"; - xkb_numlock = "enabled"; - }; - - output."*" = {bg = "${wallpaper} fill";}; - assigns = { - # TODO: other roles - "4" = [{app_id = "org.gnome.Evolution";}]; - "5" = [ - {app_id = "Element";} - {app_id = "discord";} - {app_id = "org.telegram.desktop";} - {app_id = "signal";} - {class = "Element";} - {class = "discord";} - ]; - }; - - window = { - border = 4; - hideEdgeBorders = "smart"; - commands = [ - # TODO: other roles - { - criteria.app_id = "popup_pulsemixer"; - command = "floating enable; sticky enable; resize set 800 600; border pixel"; - } - { - criteria.app_id = "net.sapples.LiveCaptions"; - command = "floating enable; sticky enable"; - } - { - criteria.title = ".*"; - command = "inhibit_idle fullscreen"; - } - ]; - }; - - bars = []; - - fonts = { - names = ["Monocraft"]; - size = 10.0; - }; - - keybindings = let - swayConf = config.hm.wayland.windowManager.sway.config; - # TODO; role - wobSock = "$XDG_RUNTIME_DIR/wob.sock"; - - mod = swayConf.modifier; - - mpc = getExe pkgs.mpc-cli; - pamixer = getExe pkgs.pamixer; - sed = getExe pkgs.gnused; - brightnessctl = getExe pkgs.brightnessctl; - in - lib.mkMerge ( - [ - (mkExec "${mod}+Return" swayConf.terminal) - (mkExec "${mod}+d" swayConf.menu) - (mkExec "${mod}+Ctrl+q" "loginctl lock-session") - # TODO: role - (mkExec "XF86AudioStop" "${mpc} stop") - (mkExec "XF86AudioPlay" "${mpc} toggle") - (mkExec "XF86AudioPause" "${mpc} toggle") - (mkExec "XF86AudioNext" "${mpc} next") - (mkExec "XF86AudioPrev" "${mpc} prev") - # TODO: role - (mkExec "XF86AudioMute" "${pamixer} -t && ${pamixer} --get-volume > ${wobSock}") - (mkExec "XF86AudioRaiseVolume" "${pamixer} -ui 2 && ${pamixer} --get-volume > ${wobSock}") - (mkExec "XF86AudioLowerVolume" "${pamixer} -ud 2 && ${pamixer} --get-volume > ${wobSock}") - # TODO: role - (mkExec "Shift+XF86AudioRaiseVolume" "${mpc} vol +2 && ${mpc} vol | ${sed} 's|n/a|0%|g;s/[^0-9]*//g' > ${wobSock}") - (mkExec "Shift+XF86AudioLowerVolume" "${mpc} vol -2 && ${mpc} vol | ${sed} 's|n/a|0%|g;s/[^0-9]*//g' > ${wobSock}") - # TODO: role - (mkExec "XF86MonBrightnessDown" "${brightnessctl} set 5%- | ${sed} -En 's/.*\\(([0-9]+)%\\).*/\\1/p' > ${wobSock}") - (mkExec "XF86MonBrightnessUp" "${brightnessctl} set 5%+ | ${sed} -En 's/.*\\(([0-9]+)%\\).*/\\1/p' > ${wobSock}") - ] - ++ ( - map (mkWorkspaceKeys mod) ["1" "2" "3" "4" "5" "6" "7" "8" "9"] - ) - ++ ( - mapAttrsToList (mkDirectionKeys mod) { - ${swayConf.left} = "left"; - ${swayConf.right} = "right"; - ${swayConf.up} = "up"; - ${swayConf.down} = "down"; - "Left" = "left"; - "Right" = "right"; - "Up" = "up"; - "Down" = "down"; - } - ) - ++ (singleton { - "${mod}+Escape" = "kill"; - "${mod}+Shift+c" = "reload"; - "${mod}+r" = "mode resize"; - - "${mod}+w" = "layout toggle tabbed split"; - "${mod}+e" = "layout toggle split"; - - "${mod}+f" = "fullscreen toggle"; - "${mod}+Shift+f" = "fullscreen toggle global"; - - "${mod}+Space" = "focus mode_toggle"; - "${mod}+Shift+Space" = "floating toggle"; - - "${mod}+a" = "focus parent"; - }) - ); - colors = { - focused = { - background = "$blue"; - border = "$blue"; - childBorder = "$blue"; - indicator = "$blue"; - text = "$base"; - }; - focusedInactive = { - background = "$surface0"; - border = "$surface0"; - childBorder = "$surface0"; - indicator = "$surface0"; - text = "$pink"; - }; - unfocused = { - background = "$base"; - border = "$base"; - childBorder = "$base"; - indicator = "$base"; - text = "$text"; - }; - urgent = { - background = "$peach"; - border = "$peach"; - childBorder = "$peach"; - indicator = "$peach"; - text = "$base"; - }; - }; - }; - }; - - services.dbus.implementation = "broker"; - - services.displayManager.enable = true; - programs.uwsm = { - enable = true; - waylandCompositors.sway = { - prettyName = "Sway"; - comment = "Sway with systemd"; - binPath = getExe config.hm.wayland.windowManager.sway.package; - }; - }; - hm.xdg.configFile."uwsm/default-id".text = '' - sway-uwsm.desktop - ''; -} diff --git a/nixosConfigurations/common/desktop/waybar.nix b/nixosConfigurations/common/desktop/waybar.nix index 2b6498c7..9a1b17df 100644 --- a/nixosConfigurations/common/desktop/waybar.nix +++ b/nixosConfigurations/common/desktop/waybar.nix @@ -69,7 +69,7 @@ in { tooltip-format-disconnected = "MPD (disconnected)"; on-scroll-up = "${pkgs.mpc-cli}/bin/mpc vol +2 > /dev/null && ${pkgs.mpc-cli}/bin/mpc vol | ${pkgs.gnused}/bin/sed 's|n/a|0%|g;s/[^0-9]*//g' > $XDG_RUNTIME_DIR/wob.sock"; on-scroll-down = "${pkgs.mpc-cli}/bin/mpc vol -2 > /dev/null && ${pkgs.mpc-cli}/bin/mpc vol | ${pkgs.gnused}/bin/sed 's|n/a|0%|g;s/[^0-9]*//g' > $XDG_RUNTIME_DIR/wob.sock"; - on-click = "uwsm app -- ${termapp} ${config.hm.programs.ncmpcpp.package}/bin/ncmpcpp"; + on-click = "${termapp} ${config.hm.programs.ncmpcpp.package}/bin/ncmpcpp"; on-click-middle = "${pkgs.mpc-cli}/bin/mpc toggle"; on-click-right = ""; smooth-scrolling-threshold = 0.16; @@ -82,7 +82,7 @@ in { tooltip-format = "{ifname}"; tooltip-format-wifi = "{essid} ({signalStrength}%) 󰖩"; tooltip-format-disconnected = "Disconnected"; - on-click = "uwsm app -- ${termapp} ${pkgs.nload}/bin/nload"; + on-click = "${termapp} ${pkgs.nload}/bin/nload"; max-length = 50; interval = 1; }; @@ -99,7 +99,7 @@ in { car = "󰄍"; default = "󰕾"; }; - on-click = "uwsm app -- ${termapp} ${pkgs.pulsemixer}/bin/pulsemixer"; + on-click = "${termapp} ${pkgs.pulsemixer}/bin/pulsemixer"; on-scroll-up = "${pkgs.pamixer}/bin/pamixer -ui 2 && ${pkgs.pamixer}/bin/pamixer --get-volume > $XDG_RUNTIME_DIR/wob.sock"; on-scroll-down = "${pkgs.pamixer}/bin/pamixer -ud 2 && ${pkgs.pamixer}/bin/pamixer --get-volume > $XDG_RUNTIME_DIR/wob.sock"; smooth-scrolling-threshold = 0.16; @@ -113,7 +113,7 @@ in { format = "{capacity}% {icon}"; format-icons = ["󱃍" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; max-length = 25; - on-click = "uwsm app -- ${run-or-raise} powersupply ${lib.getExe pkgs.powersupply}"; + on-click = "${run-or-raise} powersupply ${lib.getExe pkgs.powersupply}"; }; backlight = { format = "{percent}% {icon}"; diff --git a/nixosConfigurations/common/pulsar-x2v2.nix b/nixosConfigurations/common/pulsar-x2v2.nix index 5c360369..2d3f5567 100644 --- a/nixosConfigurations/common/pulsar-x2v2.nix +++ b/nixosConfigurations/common/pulsar-x2v2.nix @@ -5,14 +5,8 @@ ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="3554", ATTRS{idProduct}=="f508", ATTR{power/wakeup}="disabled" ''; - hm.wayland.windowManager.sway.config.input = { - "13652:62728:pulsar_X2_V2" = { - accel_profile = "adaptive"; - pointer_accel = "-1.0"; - }; - "13652:62727:pulsar_X2_V2" = { - accel_profile = "adaptive"; - pointer_accel = "-1.0"; - }; + hm.programs.niri.settings.input.mouse = { + accel-profile = "adaptive"; + accel-speed = -1.; }; } diff --git a/nixosConfigurations/dyson/configuration.nix b/nixosConfigurations/dyson/configuration.nix index 287e6d05..5e9fe46a 100644 --- a/nixosConfigurations/dyson/configuration.nix +++ b/nixosConfigurations/dyson/configuration.nix @@ -7,7 +7,6 @@ ./boot.nix ./borg.nix ./desktop/niri.nix - ./desktop/sway.nix ./disks.nix ./keyd.nix ./networkmanager.nix @@ -29,6 +28,8 @@ services.power-profiles-daemon.enable = true; services.fwupd.enable = true; + networking.useNetworkd = true; + boot.binfmt.emulatedSystems = ["aarch64-linux"]; services.logind = { diff --git a/nixosConfigurations/dyson/default.nix b/nixosConfigurations/dyson/default.nix index c3fac4b5..8fdf7128 100644 --- a/nixosConfigurations/dyson/default.nix +++ b/nixosConfigurations/dyson/default.nix @@ -34,7 +34,6 @@ ../common/desktop/qt ../common/desktop/screenshot-bash.nix ../common/desktop/session-lock.nix - ../common/desktop/sway.nix ../common/desktop/swayidle.nix ../common/desktop/waybar.nix ../common/desktop/wayvnc.nix diff --git a/nixosConfigurations/dyson/desktop/sway.nix b/nixosConfigurations/dyson/desktop/sway.nix deleted file mode 100644 index 0b76b5a1..00000000 --- a/nixosConfigurations/dyson/desktop/sway.nix +++ /dev/null @@ -1,15 +0,0 @@ -{...}: { - hm.wayland.windowManager.sway.config = { - input."2362:628:PIXA3854:00_093A:0274_Touchpad" = { - natural_scroll = "enabled"; - tap = "enabled"; - tap_button_map = "lrm"; - }; - - output."BOE 0x095F Unknown" = { - mode = "2256x1504@59.999Hz"; - position = "0,0"; - scale = "1.25"; - }; - }; -} -- 2.51.2