From 95e23247b02eb32a6c44c9e93e239fd27dfce754 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 23 May 2025 07:16:03 -0300 Subject: [PATCH] niri comin along --- flake.nix | 1 - hosts/modules/desktop.nix | 3 +- hosts/modules/programs.nix | 130 +++++++------- packages/niri.nix | 129 -------------- users/modules/programs.nix | 1 - users/modules/user/default.nix | 2 +- users/modules/user/home.nix | 24 +++ users/modules/user/hyprland.nix | 299 -------------------------------- users/modules/user/programs.nix | 44 ----- 9 files changed, 88 insertions(+), 545 deletions(-) delete mode 100644 packages/niri.nix create mode 100644 users/modules/user/home.nix delete mode 100644 users/modules/user/hyprland.nix diff --git a/flake.nix b/flake.nix index 5a22c0c..8fe5b99 100644 --- a/flake.nix +++ b/flake.nix @@ -113,7 +113,6 @@ }; workstationOverlay = final: prev: { plasticity = nixpkgs.legacyPackages."x86_64-linux".callPackage ./packages/plasticity.nix { }; - niri = nixpkgs.legacyPackages."x86_64-linux".callPackage ./packages/niri.nix { }; }; serverOverlay = final: prev: { }; diff --git a/hosts/modules/desktop.nix b/hosts/modules/desktop.nix index 47c0ea6..42e1a60 100644 --- a/hosts/modules/desktop.nix +++ b/hosts/modules/desktop.nix @@ -38,6 +38,8 @@ environment.systemPackages = with pkgs; [ anyrun foot + swaybg + swww xwayland-satellite ]; @@ -55,7 +57,6 @@ enable = true; xdgOpenUsePortal = true; extraPortals = with pkgs; [ - # kdePackages.xdg-desktop-portal-kde xdg-desktop-portal-gtk xdg-desktop-portal-gnome ]; diff --git a/hosts/modules/programs.nix b/hosts/modules/programs.nix index 8ba8925..8d5c1b1 100644 --- a/hosts/modules/programs.nix +++ b/hosts/modules/programs.nix @@ -1,5 +1,6 @@ { hostType, + inputs, lib, pkgs, ... @@ -44,12 +45,6 @@ # Workstation specific configuration (lib.mkIf hostType.isWorkstation ( let - kdepkgs = with pkgs.kdePackages; [ - ark - dolphin - dolphin-plugins - kolourpaint - ]; kwrite = pkgs.symlinkJoin { name = "kwrite"; paths = [ pkgs.kdePackages.kate ]; @@ -65,69 +60,66 @@ }; in { - environment.systemPackages = - with pkgs; - [ - ### Dev Tools ### - bat - deploy-rs - fd - fzf - nixfmt-rfc-style - nix-init - nix-output-monitor - ripgrep - ### Internet Browsers & Communication ### - beeper - brave - microsoft-edge - nextcloud-client - tor-browser - vesktop - ### Office & Productivity ### - aspell - aspellDicts.de - aspellDicts.en - aspellDicts.en-computers - aspellDicts.pt_BR - kwrite - libreoffice-qt - obsidian - (octaveFull.withPackages (octavePackages: with octavePackages; [ signal ])) - onlyoffice-desktopeditors - rnote - ### Graphics & Design ### - gimp - inkscape - orca-slicer - plasticity - ### Gaming & Entertainment ### - clonehero - heroic - mangohud - prismlauncher - protonup - ### System Utilities ### - adwaita-icon-theme - junction - kara - kde-rounded-corners - libfido2 - # lilipod BROKEN - mission-center - p7zip - qbittorrent - quickemu - quickgui - rustdesk - steam-run - unrar - ### Media ### - mpv - obs-studio - qview - ] - ++ kdepkgs; + environment.systemPackages = with pkgs; [ + ### Dev Tools ### + bat + deploy-rs + fd + fzf + nixfmt-rfc-style + nix-init + nix-output-monitor + ripgrep + ### Internet Browsers & Communication ### + beeper + brave + nextcloud-client + tor-browser + vesktop + ### Office & Productivity ### + aspell + aspellDicts.de + aspellDicts.en + aspellDicts.en-computers + aspellDicts.pt_BR + kwrite + libreoffice-qt + obsidian + (octaveFull.withPackages (octavePackages: with octavePackages; [ signal ])) + onlyoffice-desktopeditors + rnote + ### Graphics & Design ### + gimp + inkscape + orca-slicer + plasticity + ### Gaming & Entertainment ### + clonehero + heroic + mangohud + prismlauncher + protonup + ### System Utilities ### + adwaita-icon-theme + junction + kara + kde-rounded-corners + libfido2 + morewaita-icon-theme + nautilus + mission-center + p7zip + qbittorrent + quickemu + quickgui + rustdesk + steam-run + unrar + ### Media ### + mpv + obs-studio + qview + ]; programs = { adb.enable = true; diff --git a/packages/niri.nix b/packages/niri.nix deleted file mode 100644 index f866e1f..0000000 --- a/packages/niri.nix +++ /dev/null @@ -1,129 +0,0 @@ -{ - lib, - dbus, - eudev, - fetchFromGitHub, - libdisplay-info, - libglvnd, - libinput, - libxkbcommon, - libgbm, - versionCheckHook, - nix-update-script, - pango, - pipewire, - pkg-config, - rustPlatform, - seatd, - systemd, - wayland, - withDbus ? true, - withDinit ? false, - withScreencastSupport ? true, - withSystemd ? true, -}: - -rustPlatform.buildRustPackage (finalAttrs: { - pname = "niri"; - version = "25.05"; - - src = fetchFromGitHub { - owner = "YaLTeR"; - repo = "niri"; - tag = "v${finalAttrs.version}"; - hash = "sha256-ngQ+iTHmBJkEbsjYfCWTJdV8gHhOCTkV8K0at6Y+YHI="; - }; - - postPatch = '' - patchShebangs resources/niri-session - substituteInPlace resources/niri.service \ - --replace-fail '/usr/bin' "$out/bin" - ''; - - useFetchCargoVendor = true; - cargoHash = "sha256-tZp7AhhddEhKWzEUTgosxXMEzALbv6FxqnJEb9MBhzc="; - - strictDeps = true; - - nativeBuildInputs = [ - pkg-config - rustPlatform.bindgenHook - ]; - - buildInputs = - [ - libdisplay-info - libglvnd # For libEGL - libinput - libxkbcommon - libgbm - pango - seatd - wayland # For libwayland-client - ] - ++ lib.optional (withDbus || withScreencastSupport || withSystemd) dbus - ++ lib.optional withScreencastSupport pipewire - ++ lib.optional withSystemd systemd # Includes libudev - ++ lib.optional (!withSystemd) eudev; # Use an alternative libudev implementation when building w/o systemd - - buildFeatures = - lib.optional withDbus "dbus" - ++ lib.optional withDinit "dinit" - ++ lib.optional withScreencastSupport "xdp-gnome-screencast" - ++ lib.optional withSystemd "systemd"; - buildNoDefaultFeatures = true; - - postInstall = - '' - install -Dm0644 resources/niri.desktop -t $out/share/wayland-sessions - '' - + lib.optionalString withDbus '' - install -Dm0644 resources/niri-portals.conf -t $out/share/xdg-desktop-portal - '' - + lib.optionalString (withSystemd || withDinit) '' - install -Dm0755 resources/niri-session -t $out/bin - '' - + lib.optionalString withSystemd '' - install -Dm0644 resources/niri{-shutdown.target,.service} -t $out/lib/systemd/user - '' - + lib.optionalString withDinit '' - install -Dm0644 resources/dinit/niri{-shutdown,} -t $out/lib/dinit.d/user - ''; - - env = { - # Force linking with libEGL and libwayland-client - # so they can be discovered by `dlopen()` - RUSTFLAGS = toString ( - map (arg: "-C link-arg=" + arg) [ - "-Wl,--push-state,--no-as-needed" - "-lEGL" - "-lwayland-client" - "-Wl,--pop-state" - ] - ); - }; - - nativeInstallCheckInputs = [ versionCheckHook ]; - versionCheckProgramArg = "--version"; - doInstallCheck = true; - - passthru = { - providedSessions = [ "niri" ]; - updateScript = nix-update-script { }; - }; - - meta = { - description = "Scrollable-tiling Wayland compositor"; - homepage = "https://github.com/YaLTeR/niri"; - changelog = "https://github.com/YaLTeR/niri/releases/tag/v${finalAttrs.version}"; - license = lib.licenses.gpl3Only; - maintainers = with lib.maintainers; [ - iogamaster - foo-dogsquared - sodiboo - getchoo - ]; - mainProgram = "niri"; - platforms = lib.platforms.linux; - }; -}) diff --git a/users/modules/programs.nix b/users/modules/programs.nix index 55e4488..6558ea2 100644 --- a/users/modules/programs.nix +++ b/users/modules/programs.nix @@ -19,7 +19,6 @@ programs = { bash = { enable = true; - historyFile = "~/.cache/bash_history"; }; helix = { diff --git a/users/modules/user/default.nix b/users/modules/user/default.nix index 173f040..660553d 100644 --- a/users/modules/user/default.nix +++ b/users/modules/user/default.nix @@ -2,7 +2,7 @@ { imports = [ - # ./hyprland.nix ./programs.nix + ./home.nix ]; } diff --git a/users/modules/user/home.nix b/users/modules/user/home.nix new file mode 100644 index 0000000..869d579 --- /dev/null +++ b/users/modules/user/home.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: + +{ + home.pointerCursor = { + package = pkgs.kdePackages.breeze; + name = "Breeze_Light"; + gtk.enable = true; + x11.enable = true; + }; + + gtk = { + enable = true; + iconTheme = { + package = pkgs.morewaita-icon-theme; + name = "MoreWaita"; + }; + gtk3.extraConfig = { + gtk-decoration-layout = "appmenu:"; + }; + gtk4.extraConfig = { + gtk-decoration-layout = "appmenu:"; + }; + }; +} diff --git a/users/modules/user/hyprland.nix b/users/modules/user/hyprland.nix deleted file mode 100644 index e895922..0000000 --- a/users/modules/user/hyprland.nix +++ /dev/null @@ -1,299 +0,0 @@ -{ - lib, - pkgs, - ... -}: - -let - heightfittr = pkgs.writeShellApplication { - name = "heightfittr"; - runtimeInputs = with pkgs; [ - socat - hyprland - ]; - text = '' - function handle { - case "$1" in - *openwindow*) - hyprctl dispatch scroller:fitheight all > /dev/null - ;; - *closewindow*) - hyprctl dispatch scroller:fitheight all > /dev/null - ;; - esac - } - socat - "UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | while read -r line; do - handle "$line" - done - ''; - }; - - scrollermodetoggle = pkgs.writeShellApplication { - name = "scrollermodetoggle"; - runtimeInputs = with pkgs; [ hyprland ]; - text = '' - if [ -f "$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/colmode" ]; then - rm "$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/colmode" - hyprctl --batch 'dispatch scroller:setmode row; notify 2 1000 0 "Row Mode"' - else - touch "$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/colmode" - hyprctl --batch 'dispatch scroller:setmode col; notify 2 1000 0 "Column Mode"' - fi - ''; - }; -in - -{ - wayland.windowManager.hyprland = { - enable = true; - plugins = with pkgs.hyprlandPlugins; [ hyprscroller ]; - extraConfig = '' - ################ - ### MONITORS ### - ################ - monitor=,preferred,auto,1 - - ################# - ### AUTOSTART ### - ################# - # exec-once = ${pkgs.gnome-settings-daemon}/libexec/gsd-rfkill - # exec-once = waybar - # exec-once = syshud - exec-once = ${lib.getExe heightfittr} - env = XCURSOR_SIZE,24 - env = HYPRCURSOR_SIZE,24 - - ##################### - ### LOOK AND FEEL ### - ##################### - general { - gaps_in = 5 - gaps_out = 20 - border_size = 2 - resize_on_border = true - allow_tearing = false - layout = scroller - } - misc { - font_family = Inter - } - plugin { - scroller { - column_default_width = onethird - focuswrap = false - column_widths = onethird onehalf twothirds - center_row_if_space_available = true - } - } - decoration { - rounding = 10 - rounding_power = 2 - dim_inactive = true - dim_strength = 0.3 - shadow { - enabled = true - range = 4 - render_power = 3 - } - blur { - enabled = true - size = 8 - passes = 1 - vibrancy = 0.1696 - } - layerrule = blur, waybar - layerrule = ignorealpha 0.5, waybar - layerrule = ignorezero, waybar - } - animations { - enabled = yes, please :) - bezier = easeOutQuint,0.23,1,0.32,1 - bezier = easeInOutCubic,0.65,0.05,0.36,1 - bezier = linear,0,0,1,1 - bezier = almostLinear,0.5,0.5,0.75,1.0 - bezier = quick,0.15,0,0.1,1 - animation = global, 1, 1, default - animation = border, 1, 1, easeOutQuint - animation = windows, 1, 1, easeOutQuint - animation = windowsIn, 1, 1, easeOutQuint, popin 87% - animation = windowsOut, 1, 1, linear, popin 87% - animation = fadeIn, 1, 1, almostLinear - animation = fadeOut, 1, 1, almostLinear - animation = fade, 1, 1, quick - animation = layers, 1, 1, easeOutQuint - animation = layersIn, 1, 1, easeOutQuint, fade - animation = layersOut, 1, 1, linear, fade - animation = fadeLayersIn, 1, 1, almostLinear - animation = fadeLayersOut, 1, 1, almostLinear - animation = workspaces, 1, 1, almostLinear, slidevert - } - misc { - force_default_wallpaper = 0 - disable_hyprland_logo = true - } - - ############# - ### INPUT ### - ############# - input { - kb_layout = us - kb_variant = altgr-intl - follow_mouse = 1 - sensitivity = 0 - accel_profile = flat - natural_scroll = true - touchpad { - natural_scroll = true - clickfinger_behavior = true - } - } - - ################### - ### KEYBINDINGS ### - ################### - $mainMod = SUPER - $terminal = ghostty - $menu = ulauncher-toggle - # APP SHORTCUTS - bind = ALT, SPACE, exec, $menu - bind = $mainMod, RETURN, exec, $terminal - # SESSION MANAGEMENT - bind = CTRL ALT, DELETE, exit, - bind = $mainMod, mouse_up, exec, hyprnome - bind = $mainMod, mouse_down, exec, hyprnome --previous - bind = CTRL ALT, j, exec, hyprnome - bind = CTRL ALT, k, exec, hyprnome --previous - bind = $mainMod CTRL ALT, j, exec, hyprnome --move - bind = $mainMod CTRL ALT, k, exec, hyprnome --move --previous - bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ - bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- - bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle - bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle - bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+ - bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%- - bindl = , XF86AudioNext, exec, playerctl next - bindl = , XF86AudioPause, exec, playerctl play-pause - bindl = , XF86AudioPlay, exec, playerctl play-pause - bindl = , XF86AudioPrev, exec, playerctl previous - bind = CTRL ALT SHIFT, a, exec, bash /home/user/.local/bin/toggle-audio-output.sh - # WINDOW MANAGEMENT - bind = ALT, F4, killactive, - bind = $mainMod, space, togglefloating, - bind = $mainMod, f, fullscreen - bindm = $mainMod, mouse:272, movewindow - bindm = $mainMod, mouse:273, resizewindow - bind = SUPER, h, movefocus, l - bind = SUPER, l, movefocus, r - bind = SUPER, k, movefocus, u - bind = SUPER, j, movefocus, d - bind = $mainMod CTRL, h, movewindow, l - bind = $mainMod CTRL, l, movewindow, r - bind = $mainMod CTRL, k, movewindow, u - bind = $mainMod CTRL, j, movewindow, d - bind = $mainMod, v, exec, ${lib.getExe scrollermodetoggle} - bind = $mainMod, r, scroller:cyclewidth, next - bind = $mainMod CTRL, r, scroller:cyclewidth, prev - bind = $mainMod, p, scroller:pin, - bind = $mainMod, c, scroller:alignwindow, center - bind = $mainMod CTRL, f, scroller:fitsize, all - - #################### - ### WINDOW RULES ### - #################### - windowrulev2 = suppressevent maximize, class:.* - windowrulev2 = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0 - # ulauncher - windowrule = float, ulauncher - windowrule = pin, ulauncher - windowrule = noborder, ulauncher - windowrule = noshadow, ulauncher - windowrule = nomaxsize, ulauncher - windowrule = noblur, ulauncher - windowrulev2 = animation slide top, class:^(ulauncher)$ - # browsers - windowrulev2 = plugin:scroller:columnwidth onehalf, class:(firefox) - windowrulev2 = plugin:scroller:columnwidth onehalf, class:(zen) - windowrulev2 = plugin:scroller:columnwidth onehalf, class:(brave) - ''; - }; - - services = { - # swaync = { - # enable = true; - # settings = { - # positionX = "left"; - # positionY = "top"; - # layer = "overlay"; - # control-center-layer = "top"; - # layer-shell = true; - # cssPriority = "application"; - # control-center-margin-top = 20; - # control-center-margin-bottom = 20; - # control-center-margin-right = 20; - # control-center-margin-left = 20; - # notification-2fa-action = true; - # notification-inline-replies = false; - # notification-icon-size = 64; - # notification-body-image-height = 100; - # notification-body-image-width = 200; - # timeout = 10; - # timeout-low = 5; - # timeout-critical = 0; - # fit-to-screen = true; - # relative-timestamps = true; - # control-center-width = 500; - # control-center-height = 600; - # notification-window-width = 500; - # keyboard-shortcuts = true; - # image-visibility = "when-available"; - # transition-time = 200; - # hide-on-clear = false; - # hide-on-action = true; - # script-fail-notify = true; - # widgets = [ - # "inhibitors" - # "title" - # "dnd" - # "notifications" - # "mpris" - # ]; - # widget-config = { - # inhibitors = { - # text = "Inhibitors"; - # button-text = "Clear All"; - # clear-all-button = true; - # }; - # title = { - # text = "Notifications"; - # clear-all-button = true; - # button-text = "Clear All"; - # }; - # dnd = { - # text = "Do Not Disturb"; - # }; - # mpris = { - # image-size = 96; - # image-radius = 12; - # }; - # }; - # }; - # }; - # clipman.enable = true; - }; - - # programs = { - # hyprlock.enable = true; - # }; - - home.packages = with pkgs; [ - brightnessctl - ghostty - hyprnome - playerctl - swaynotificationcenter - syshud - ulauncher - waybar - # inputs.mithril.packages.${pkgs.system}.mithril-control-center - ]; -} diff --git a/users/modules/user/programs.nix b/users/modules/user/programs.nix index 2d4ae45..4bc7f2d 100644 --- a/users/modules/user/programs.nix +++ b/users/modules/user/programs.nix @@ -111,10 +111,6 @@ (lib.mkIf hostType.isWorkstation { fonts.fontconfig.enable = true; - home.packages = with pkgs; [ - rmenu - ]; - programs = { password-store.package = pkgs.pass-wayland; @@ -137,46 +133,6 @@ }; }; }; - - gtk = { - gtk3.extraConfig = { - gtk-decoration-layout = "appmenu:"; - }; - gtk4.extraConfig = { - gtk-decoration-layout = "appmenu:"; - }; - }; - - # systemd.user.services.ulauncher = { - # Unit = { - # Description = "Ulauncher Application Launcher"; - # After = [ "graphical-session.target" ]; - # }; - # Service = { - # Type = "simple"; - # Environment = - # let - # pydeps = pkgs.python3.withPackages ( - # pp: with pp; [ - # # dependencies for ulauncher-albert-calculate-anything - # parsedatetime - # pint - # pytz - # requests - # simpleeval - # ] - # ); - # in - # [ - # "PYTHONPATH=${pydeps}/${pydeps.sitePackages}" - # ]; - # ExecStart = pkgs.writeShellScript "ulauncher-env-wrapper.sh" '' - # export PATH="''${XDG_BIN_HOME}:$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin" - # export GDK_BACKEND=wayland - # exec ${pkgs.ulauncher}/bin/ulauncher --hide-window - # ''; - # }; - # }; }) ]; }