audio: enable security.rtkit for pipewire
This should avoid stuttering audio when CPU is busy
This commit is contained in:
parent
d69ed82a31
commit
5ea57eaea6
|
@ -1,11 +1,14 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.audio;
|
||||
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
|
||||
in
|
||||
{
|
||||
in {
|
||||
options.pub-solar.audio = {
|
||||
enable = mkEnableOption "Life in highs and lows";
|
||||
mopidy.enable = mkEnableOption "Life with mopidy";
|
||||
|
@ -20,12 +23,14 @@ in
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
users.users = pkgs.lib.setAttrByPath [ psCfg.user.name ] {
|
||||
extraGroups = [ "audio" ];
|
||||
users.users = pkgs.lib.setAttrByPath [psCfg.user.name] {
|
||||
extraGroups = ["audio"];
|
||||
};
|
||||
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = [
|
||||
home-manager = with pkgs;
|
||||
pkgs.lib.setAttrByPath ["users" psCfg.user.name] {
|
||||
home.packages =
|
||||
[
|
||||
# easyeffects, e.g. for microphone noise filtering
|
||||
easyeffects
|
||||
mu
|
||||
|
@ -35,7 +40,12 @@ in
|
|||
# Needed for pactl cmd, until pw-cli is more mature (vol up/down hotkeys?)
|
||||
pulseaudio
|
||||
vimpc
|
||||
] ++ (if cfg.spotify.enable then [ pkgs.spotify-tui ] else [ ]);
|
||||
]
|
||||
++ (
|
||||
if cfg.spotify.enable
|
||||
then [pkgs.spotify-tui]
|
||||
else []
|
||||
);
|
||||
xdg.configFile."vimpc/vimpcrc".source = ./.config/vimpc/vimpcrc;
|
||||
systemd.user.services.easyeffects = import ./easyeffects.service.nix pkgs;
|
||||
|
||||
|
@ -54,6 +64,8 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
# rtkit is optional but recommended
|
||||
security.rtkit.enable = true;
|
||||
# Enable sound using pipewire-pulse
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
|
@ -63,7 +75,7 @@ in
|
|||
|
||||
config.pipewire = {
|
||||
context.default.clock = {
|
||||
allowed-rates = [ 44100 48000 88200 96000 ];
|
||||
allowed-rates = [44100 48000 88200 96000];
|
||||
rate = 44100;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue