From 05ab0ea83af98726b88e32492840f57d9354cbd2 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Tue, 17 Oct 2023 19:10:54 -0400 Subject: [PATCH] feat(binto): add nix gaming with lowL pipewire plus switch to xanmod --- flake.lock | 82 ++++++++++++++++++++++++-- flake.nix | 4 +- hosts/binto/configuration.nix | 1 + hosts/binto/hardware-configuration.nix | 2 +- hosts/binto/modules/nix-gaming.nix | 7 +++ modules/audio.nix | 7 ++- 6 files changed, 95 insertions(+), 8 deletions(-) create mode 100644 hosts/binto/modules/nix-gaming.nix diff --git a/flake.lock b/flake.lock index 076ee84..2bbad9e 100644 --- a/flake.lock +++ b/flake.lock @@ -113,6 +113,24 @@ } }, "flake-parts_4": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1696343447, + "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_5": { "inputs": { "nixpkgs-lib": [ "nixpkgs-wayland", @@ -320,7 +338,7 @@ "lib-aggregate": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs-lib": "nixpkgs-lib_2" + "nixpkgs-lib": "nixpkgs-lib_3" }, "locked": { "lastModified": 1697371715, @@ -386,8 +404,8 @@ }, "nix-eval-jobs": { "inputs": { - "flake-parts": "flake-parts_4", - "nixpkgs": "nixpkgs_3", + "flake-parts": "flake-parts_5", + "nixpkgs": "nixpkgs_4", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -404,6 +422,25 @@ "type": "github" } }, + "nix-gaming": { + "inputs": { + "flake-parts": "flake-parts_4", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1697522478, + "narHash": "sha256-zJjqof16zmmBm9XBifjlsPKmFev/QYuQsC7y+RAmJek=", + "owner": "fufexan", + "repo": "nix-gaming", + "rev": "bb6f28dc668b271d39a82d9ad69ef01d8d15aa9a", + "type": "github" + }, + "original": { + "owner": "fufexan", + "repo": "nix-gaming", + "type": "github" + } + }, "nix-melt": { "inputs": { "nixpkgs": [ @@ -459,6 +496,24 @@ } }, "nixpkgs-lib_2": { + "locked": { + "dir": "lib", + "lastModified": 1696019113, + "narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_3": { "locked": { "lastModified": 1697331025, "narHash": "sha256-a5LJWWHfEvnq9tBd9UyNVdtzLXc2ehu5MCp//Bex/0E=", @@ -497,6 +552,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1697009197, + "narHash": "sha256-viVRhBTFT8fPJTb1N3brQIpFZnttmwo3JVKNuWRVc3s=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "01441e14af5e29c9d27ace398e6dd0b293e25a54", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1697059129, "narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=", @@ -512,7 +583,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1697417052, "narHash": "sha256-QyFpNZ28H0IoWhbGxD4j2h3aYwap2l2rSWyoFue95sM=", @@ -570,8 +641,9 @@ "hyprgrass": "hyprgrass", "hyprland": "hyprland", "neovim-nightly-overlay": "neovim-nightly-overlay", + "nix-gaming": "nix-gaming", "nix-melt": "nix-melt", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nixpkgs-wayland": "nixpkgs-wayland", "nur": "nur", "nurl": "nurl" diff --git a/flake.nix b/flake.nix index 1be7027..2d4acea 100644 --- a/flake.nix +++ b/flake.nix @@ -33,6 +33,8 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nix-gaming.url = "github:fufexan/nix-gaming"; + nix-melt = { url = "github:nix-community/nix-melt"; inputs.nixpkgs.follows = "nixpkgs"; @@ -44,7 +46,7 @@ }; }; - outputs = { self, nixpkgs, home-manager, nur, ... }@attrs: let + outputs = { self, nixpkgs, home-manager, nur, nix-gaming, ... }@attrs: let defaultModules = [ nur.nixosModules.nur diff --git a/hosts/binto/configuration.nix b/hosts/binto/configuration.nix index 02bd926..4b4fd4e 100644 --- a/hosts/binto/configuration.nix +++ b/hosts/binto/configuration.nix @@ -11,6 +11,7 @@ ../../modules/printer.nix ./modules/nvidia.nix + ./modules/nix-gaming.nix ]; networking = { diff --git a/hosts/binto/hardware-configuration.nix b/hosts/binto/hardware-configuration.nix index a294729..7f57732 100644 --- a/hosts/binto/hardware-configuration.nix +++ b/hosts/binto/hardware-configuration.nix @@ -2,7 +2,7 @@ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot = { - kernelPackages = pkgs.linuxPackages_latest; + kernelPackages = pkgs.linuxPackages_xanmod_latest; kernelModules = [ "kvm-amd" ]; extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback diff --git a/hosts/binto/modules/nix-gaming.nix b/hosts/binto/modules/nix-gaming.nix new file mode 100644 index 0000000..1a3f6d3 --- /dev/null +++ b/hosts/binto/modules/nix-gaming.nix @@ -0,0 +1,7 @@ +# configuration.nix +{ + nix.settings = { + substituters = ["https://nix-gaming.cachix.org"]; + trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="]; + }; +} diff --git a/modules/audio.nix b/modules/audio.nix index 53091ff..f8a38ac 100644 --- a/modules/audio.nix +++ b/modules/audio.nix @@ -1,4 +1,8 @@ -{ ... }: { +{ nix-gaming, ... }: { + imports = [ + nix-gaming.nixosModules.pipewireLowLatency + ]; + hardware.pulseaudio.enable = false; services.pipewire = { @@ -6,5 +10,6 @@ alsa.enable = true; jack.enable = true; pulse.enable = true; + lowLatency.enable = true; }; }