diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index 29f47cb..d789325 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -4,5 +4,6 @@ { imports = [ ./nitrokey + ./sound ]; } diff --git a/modules/hardware/sound/default.nix b/modules/hardware/sound/default.nix new file mode 100644 index 0000000..552ff30 --- /dev/null +++ b/modules/hardware/sound/default.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.hardware.sound; +in +{ + options.my.hardware.sound = { + enable = lib.mkEnableOption "sound configuration with pipewire"; + }; + + config = lib.mkIf cfg.enable { + + # RealtimeKit is recommended + security.rtkit.enable = true; + + services.pipewire = { + enable = true; + + alsa = { + enable = true; + support32Bit = true; + }; + + pulse.enable = true; + + jack.enable = true; + }; + + programs.noisetorch.enable = true; + + environment.systemPackages = with pkgs; [ + noisetorch + pavucontrol + playerctl + pulseaudio # provide pactl to enable keyboard shortcuts + ]; + }; +} diff --git a/nixos/modules/sound.nix b/nixos/modules/sound.nix deleted file mode 100644 index f3833a2..0000000 --- a/nixos/modules/sound.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, pkgs, ... }: -{ - sound.enable = true; - - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - # programs.noisetorch.enable = true; - - environment.systemPackages = with pkgs; [ - # noisetorch - pavucontrol - playerctl - pulseaudio # provide pactl to enable keyboard shortcuts - ]; -} diff --git a/nixos/thinkman/hardware-configuration.nix b/nixos/thinkman/hardware-configuration.nix index 11571d1..dd71ad9 100644 --- a/nixos/thinkman/hardware-configuration.nix +++ b/nixos/thinkman/hardware-configuration.nix @@ -8,5 +8,6 @@ my.hardware = { nitrokey.enable = true; + sound.enable = true; }; }