audio nixosmodule

This commit is contained in:
Zynh Ludwig 2024-06-30 01:07:09 -07:00
parent 1701ade73f
commit 59b62ac042
5 changed files with 28 additions and 48 deletions

View file

@ -52,23 +52,6 @@
services.envfs.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;

View file

@ -39,20 +39,6 @@
services.envfs.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# jack.enable = true;
media-session.enable = true;
};
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;

View file

@ -52,23 +52,6 @@
services.envfs.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;

27
modules/audio.nix Normal file
View file

@ -0,0 +1,27 @@
{ lib, config, ... }:
let
cfg = config.snowhawk.audio;
in
{
options.snowhawk.audio = {
enable = lib.mkEnableOption "audio";
};
config = lib.mkIf cfg.enable {
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# jack.enable = true;
media-session.enable = true;
};
};
}

View file

@ -4,6 +4,7 @@
imports = [
./dwm.nix
./i18n.nix
./audio.nix
];
snowhawk.i18n.enable = lib.mkDefault true;