home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

commit c8ef999b00961d979b214a1aabd1db93d1e0a878
parent c34609053e0f9822e7b08f79b1979ff0f2b2aa71
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Thu, 28 Jul 2022 11:54:00 +0200

systems/modules: migrate profiles.pulseaudio to modules.hardware.audio

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mflake.nix | 1-
Msystems/modules/hardware/audio.nix | 1-
Msystems/modules/hardware/bluetooth.nix | 2--
Msystems/modules/profiles/desktop.nix | 11+++++++----
Dsystems/modules/profiles/pulseaudio.nix | 59-----------------------------------------------------------
Msystems/modules/profiles/sway.nix | 7+++++--
6 files changed, 12 insertions(+), 69 deletions(-)

diff --git a/flake.nix b/flake.nix @@ -129,7 +129,6 @@ ./systems/modules/profiles/laptop.nix ./systems/modules/profiles/mail.nix ./systems/modules/profiles/printing.nix - ./systems/modules/profiles/pulseaudio.nix ./systems/modules/profiles/qemu.nix ./systems/modules/profiles/redhat.nix ./systems/modules/profiles/scanning.nix diff --git a/systems/modules/hardware/audio.nix b/systems/modules/hardware/audio.nix @@ -26,7 +26,6 @@ in hardware.pulseaudio = { enable = true; support32Bit = true; - package = pkgs.pulseaudioFull; }; # FIXME is it needed security.pam.loginLimits = [ diff --git a/systems/modules/hardware/bluetooth.nix b/systems/modules/hardware/bluetooth.nix @@ -20,8 +20,6 @@ in # PulseAudio to be installed. Only the full build has Bluetooth # support, so it must be selected here. package = pkgs.pulseaudioFull; - # Enable additional codecs - extraModules = [ pkgs.pulseaudio-modules-bt ]; }; }) (mkIf (stable && config.modules.hardware.audio.enable) { diff --git a/systems/modules/profiles/desktop.nix b/systems/modules/profiles/desktop.nix @@ -13,9 +13,9 @@ in description = "Enable avahi with the desktop profile"; type = types.bool; }; - pulseaudio = mkOption { + audio = mkOption { default = true; - description = "Enable pulseaudio with the desktop profile"; + description = "Enable audio with the desktop profile"; type = types.bool; }; syncthing = mkOption { @@ -43,11 +43,14 @@ in config = mkIf cfg.enable { profiles.avahi.enable = cfg.avahi; profiles.printing.enable = cfg.printing; - profiles.pulseaudio.enable = cfg.pulseaudio; + # profiles.pulseaudio.enable = cfg.pulseaudio; profiles.scanning.enable = cfg.scanning; profiles.syncthing.enable = cfg.syncthing; - hardware.bluetooth.enable = true; + modules = { + hardware.bluetooth.enable = true; + hardware.audio.enable = cfg.audio; + }; networking.networkmanager = { enable = cfg.networkmanager; diff --git a/systems/modules/profiles/pulseaudio.nix b/systems/modules/profiles/pulseaudio.nix @@ -1,59 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; -let - cfg = config.profiles.pulseaudio; -in -{ - options = { - profiles.pulseaudio = { - enable = mkEnableOption "Enable pulseaudio profile"; - tcp = mkOption { - default = false; - description = "Enable pulseaudio tcp"; - type = types.bool; - }; - }; - }; - config = mkIf cfg.enable { - hardware = { - pulseaudio = { - enable = true; - support32Bit = true; - zeroconf = { - discovery.enable = cfg.tcp; - publish.enable = cfg.tcp; - }; - tcp = { - enable = cfg.tcp; - anonymousClients = { - allowAll = true; - allowedIpRanges = [ "127.0.0.1" "192.168.12.0/24" "10.0.0.0/24" ]; - }; - }; - package = pkgs.pulseaudioFull; - }; - }; - sound.mediaKeys.enable = true; - - security.pam.loginLimits = [ - { domain = "@audio"; item = "memlock"; type = "-"; value = "unlimited"; } - { domain = "@audio"; item = "rtprio"; type = "-"; value = "99"; } - { domain = "@audio"; item = "nofile"; type = "-"; value = "99999"; } - ]; - - # spotify & pulseaudio - networking.firewall = { - allowedTCPPorts = [ 57621 57622 4713 ]; - allowedUDPPorts = [ 57621 57622 ]; - # 57621 57622 spotify - # 4713 pulseaudio - }; - environment.systemPackages = with pkgs; [ - apulse # allow alsa application to use pulse - pavucontrol # pulseaudio volume control - pasystray # systray application - playerctl - ]; - }; -} diff --git a/systems/modules/profiles/sway.nix b/systems/modules/profiles/sway.nix @@ -17,11 +17,14 @@ in #}; profiles.avahi.enable = true; profiles.printing.enable = true; - profiles.pulseaudio.enable = true; + # profiles.pulseaudio.enable = true; profiles.scanning.enable = true; profiles.syncthing.enable = true; - hardware.bluetooth.enable = true; + modules = { + hardware.bluetooth.enable = true; + hardware.audio.enable = true; + }; networking.networkmanager = { enable = true;