From 48b35271c7f0d40a9ebd95211d47d08c98e9952d Mon Sep 17 00:00:00 2001 From: Jacob Bachmann Date: Sun, 5 May 2024 13:53:54 +0200 Subject: [PATCH] feat: remove hyprland --- flake.nix | 19 -- modules/default.nix | 2 +- modules/desktop.nix | 1 - modules/xdg-portal.nix | 2 +- users/gandalf/default.nix | 2 - users/gandalf/modules/gui/ags/default.nix | 16 - users/gandalf/modules/gui/default.nix | 3 - .../gandalf/modules/gui/hyprland/default.nix | 259 -------------- users/gandalf/modules/gui/waybar.nix | 318 +----------------- 9 files changed, 3 insertions(+), 619 deletions(-) delete mode 100644 users/gandalf/modules/gui/ags/default.nix delete mode 100644 users/gandalf/modules/gui/hyprland/default.nix diff --git a/flake.nix b/flake.nix index 8cf9839..d697c4e 100644 --- a/flake.nix +++ b/flake.nix @@ -9,19 +9,6 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - - hyprland = { - url = "github:hyprwm/Hyprland?ref=v0.39.0"; - }; - hy3 = { - url = "github:outfoxxed/hy3"; - inputs.hyprland.follows = "hyprland"; - }; - - waybar.url = "github:Alexays/Waybar"; - - ags.url = "github:Aylur/ags"; - }; outputs = { self, nixpkgs, ... }@inputs: { nixosConfigurations = { @@ -30,8 +17,6 @@ specialArgs = inputs; modules = [ - inputs.hyprland.nixosModules.default - ./modules ./hosts/W530 @@ -48,8 +33,6 @@ specialArgs = inputs; modules = [ - inputs.hyprland.nixosModules.default - ./modules ./hosts/T430 @@ -66,8 +49,6 @@ specialArgs = inputs; modules = [ - inputs.hyprland.nixosModules.default - ./modules ./hosts/IROH diff --git a/modules/default.nix b/modules/default.nix index 69c1fa1..fe401e4 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -11,7 +11,7 @@ flavour = mkOption { type = types.listOf types.str; default = [ "sway" ]; - example = [ "sway" "i3" "Hyprland" ]; + example = [ "sway" "i3" ]; description = '' The flavour (WM) for your system to use ''; diff --git a/modules/desktop.nix b/modules/desktop.nix index 1e1c381..9288008 100644 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -3,7 +3,6 @@ environment.pathsToLink = [ "/libexec" ]; # links /libexec from derivations to /run/current-system/sw programs.sway.enable = builtins.elem "sway" gui.flavour; - programs.hyprland.enable = builtins.elem "Hyprland" gui.flavour; services.xserver.windowManager.i3.enable = builtins.elem "i3" gui.flavour; services.xserver = { diff --git a/modules/xdg-portal.nix b/modules/xdg-portal.nix index 4438990..3fde11c 100644 --- a/modules/xdg-portal.nix +++ b/modules/xdg-portal.nix @@ -3,7 +3,7 @@ enable = true; wlr.enable = true; config.common.default = "*"; - extraPortals = with lib; with config.bchmnn; optionals (elem "sway" gui.flavour || elem "Hyprland" gui.flavour) [ + extraPortals = with lib; with config.bchmnn; optionals (elem "sway" gui.flavour) [ pkgs.xdg-desktop-portal-wlr ]; }; diff --git a/users/gandalf/default.nix b/users/gandalf/default.nix index 5dfe91e..1628be9 100644 --- a/users/gandalf/default.nix +++ b/users/gandalf/default.nix @@ -16,8 +16,6 @@ in home-manager.users.gandalf = { pkgs, ... }: { imports = [ - inputs.hyprland.homeManagerModules.default - inputs.ags.homeManagerModules.default ./modules ]; diff --git a/users/gandalf/modules/gui/ags/default.nix b/users/gandalf/modules/gui/ags/default.nix deleted file mode 100644 index c4f7156..0000000 --- a/users/gandalf/modules/gui/ags/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, ... }: { - - programs.ags = { - enable = true; - - # null or path, leave as null if you don't want hm to manage the config - # configDir = ../ags; - - # additional packages to add to gjs's runtime - extraPackages = with pkgs; [ - gtksourceview - webkitgtk - ]; - }; - -} diff --git a/users/gandalf/modules/gui/default.nix b/users/gandalf/modules/gui/default.nix index 2aaf76e..ee474bc 100644 --- a/users/gandalf/modules/gui/default.nix +++ b/users/gandalf/modules/gui/default.nix @@ -2,14 +2,11 @@ imports = with lib; with nixosConfig.bchmnn; optionals gui.enable [ - ./ags ./cursor.nix ./gtk.nix ./programs ] ++ optionals (gui.enable && elem "sway" gui.flavour) [ ./sway - ] ++ optionals (gui.enable && elem "Hyprland" gui.flavour) [ - ./hyprland ] ++ optionals (gui.enable && elem "i3" gui.flavour) [ ./i3 ]; diff --git a/users/gandalf/modules/gui/hyprland/default.nix b/users/gandalf/modules/gui/hyprland/default.nix deleted file mode 100644 index 7c90131..0000000 --- a/users/gandalf/modules/gui/hyprland/default.nix +++ /dev/null @@ -1,259 +0,0 @@ -{ pkgs, lib, nixosConfig, config, inputs, ... }: -let - common = (import ../common.nix) { pkgs = pkgs; lib = lib; }; - - dropterm = rec { - class = "alacritty-dropterm"; - name = "toggle-${class}"; - package = pkgs.writeShellScriptBin name '' - TOGGLE=/tmp/${class} - WINDOW=$(${pkgs.hyprland}/bin/hyprctl -j clients | ${pkgs.jq}/bin/jq 'any(.[]; .class == "${class}")') - if [ -f "$TOGGLE" ]; then - if [ $WINDOW == "true" ]; then - ${pkgs.hyprland}/bin/hyprctl --batch \ - "dispatch movewindowpixel 0 -700,${class}; dispatch pin ${class}; dispatch cyclenext" - rm $TOGGLE - else - ${pkgs.alacritty}/bin/alacritty --class=${class} & disown - fi - else - if [ $WINDOW == "true" ]; then - ${pkgs.hyprland}/bin/hyprctl --batch \ - "dispatch movewindowpixel 0 700,${class}; dispatch pin ${class}; dispatch focuswindow ${class}" - else - ${pkgs.alacritty}/bin/alacritty --class=${class} & disown - fi - touch $TOGGLE - fi - ''; - bin = "${package}/bin/${name}"; - }; - -in -{ - imports = [ - ../sway/wofi.nix - ../waybar.nix - ]; - - home.packages = with pkgs; [ - brightnessctl # this program allows you read and control device brightness - pavucontrol # pulseaudio volume control - playerctl # command-line utility and library for controlling media players that implement mpris - networkmanagerapplet # networkmanager control applet for gnome - udiskie # removable disk automounter for udisks - dracula-theme # dracula variant of the ant theme - gnome3.adwaita-icon-theme - wl-clipboard # command-line copy/paste utilities for wayland - sway-contrib.grimshot # a helper for screenshots within sway - wdisplays # a graphical application for configuring displays in wayland compositors - wlr-randr # an xrandr clone for wlroots compositors - kanshi # dynamic display configuration tool - nextcloud-client # nextcloud themed desktop client - libsForQt5.kdeconnect-kde # kde connect provides several features to integrate your phone and your computer - system-config-printer # graphical user interface for cups administration - emote # modern emoji picker for linux - ]; - - programs.swaylock = { - enable = true; - # package = pkgs.swaylock-effects; - }; - - wayland.windowManager.hyprland = { - enable = true; - plugins = [ inputs.hy3.packages.x86_64-linux.hy3 ]; - settings = { - debug = { - disable_logs = false; - }; - env = with lib; with nixosConfig.bchmnn; [ - - # "HYPRCURSOR_THEME,hypr-macOS-Monterey" - # "HYPRCURSOR_SIZE,32" - - "XCURSOR_THEME,macOS-Monterey" - "XCURSOR_SIZE,32" - - "CLUTTER_BACKEND,wayland" - "GDK_BACKEND,wayland" - "GDK_DPI_SCALE,1" - "NIXOS_OZONE_WL,1" - "MOZ_ENABLE_WAYLAND,1" - "MOZ_USE_XINPUT2,1" - "XDG_SESSION_TYPE,wayland" - - # sdl - "SDL_VIDEODRIVER,wayland" - - # qt - "QT_QPA_PLATFORM,wayland-egl" - "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" - - # java - "_JAVA_AWT_WM_NONREPARENTING,1" - "_JAVA_OPTIONS,\"-Dawt.useSystemAAFontSettings=on\"" - ] ++ optionals nvidia.enable [ - # nvidia - "LIBVA_DRIVER_NAME,nvidia" - # following causes Hyprland to crash on startup with 535 drivers - # "GBM_BACKEND,nvidia-drm" - "__GLX_VENDOR_LIBRARY_NAME,nvidia" - "WLR_NO_HARDWARE_CURSORS,1" - ]; - "exec-once" = with pkgs; [ - "${config.programs.waybar.package}/bin/waybar -c ${config.xdg.configHome}/waybar/hyprbar.json -s ${config.xdg.configHome}/waybar/hyprbar.css" - "${swaybg}/bin/swaybg -m fill -i ${common.wallpaper.default}" - "${dbus}/bin/dbus-update-activation-environment --all" - "${kanshi}/bin/kanshi" - "${networkmanagerapplet}/bin/nm-applet" - "${blueman}/bin/blueman-applet" - "${udiskie}/bin/udiskie --tray" - "${swaynotificationcenter}/bin/swaync" - "${nextcloud-client}/bin/nextcloud" - "${plasma5Packages.kdeconnect-kde}/bin/kdeconnect-indicator" - "${system-config-printer}/bin/system-config-printer-applet" - "${emote}/bin/emote" - ]; - input = { - accel_profile = "flat"; - touchpad = { - natural_scroll = "true"; - scroll_factor = "0.5"; - }; - }; - general = { - layout = "hy3"; - border_size = "2"; - gaps_out = "5"; - gaps_in = "5"; - }; - decoration = { - rounding = "10"; - drop_shadow = "true"; - shadow_range = "25"; - shadow_render_power = "1"; # int [1-4] - shadow_offset = "0 5"; # vec2 [0, 0] - # shadow_scale = "0.8"; # float [0.0-1.0] - # col.shadow = rgba(1a1a1aee) - "col.shadow" = "rgba(1a1a1a2f)"; - }; - plugin = { - hy3 = { - tabs = { - height = 20; - text_font = common.font; - text_height = 12; - "col.active" = "0xffffdeeb"; # common.colorschemes.default.active; - "col.urgent" = "0xffc92a2a"; # common.colorschemes.default.alert; - "col.inactive" = "0xff212529"; # common.colorschemes.default.inactiveDark; - "col.text.active" = "0xff000000"; # common.colorschemes.default.black; - "col.text.urgent" = "0xffffffff"; # common.colorschemes.default.white; - "col.text.inactive" = "0xffffffff"; # common.colorschemes.default.white; - }; - }; - }; - "$terminal" = "${pkgs.alacritty}/bin/alacritty"; - "$fileManager" = "${pkgs.gnome.nautilus}/bin/nautilus"; - "$menu" = "${pkgs.wofi}/bin/wofi"; - "$mod" = "SUPER"; - windowrule = [ - "float, ${dropterm.class}" - "size 96% 33%, ${dropterm.class}" - "move 2% 50, ${dropterm.class}" - ]; - bind = [ - "$mod, grave, exec, ${dropterm.bin}" - "$mod, escape, exec, ${dropterm.bin}" - "$mod, Q, killactive," - "$mod, return, exec, $terminal" - "$mod SHIFT, Q, exit," - "$mod SHIFT, E, exec, $fileManager" - "$mod, F, fullscreen," - "$mod, D, togglefloating," - "$mod, space, exec, $menu" - "$mod CONTROL SHIFT, L, exec, ${pkgs.swaylock-effects}/bin/swaylock --screenshots --clock --indicator --indicator-radius 100 --indicator-thickness 7 --effect-blur 7x5 --effect-vignette 0.5:0.5 --ring-color ffffff --key-hl-color ${common.colorschemes.default._activeDark} --line-color 00000000 --inside-color 00000088 --inside-ver-color ${common.colorschemes.default._activeDark} --separator-color 00000000 --text-color ${common.colorschemes.default._activeDark} --fade-in 0.1" - "$mod SHIFT, V, exec, ${pkgs.pavucontrol}/bin/pavucontrol" - "$mod SHIFT, B, exec, ${pkgs.blueman}/bin/blueman-manager" - "$mod SHIFT, N, exec, ${pkgs.networkmanagerapplet}/bin/nm-connection-editor" - "$mod SHIFT, A, exec, ${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw" - "$mod, period, exec, ${pkgs.emote}/bin/emote" - - # Move focus - "$mod, H, hy3:movefocus, l" - "$mod, L, hy3:movefocus, r" - "$mod, K, hy3:movefocus, u" - "$mod, J, hy3:movefocus, d" - - "$mod, P, focusmonitor, l" - "$mod, N, focusmonitor, r" - - # Move windows - "$mod SHIFT, H, hy3:movewindow, l" - "$mod SHIFT, J, hy3:movewindow, d" - "$mod SHIFT, K, hy3:movewindow, u" - "$mod SHIFT, L, hy3:movewindow, r" - - # Switch workspaces - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - "$mod, 6, workspace, 6" - "$mod, 7, workspace, 7" - "$mod, 8, workspace, 8" - "$mod, 9, workspace, 9" - "$mod, 0, workspace, 10" - - # Move active window to a workspace - "$mod SHIFT, 1, movetoworkspace, 1" - "$mod SHIFT, 2, movetoworkspace, 2" - "$mod SHIFT, 3, movetoworkspace, 3" - "$mod SHIFT, 4, movetoworkspace, 4" - "$mod SHIFT, 5, movetoworkspace, 5" - "$mod SHIFT, 6, movetoworkspace, 6" - "$mod SHIFT, 7, movetoworkspace, 7" - "$mod SHIFT, 8, movetoworkspace, 8" - "$mod SHIFT, 9, movetoworkspace, 9" - "$mod SHIFT, 0, movetoworkspace, 10" - - "$mod CONTROL, J, workspace, -1" - "$mod CONTROL, K, workspace, +1" - - "$mod CONTROL SHIFT, J, movecurrentworkspacetomonitor, l" - "$mod CONTROL SHIFT, K, movecurrentworkspacetomonitor, r" - - "$mod, W, hy3:changegroup, toggletab" - - "$mod, B, hy3:makegroup, h" - "$mod, V, hy3:makegroup, v" - - ", print, exec, ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area" - ]; - binde = [ - ", XF86AudioRaiseVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" - ", XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-" - ", XF86AudioMute, exec, ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - ", XF86AudioMicMute, exec, ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" - ", XF86MonBrightnessDown, exec, ${pkgs.brightnessctl}/bin/brightnessctl -q set 5%-" - ", XF86MonBrightnessUp, exec, ${pkgs.brightnessctl}/bin/brightnessctl -q set 5%+" - ", XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl previous" - ", XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next" - ", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause" - ", XF86AudioPause, exec, ${pkgs.playerctl}/bin/playerctl play-pause" - ]; - bindm = [ - # mouse movements - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - "$mod ALT, mouse:272, resizewindow" - ]; - }; - systemd = { - enable = true; - # extraCommands = [] - }; - xwayland.enable = true; - }; -} diff --git a/users/gandalf/modules/gui/waybar.nix b/users/gandalf/modules/gui/waybar.nix index 0c3bb9e..14be895 100644 --- a/users/gandalf/modules/gui/waybar.nix +++ b/users/gandalf/modules/gui/waybar.nix @@ -1,4 +1,4 @@ -{ pkgs, inputs, ... }: +{ pkgs, ... }: let check-battery = pkgs.writeShellScript "check-battery" '' bat=/sys/class/power_supply/BAT0 @@ -346,325 +346,9 @@ in } } ''; - - "waybar/hyprbar.json".text = '' - [ - { - "backlight": { - "device": "intel_backlight", - "format": "{percent}% {icon}", - "format-icons": [ - "󰌶", - "󱩎", - "󱩏", - "󱩐", - "󱩑", - "󱩒", - "󱩓", - "󱩔", - "󱩕", - "󱩖", - "󰛨" - ] - }, - "battery": { - "format": "{capacity}% {icon}", - "format-alt": "{time} {icon}", - "format-charging": "{capacity}% 󰂄", - "format-icons": [ - "󰂃", - "󰁺", - "󰁻", - "󰁼", - "󰁽", - "󰁾", - "󰁿", - "󰂀", - "󰂁", - "󰂂", - "󰁹" - ], - "format-plugged": "{capacity}% ", - "on-update": "${check-battery}", - "states": { - "critical": 15, - "warning": 30 - } - }, - "clock": { - "format": "{:%a %b %d %H:%M}", - "timezones": [ - "Europe/Berlin" - ], - "tooltip-format": "{:%Y %B}\n{calendar}" - }, - "custom/mem": { - "exec": "free -h | awk '/Mem:/{printf $3}'", - "format": "{} 󰍛", - "interval": 3, - "tooltip": false - }, - "hyprland/window": { - "format": "{title}", - "separate-outputs": true - }, - "hyprland/workspaces": { - "disable-scroll": true, - "persistent-workspaces": { - "1": [], - "10": [], - "2": [], - "3": [], - "4": [], - "5": [], - "6": [], - "7": [], - "8": [], - "9": [] - } - }, - "layer": "top", - "margin": "5 5 5 5", - "modules-center": [], - "modules-left": [ - "hyprland/workspaces", - "hyprland/window" - ], - "modules-right": [ - "tray", - "network", - "pulseaudio", - "custom/mem", - "temperature", - "backlight", - "battery", - "clock" - ], - "name": "hyprbar", - "network": { - "format": "{ifname}", - "format-disconnected": "󰈂", - "format-ethernet": "eth 󰈁", - "format-wifi": "{signalStrength}% ", - "interval": 1, - "tooltip-format": "{ifname} via {gwaddr} 󰈁", - "tooltip-format-disconnected": "Disconnected", - "tooltip-format-ethernet": "{ifname} ", - "tooltip-format-wifi": "{essid} ({signalStrength}%) " - }, - "pulseaudio": { - "format": "{volume}% {icon} {format_source}", - "format-bluetooth": "{volume}% {icon} {format_source}", - "format-bluetooth-muted": "󰖁 {icon} {format_source}", - "format-icons": { - "car": "", - "default": [ - "󰕿", - "󰖀", - "󰕾" - ], - "hands-free": "󰋎", - "headphone": "", - "headset": "󰋎", - "phone": "", - "portable": "" - }, - "format-muted": "󰖁 {format_source}", - "format-source": "{volume}% ", - "format-source-muted": "", - "min-length": 13, - "on-click": "${pkgs.pavucontrol}/bin/pavucontrol", - "reverse-scrolling": 1 - }, - "temperature": { - "critical-threshold": 80, - "format": "{temperatureC}°C {icon}", - "format-icons": [ - "", - "", - "", - "", - "" - ], - "tooltip": false - }, - "tray": { - "icon-size": 16, - "show-passive-items": true, - "spacing": 4 - } - } - ] - ''; - - "waybar/hyprbar.css".text = '' - window.hyprbar, - window.hyprbar * { - border: none; - border-radius: 10px; - font-family: DejaVuSansM Nerd Font; - min-height: 20px; - } - - window.hyprbar#waybar { - background: #ffffff; - } - - window.hyprbar#waybar.hidden { - opacity: 0.2; - } - - window.hyprbar #workspaces { - padding-left: 8px; - padding-right: 8px; - margin-right: 8px; - transition: none; - } - - window.hyprbar #workspaces button { - transition: none; - color: black; - background: transparent; - padding: 5px; - font-size: 18px; - border-radius: 0px; - } - - window.hyprbar #workspaces button.empty { - color: #7c818c; - } - - window.hyprbar #workspaces button.persistent { - font-size: 12px; - } - - window.hyprbar #workspaces button.visible { - color: black; - font-size: 18px; - } - - window.hyprbar #workspaces button.visible.hosting-monitor { - background: lightgray; - } - - window.hyprbar #workspaces button:hover { - color: white; - background: black; - } - - window.hyprbar #window { - padding-left: 16px; - padding-right: 16px; - transition: none; - color: black; - background: transparent; - } - - window.hyprbar #tray { - margin-right: 10px; - padding-left: 10px; - padding-right: 10px; - transition: none; - color: white; - background: rgb(66, 118, 185); - } - - window.hyprbar #network { - padding-left: 10px; - padding-right: 10px; - transition: none; - color: black; - background: transparent; - } - - window.hyprbar #pulseaudio { - padding-left: 10px; - padding-right: 10px; - transition: none; - color: black; - background: transparent; - } - - window.hyprbar #pulseaudio.muted { - color: gray; - } - - window.hyprbar #custom-mem { - padding-left: 10px; - padding-right: 10px; - transition: none; - color: black; - background: transparent; - } - - window.hyprbar #temperature { - padding-left: 10px; - padding-right: 10px; - transition: none; - color: black; - background: transparent; - } - - window.hyprbar #temperature.critical { - background-color: #eb4d4b; - } - - window.hyprbar #backlight { - padding-left: 10px; - padding-right: 10px; - transition: none; - color: black; - background: transparent; - } - - window.hyprbar #battery { - padding-left: 10px; - padding-right: 10px; - transition: none; - color: black; - background: transparent; - } - - window.hyprbar #battery.charging { - color: #ffffff; - background-color: #26a65b; - } - - window.hyprbar #battery.warning:not(.charging) { - background-color: #ffbe61; - color: black; - } - - window.hyprbar #battery.critical:not(.charging) { - background-color: #f53c3c; - color: #ffffff; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } - - window.hyprbar #clock { - padding-left: 10px; - padding-right: 16px; - transition: none; - color: black; - background: transparent; - } - - @keyframes blink { - to { - background-color: #ffffff; - color: #000000; - } - } - ''; }; programs.waybar = { enable = true; - # TODO replace with (un-)stable channel version once available - package = inputs.waybar.packages.x86_64-linux.default; }; }