diff --git a/modules/nixos/environment/gui/chrome.nix b/modules/nixos/environment/gui/browsers/chrome.nix similarity index 100% rename from modules/nixos/environment/gui/chrome.nix rename to modules/nixos/environment/gui/browsers/chrome.nix diff --git a/modules/nixos/environment/gui/browsers/default.nix b/modules/nixos/environment/gui/browsers/default.nix new file mode 100644 index 0000000..5d63b7f --- /dev/null +++ b/modules/nixos/environment/gui/browsers/default.nix @@ -0,0 +1,19 @@ +{ + lib, + config, + ... +}: { + imports = [ + ./chrome.nix + ./firefox.nix + ./vivaldi.nix + ]; + + options.browsers.enable = lib.mkEnableOption "Enable browsers system-wide"; + + config = lib.mkIf config.browsers.enable { + chrome.enable = lib.mkDefault true; + firefox.enable = lib.mkDefault true; + vivaldi.enable = lib.mkDefault true; + }; +} diff --git a/modules/nixos/environment/gui/browsers/firefox.nix b/modules/nixos/environment/gui/browsers/firefox.nix new file mode 100644 index 0000000..528bc74 --- /dev/null +++ b/modules/nixos/environment/gui/browsers/firefox.nix @@ -0,0 +1,31 @@ +{ + config, + lib, + pkgs, + ... +}: let + # version = "firefox-unwrapped"; + version = "floorp"; +in { + options.firefox.enable = lib.mkEnableOption "Configure firefox systemwide"; + + config = lib.mkIf config.firefox.enable { + # environment.systemPackages = with pkgs; [ + # (wrapFirefox (firefox-unwrapped.override { + # pipewireSupport = true; + # }) {}) + # ]; + + programs.firefox = { + enable = true; + package = + if (version == "firefox-unwrapped") + then + pkgs.wrapFirefox (pkgs.${version}.override { + pipewireSupport = true; + }) {} + else pkgs.${version}; + languagePacks = ["de" "en-US"]; + }; + }; +} diff --git a/modules/nixos/environment/gui/browsers/vivaldi.nix b/modules/nixos/environment/gui/browsers/vivaldi.nix new file mode 100644 index 0000000..bbfafa8 --- /dev/null +++ b/modules/nixos/environment/gui/browsers/vivaldi.nix @@ -0,0 +1,30 @@ +{ + pkgs, + config, + lib, + ... +}: { + options.vivaldi.enable = lib.mkEnableOption "Vivaldi Browser"; + + config = lib.mkIf config.vivaldi.enable { + environment.systemPackages = with pkgs; [ + (vivaldi.override { + # https://github.com/NixOS/nixpkgs/issues/343806#issuecomment-2368835641 + # mesa = pkgs.mesa; + commandLineArgs = [ + "--enable-features=TouchpadOverscrollHistoryNavigation,UseOzonePlatform" + "--ozone-platform=wayland" + # "--disable-features=WaylandFractionalScaleV1" + # "--use-gl=egl" # Disable GPU/HW acceleration + #"--enable-gpu-rasterization" + #"--ignore-gpu-blacklist" + #"--disable-gpu-driver-workarounds" + ]; + }) + vivaldi-ffmpeg-codecs + ]; + + # Enable native Wayland support for chrome/electron + #environment.sessionVariables.NIXOS_OZONE_WL = "1"; + }; +} diff --git a/modules/nixos/environment/gui/default.nix b/modules/nixos/environment/gui/default.nix index 7a3948f..0a1bf98 100644 --- a/modules/nixos/environment/gui/default.nix +++ b/modules/nixos/environment/gui/default.nix @@ -4,8 +4,7 @@ ... }: { imports = [ - ./chrome.nix - ./firefox.nix + ./browsers ./steam.nix ./packages.nix @@ -18,8 +17,7 @@ gui.packages.enable = lib.mkDefault true; wayland.enable = lib.mkDefault true; - chrome.enable = lib.mkDefault true; - firefox.enable = lib.mkDefault true; + browsers.enable = lib.mkDefault true; steam.enable = lib.mkDefault true; }; } diff --git a/modules/nixos/environment/gui/firefox.nix b/modules/nixos/environment/gui/firefox.nix deleted file mode 100644 index b1de3ce..0000000 --- a/modules/nixos/environment/gui/firefox.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: { - options = { - firefox.enable = lib.mkEnableOption "Configure firefox systemwide"; - }; - - config = lib.mkIf config.firefox.enable { - environment.systemPackages = with pkgs; [ - (wrapFirefox (firefox-unwrapped.override { - pipewireSupport = true; - }) {}) - ]; - - programs.firefox = { - enable = true; - languagePacks = ["de" "en-US"]; - }; - }; -}