From f79245c06f6e8778e0b25631cf5871cb1d5403b4 Mon Sep 17 00:00:00 2001 From: LarsZauberer Date: Wed, 17 Apr 2024 10:45:18 +0200 Subject: [PATCH 1/5] Try to fix screenshots --- hosts/lars/hyprland.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hosts/lars/hyprland.nix b/hosts/lars/hyprland.nix index 1299063..5d80b16 100644 --- a/hosts/lars/hyprland.nix +++ b/hosts/lars/hyprland.nix @@ -120,7 +120,8 @@ in { "$mod, F, fullscreen" # Screenshot - "$mod SHIFT, s, exec, grim -g '$(slurp -d)' - | wl-copy" + "$mod SHIFT, s, exec, grim -g \"$(slurp -d)\" - | wl-copy" + ] ++ ( builtins.concatLists (builtins.genList ( @@ -136,6 +137,11 @@ in { ) 10) ); + # Mouse movement + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; } cfg.extra]; }; }; From 20134352b3a54ea1b5dc93eb895ce627de26adf0 Mon Sep 17 00:00:00 2001 From: LarsZauberer Date: Wed, 17 Apr 2024 15:56:38 +0200 Subject: [PATCH 2/5] Added firefox extensions --- hosts/lars/default.nix | 8 +++++++ modules/gui/firefox.nix | 46 +++++++++++++++++++++-------------------- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/hosts/lars/default.nix b/hosts/lars/default.nix index 448437f..39987bb 100644 --- a/hosts/lars/default.nix +++ b/hosts/lars/default.nix @@ -61,6 +61,14 @@ install_url = "https://addons.mozilla.org/firefox/downloads/file/4231522/new_tab_override-16.0.0.xpi"; installation_mode = "force_installed"; }; + "keepassxc-browser@keepassxc.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/4257616/keepassxc_browser-1.9.0.3.xpi"; + installation_mode = "force_installed"; + }; + "{7be2ba16-0f1e-4d93-9ebc-5164397477a9}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/3756025/videospeed-0.6.3.3.xpi"; + installation_mode = "force_installed"; + }; }; }; diff --git a/modules/gui/firefox.nix b/modules/gui/firefox.nix index 07704ca..b948b0b 100644 --- a/modules/gui/firefox.nix +++ b/modules/gui/firefox.nix @@ -18,7 +18,7 @@ in { enable = true; policies = { - DisableTelemetry = true; + DisableTelemetry = true; DisableFirefoxStudies = true; EnableTrackingProtection = { Value= true; @@ -36,28 +36,30 @@ in { DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab" DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" SearchBar = "unified"; # alternative: "separate" - FirefoxSuggest = { - WebSuggestions = true; - ImproveSuggest = true; - Locked = true; - }; - SearchSuggestEnabled = true; - theme = { - colors = { - background-darker = "181825"; - background = "1e1e2e"; - foreground = "cdd6f4"; - }; - }; + FirefoxSuggest = { + WebSuggestions = true; + ImproveSuggest = true; + Locked = true; + }; + SearchSuggestEnabled = true; + theme = { + colors = { + background-darker = "181825"; + background = "1e1e2e"; + foreground = "cdd6f4"; + }; + }; - font = "Lexend"; - ExtensionSettings = lib.mkMerge [{ - "uBlock0@raymondhill.net" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; - installation_mode = "force_installed"; - }; - } cfg.extensions]; - }; + OfferToSaveLogins = false; + + font = "Lexend"; + ExtensionSettings = lib.mkMerge [{ + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + }; + } cfg.extensions]; + }; }; }; }; From 30228f1da668cd9eece2de736b449b499bc583b5 Mon Sep 17 00:00:00 2001 From: LarsZauberer Date: Wed, 17 Apr 2024 15:56:45 +0200 Subject: [PATCH 3/5] Added steam --- hosts/lars/hyprland.nix | 4 ++++ hosts/lars/kronos/configuration.nix | 5 +++++ modules/gui/default.nix | 1 + modules/gui/steam.nix | 22 ++++++++++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 modules/gui/steam.nix diff --git a/hosts/lars/hyprland.nix b/hosts/lars/hyprland.nix index 63cfa79..5353ff2 100644 --- a/hosts/lars/hyprland.nix +++ b/hosts/lars/hyprland.nix @@ -120,6 +120,10 @@ in { "$mod, down, movefocus, d" "$mod, F, fullscreen" + # Special Workspaces + "$mod SHIFT, F, movetoworkspacesilent, special" + "$mod, s, togglespecialworkspace," + # Screenshot "$mod SHIFT, s, exec, grim -g \"$(slurp -d)\" - | wl-copy" diff --git a/hosts/lars/kronos/configuration.nix b/hosts/lars/kronos/configuration.nix index be46c8a..01cc83c 100644 --- a/hosts/lars/kronos/configuration.nix +++ b/hosts/lars/kronos/configuration.nix @@ -13,6 +13,11 @@ opacity = 0.8; blur = true; }; + + steam = { + enable = true; + gamescope = true; + }; }; hyprland = { diff --git a/modules/gui/default.nix b/modules/gui/default.nix index 95868e4..d950bdf 100644 --- a/modules/gui/default.nix +++ b/modules/gui/default.nix @@ -13,5 +13,6 @@ _: { ./WM ./alacritty.nix ./firefox.nix + ./steam.nix ]; } diff --git a/modules/gui/steam.nix b/modules/gui/steam.nix new file mode 100644 index 0000000..ca600f2 --- /dev/null +++ b/modules/gui/steam.nix @@ -0,0 +1,22 @@ + +{ config, lib, inputs, pkgs, ... }: +with lib; let + username = config.modules.other.system.username; + cfg = config.modules.programs.steam; +in { + options.modules.programs.steam = { + enable = mkEnableOption "steam"; + gamescope = mkEnableOption "gamescope"; + }; + + config = mkIf cfg.enable { + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + gamescopeSession.enable = mkIf cfg.gamescope true; + }; + home-manager.users.${username} = { + }; + }; +} From 5210acff88a524169fb676b587a7a7cd526434a1 Mon Sep 17 00:00:00 2001 From: LarsZauberer Date: Wed, 17 Apr 2024 23:09:58 +0200 Subject: [PATCH 4/5] Autostart and some extra programs --- hosts/lars/hyprland.nix | 3 +++ hosts/lars/programs.nix | 2 ++ 2 files changed, 5 insertions(+) diff --git a/hosts/lars/hyprland.nix b/hosts/lars/hyprland.nix index 5353ff2..cd12319 100644 --- a/hosts/lars/hyprland.nix +++ b/hosts/lars/hyprland.nix @@ -91,6 +91,9 @@ in { exec-once = [ "waybar" "swww init & swww img ${gitPath}/${cfg.wallpaper}" + "keepassxc" + "nextcloud" + "element-desktop --ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --enable-features=WebRTCPipeWireCpaturer --disable-gpu" ]; bind = [ diff --git a/hosts/lars/programs.nix b/hosts/lars/programs.nix index 6198624..5e0dd5a 100644 --- a/hosts/lars/programs.nix +++ b/hosts/lars/programs.nix @@ -60,6 +60,8 @@ in { toipe keepassxc vivaldi + fzf + nix-index ]; }; } From 64014fa8d945fd50d122457fa74eaaa96169e398 Mon Sep 17 00:00:00 2001 From: LarsZauberer Date: Wed, 17 Apr 2024 23:10:24 +0200 Subject: [PATCH 5/5] Minecraft wayland patch try --- hosts/lars/kronos/programs.nix | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/hosts/lars/kronos/programs.nix b/hosts/lars/kronos/programs.nix index 631e805..8877ef2 100644 --- a/hosts/lars/kronos/programs.nix +++ b/hosts/lars/kronos/programs.nix @@ -1,6 +1,30 @@ -{ config, inputs, pkgs, ... }: +{ config, inputs, pkgs, lib, ... }: let username = config.modules.other.system.username; + + # Fetch the GLFW with Wayland patches for Minecraft + customGLFW = let + mcWaylandPatchRepo = pkgs.fetchFromGitHub { + owner = "Admicos"; + repo = "minecraft-wayland"; + rev = "370ce5b95e3ae9bc4618fb45113bc641fbb13867"; + sha256 = "sha256-RPRg6Gd7N8yyb305V607NTC1kUzvyKiWsh6QlfHW+JE="; + }; + mcWaylandPatches = map (name: "${mcWaylandPatchRepo}/${name}") + (lib.naturalSort (builtins.attrNames (lib.filterAttrs + (name: type: + type == "regular" && lib.hasSuffix ".patch" name) + (builtins.readDir mcWaylandPatchRepo)))); + in pkgs.glfw.overrideAttrs (previousAttrs: { + patches = previousAttrs.patches ++ mcWaylandPatches; + buildInputs = previousAttrs.buildInputs ++ [ pkgs.wayland ]; + }); + + # Minecraft launcher with the custom GLFW + minecraftPrismLauncher = pkgs.prismlauncher.override { + glfw = customGLFW; + }; + in { home-manager.users.${username} = { home.packages = let @@ -9,4 +33,9 @@ in { in with pkgs; [ ]; }; + + # System-wide installation of Minecraft PrismLauncher + environment.systemPackages = [ + minecraftPrismLauncher + ]; }