use nix-gaming for audio fixes

This commit is contained in:
xunuwu 2025-04-30 00:55:11 +02:00
parent 89016c01da
commit 9459b2267b
4 changed files with 69 additions and 23 deletions

65
flake.lock generated
View file

@ -295,6 +295,24 @@
} }
}, },
"flake-parts_3": { "flake-parts_3": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1743550720,
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_4": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"nvim-config", "nvim-config",
@ -316,7 +334,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_4": { "flake-parts_5": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"nvim-config", "nvim-config",
@ -338,7 +356,7 @@
"type": "indirect" "type": "indirect"
} }
}, },
"flake-parts_5": { "flake-parts_6": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"stylix", "stylix",
@ -583,7 +601,7 @@
}, },
"hercules-ci-effects": { "hercules-ci-effects": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_4", "flake-parts": "flake-parts_5",
"nixpkgs": [ "nixpkgs": [
"nvim-config", "nvim-config",
"neovim-nightly-overlay", "neovim-nightly-overlay",
@ -674,7 +692,7 @@
"neovim-nightly-overlay": { "neovim-nightly-overlay": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_3",
"flake-parts": "flake-parts_3", "flake-parts": "flake-parts_4",
"git-hooks": "git-hooks", "git-hooks": "git-hooks",
"hercules-ci-effects": "hercules-ci-effects", "hercules-ci-effects": "hercules-ci-effects",
"neovim-src": "neovim-src", "neovim-src": "neovim-src",
@ -711,6 +729,27 @@
"type": "github" "type": "github"
} }
}, },
"nix-gaming": {
"inputs": {
"flake-parts": "flake-parts_3",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1745718727,
"narHash": "sha256-Q+8ki5/0doymTb/6yZyB1IgKy7vIkWG5IILIzw9Vz1U=",
"owner": "fufexan",
"repo": "nix-gaming",
"rev": "f42092f4379fe71bf810a71c1c33f1f807b97746",
"type": "github"
},
"original": {
"owner": "fufexan",
"repo": "nix-gaming",
"type": "github"
}
},
"nix-github-actions": { "nix-github-actions": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -806,6 +845,21 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib_2": {
"locked": {
"lastModified": 1743296961,
"narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1745234285, "lastModified": 1745234285,
@ -840,7 +894,7 @@
}, },
"nur": { "nur": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_5", "flake-parts": "flake-parts_6",
"nixpkgs": [ "nixpkgs": [
"stylix", "stylix",
"nixpkgs" "nixpkgs"
@ -942,6 +996,7 @@
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_2",
"hardware": "hardware", "hardware": "hardware",
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-gaming": "nix-gaming",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nix-minecraft": "nix-minecraft", "nix-minecraft": "nix-minecraft",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",

View file

@ -61,6 +61,9 @@
# nvfetcher.url = "github:berberman/nvfetcher"; # nvfetcher.url = "github:berberman/nvfetcher";
# nvfetcher.inputs.nixpkgs.follows = "nixpkgs"; # nvfetcher.inputs.nixpkgs.follows = "nixpkgs";
nix-gaming.url = "github:fufexan/nix-gaming";
nix-gaming.inputs.nixpkgs.follows = "nixpkgs";
vpn-confinement.url = "github:Maroka-chan/VPN-Confinement"; vpn-confinement.url = "github:Maroka-chan/VPN-Confinement";
nix-minecraft.url = "github:Infinidoge/nix-minecraft"; nix-minecraft.url = "github:Infinidoge/nix-minecraft";

View file

@ -4,11 +4,13 @@
# high priority since it's almost always used # high priority since it's almost always used
"https://cache.nixos.org?priority=10" "https://cache.nixos.org?priority=10"
"https://nix-community.cachix.org" "https://nix-community.cachix.org"
"https://nix-gaming.cachix.org"
]; ];
trusted-public-keys = [ trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
]; ];
}; };
} }

View file

@ -1,4 +1,6 @@
{lib, ...}: { {inputs, ...}: {
imports = [inputs.nix-gaming.nixosModules.pipewireLowLatency];
services.pipewire = { services.pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;
@ -6,22 +8,6 @@
jack.enable = true; jack.enable = true;
pulse.enable = true; pulse.enable = true;
# https://wiki.archlinux.org/title/PipeWire#Noticeable_audio_delay_or_audible_pop/crack_when_starting_playback lowLatency.enable = true;
wireplumber.extraConfig."51-disable-suspension.conf" = {
"monitor.alsa.rules" = lib.singleton {
matches = [
{"node.name" = "~alsa_input.*";}
{"node.name" = "~alsa_output.*";}
];
actions.update-props."session.suspend-timeout.seconds" = 0;
};
"monitor.bluez.rules" = lib.singleton {
matches = [
{"node.name" = "~bluez_input.*";}
{"node.name" = "~bluez_output.*";}
];
actions.update-props."session.suspend-timeout-seconds" = 0;
};
};
}; };
} }