Add firefox and pipewire modules

This commit is contained in:
Joshua Yuen 2025-07-29 13:29:47 -04:00
parent 8b3fa070c3
commit 80996bbf64
Signed by: josh
GPG Key ID: 502720BC22ED411C
6 changed files with 72 additions and 0 deletions

View File

@ -8,6 +8,7 @@
./gdm.nix
./hyprland.nix
./packages.nix
./pipewire.nix
./plasma.nix
./sddm.nix
./stylix.nix

21
modules/core/firefox.nix Normal file
View File

@ -0,0 +1,21 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
pipewireCfg = config.modules.pipewire;
in
{
programs = {
firefox.enable = true;
};
# Add wayland screensharing support if PipeWire is enabled
environment.systemPackages = with pkgs; []
++ (if pipewireCfg.enable
then [ (wrapFirefox (firefox-unwrapped.override { pipewireSupport = true; }) {}) ]
else [ firefox ]);
}

25
modules/core/pipewire.nix Normal file
View File

@ -0,0 +1,25 @@
{
config,
lib,
...
}:
with lib;
let
cfg = config.modules.pipewire;
in
{
config = mkIf cfg.enable {
services.pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
jack.enable = true;
};
# Allows Pipewire to use the realtime scheduler for increased performance
security.rtkit.enable = true;
};
}

View File

@ -7,6 +7,7 @@
with lib;
let
hyprlandCfg = osConfig.modules.hyprland;
pipewireCfg = osConfig.modules.pipewire;
plasmaCfg = osConfig.modules.plasma;
in
{
@ -20,6 +21,12 @@ in
++ (if hyprlandCfg.enable
then [ pkgs.xdg-desktop-portal-hyprland ]
else [])
++ (if pipewireCfg.enable
then [
pkgs.xdg-desktop-portal-wlr
pkgs.xdg-desktop-portal-gtk
]
else [])
++ (if plasmaCfg.enable
then [ pkgs.kdePackages.xdg-desktop-portal-kde ]
else []);

View File

@ -5,6 +5,7 @@
imports = [
./displayManager.nix
./hyprland.nix
./pipewire.nix
./plasma.nix
./shell.nix
./system.nix

View File

@ -0,0 +1,17 @@
{
config,
lib,
...
}:
with lib;
let
cfg = config.modules.pipewire;
in
{
options.modules.pipewire = {
enable = mkEnableOption {
default = true;
description = "Enable PipeWire";
};
};
}