diff --git a/flake.nix b/flake.nix index 26ca53b..357178a 100644 --- a/flake.nix +++ b/flake.nix @@ -52,7 +52,7 @@ home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; - home-manager.extraSpecialArgs = { inherit inputs nix-colors; }; + home-manager.extraSpecialArgs = { inherit inputs nix-colors ;hostName = "xv-laptop"; }; home-manager.users.xeovalyte.imports = [ ./hosts/laptop/home.nix ]; } ]; @@ -69,7 +69,7 @@ home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; - home-manager.extraSpecialArgs = { inherit inputs nix-colors; }; + home-manager.extraSpecialArgs = { inherit inputs nix-colors; hostName = "xv-desktop"; }; home-manager.users.xeovalyte.imports = [ ./hosts/desktop/home.nix ]; } ]; diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index acbd0bd..903265a 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -3,15 +3,15 @@ { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - #../../modules/system/desktop/hyprland.nix - ../../modules/system/desktop/plasma.nix + ../../modules/system/desktop/hyprland.nix + #../../modules/system/desktop/plasma.nix ../../modules/system/desktop/nvidia.nix ../../modules/system/programs/sunshine.nix #../../modules/system/programs/syncthing.nix ../../modules/system/programs/thunar.nix ../../modules/system/utils/common.nix ../../modules/system/utils/firewall.nix - ../../modules/system/utils/fprint.nix + #../../modules/system/utils/fprint.nix ../../modules/system/utils/garbage-collection.nix ../../modules/system/utils/locale.nix ]; diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix index e220a59..6f5ca35 100644 --- a/hosts/desktop/home.nix +++ b/hosts/desktop/home.nix @@ -2,7 +2,7 @@ { imports = [ - #../../modules/home/desktop/hyprland + ../../modules/home/desktop/hyprland ../../modules/home/programs/common.nix ../../modules/home/programs/firefox.nix ../../modules/home/programs/kitty.nix @@ -27,5 +27,12 @@ unstable.arduino-ide ]; + home.sessionVariables = { + LIBVA_DRIVER_NAME = "nvidia"; + XDG_SESSION_TYPE = "wayland"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + WLR_NO_HARDWARE_CURSORS = 1; + }; + home.stateVersion = "23.11"; } diff --git a/modules/home/desktop/hyprland/default.nix b/modules/home/desktop/hyprland/default.nix index 5e9c797..d1dbc66 100644 --- a/modules/home/desktop/hyprland/default.nix +++ b/modules/home/desktop/hyprland/default.nix @@ -1,12 +1,12 @@ -{ pkgs, ... }: +{ config, pkgs, lib, hostName, ... }: { imports = [ ./waybar.nix ./hyprpaper.nix ./hyprlock.nix - ./hypridle.nix ./fixes.nix + ./hypridle.nix ]; home.packages = with pkgs; [ @@ -24,9 +24,8 @@ wayland.windowManager.hyprland = { enable = true; - # package = pkgs.unstable.hyprland; settings = { - monitor = ",preferred,auto,1.566667"; + monitor = if hostName == "xv-laptop" then ",preferred,auto,1.566667" else ",preferred,auto,auto"; exec-once = [ "waybar" @@ -75,6 +74,19 @@ force_zero_scaling = true; }; + workspace = if hostName == "xv-desktop" then [ + "1, monitor:DP-2" + "2, monitor:DP-2" + "3, monitor:DP-2" + "4, monitor:DP-2" + "5, monitor:DP-2" + "6, monitor:HDMI-A-1" + "7, monitor:HDMI-A-1" + "8, monitor:HDMI-A-1" + "9, monitor:HDMI-A-1" + "10, monitor:HDMI-A-1" + ] else [ ]; + bind = [ "$mod, Q, exec, kitty" "$mod, SPACE, exec, rofi -show drun" @@ -111,6 +123,8 @@ "$mod, 6, workspace, 6" "$mod, 7, workspace, 7" "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" "$mod SHIFT, 1, movetoworkspace, 1" "$mod SHIFT, 2, movetoworkspace, 2" @@ -120,7 +134,15 @@ "$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" + ] ++ (if hostName == "xv-desktop" then [ + ",code:194,workspace, 6" + ",code:195,workspace, 7" + ",code:196,workspace, 8" + ",code:197,workspace, 9" + ",code:198,workspace, 10" + ] else [ ]); bindle = [ # Volume control diff --git a/modules/home/desktop/hyprland/fixes.nix b/modules/home/desktop/hyprland/fixes.nix index 4df5bdf..8b5c095 100644 --- a/modules/home/desktop/hyprland/fixes.nix +++ b/modules/home/desktop/hyprland/fixes.nix @@ -15,8 +15,5 @@ programs.bash = { enable = true; - #sessionVariables = { - # NIXOS_OZONE_WL = "1"; - #}; }; } diff --git a/modules/home/desktop/hyprland/hypridle.nix b/modules/home/desktop/hyprland/hypridle.nix index ce9822c..b1e1707 100644 --- a/modules/home/desktop/hyprland/hypridle.nix +++ b/modules/home/desktop/hyprland/hypridle.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, ... }: +{ inputs, pkgs, lib, hostName, ... }: { imports = [ @@ -6,7 +6,7 @@ ]; services.hypridle = { - enable = true; + enable = if hostName == "xv-laptop" then true else false; lockCmd = "pidof ${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock || ${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock"; # avoid starting multiple hyprlock instances. beforeSleepCmd = "${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock"; # lock before suspend. afterSleepCmd = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display. diff --git a/modules/home/desktop/hyprland/hyprpaper.nix b/modules/home/desktop/hyprland/hyprpaper.nix index 47c09f3..8a95ce3 100644 --- a/modules/home/desktop/hyprland/hyprpaper.nix +++ b/modules/home/desktop/hyprland/hyprpaper.nix @@ -5,15 +5,15 @@ hyprpaper ]; + # https://wallhaven.cc/w/4veopp + home.file.".config/hypr/hyprpaper.conf" = { enable = true; executable = false; text ='' preload = ~/Pictures/wallpaper.png - preload = ~/Pictures/wallpaper-1.png - preload = ~/Pictures/wallpaper-2.png - wallpaper = eDP-1,~/Pictures/wallpaper-2.png + wallpaper = ,~/Pictures/wallpaper.png ipc = off ''; }; diff --git a/modules/home/desktop/hyprland/waybar.nix b/modules/home/desktop/hyprland/waybar.nix index 5b39f24..c80cb21 100644 --- a/modules/home/desktop/hyprland/waybar.nix +++ b/modules/home/desktop/hyprland/waybar.nix @@ -1,4 +1,4 @@ -{ ... }: +{ hostName, ... }: { programs.waybar = { @@ -28,7 +28,7 @@ "on-scroll-up" = "hyprctl dispatch workspace e+1"; "on-scroll-down" = "hyprctl dispatch workspace e-1"; "on-click" = "activate"; - "persistent-workspaces" = { + "persistent-workspaces" = if hostName == "xv-laptop" then { "1" = []; "2" = []; "3" = []; @@ -37,6 +37,17 @@ "6" = []; "7" = []; "8" = []; + } else { + "1" = [ "DP-2" ]; + "2" = [ "DP-2" ]; + "3" = [ "DP-2" ]; + "4" = [ "DP-2" ]; + "5" = [ "DP-2" ]; + "6" = [ "HDMI-A-1" ]; + "7" = [ "HDMI-A-1" ]; + "8" = [ "HDMI-A-1" ]; + "9" = [ "HDMI-A-1" ]; + "10" = [ "HDMI-A-1" ]; }; "format-icons" = { "default" = ""; diff --git a/modules/system/utils/firewall.nix b/modules/system/utils/firewall.nix index 7bf3355..1c04ccc 100644 --- a/modules/system/utils/firewall.nix +++ b/modules/system/utils/firewall.nix @@ -3,5 +3,7 @@ { networking.firewall = { enable = true; + allowedTCPPorts = [ 53317 ]; + allowedUDPPorts = [ 53317 ]; }; }