diff --git a/modules/hardware/audio/default.nix b/modules/hardware/audio/default.nix new file mode 100644 index 0000000..78ab14f --- /dev/null +++ b/modules/hardware/audio/default.nix @@ -0,0 +1,24 @@ +{ + options, + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.aa.hardware.audio; +in { + options.aa.hardware.audio = with types; { + enable = mkEnableOption "audio"; + }; + + config = mkIf cfg.enable { + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + }; +} diff --git a/systems/x86_64-linux/carbon/default.nix b/systems/x86_64-linux/carbon/default.nix index 5be8293..841832c 100644 --- a/systems/x86_64-linux/carbon/default.nix +++ b/systems/x86_64-linux/carbon/default.nix @@ -27,6 +27,8 @@ apps.tmux.enable = true; services.printing.enable = true; + + hardware.audio.enable = true; }; networking = { @@ -163,14 +165,6 @@ #}; }; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ]; diff --git a/systems/x86_64-linux/gospel/default.nix b/systems/x86_64-linux/gospel/default.nix index 397542a..57a4927 100644 --- a/systems/x86_64-linux/gospel/default.nix +++ b/systems/x86_64-linux/gospel/default.nix @@ -33,6 +33,8 @@ subdomain_name = "gospel"; }; services.printing.enable = true; + + hardware.audio.enable = true; }; boot.binfmt.emulatedSystems = ["aarch64-linux" "armv6l-linux"]; @@ -83,13 +85,6 @@ file ]; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; # Copy the NixOS configuration file and link it from the resulting system # (/run/current-system/configuration.nix). This is useful in case you