nix-gaming flake

This commit is contained in:
Danilo Reyes 2024-06-13 22:53:44 -06:00
parent 1d818fcf92
commit dd31726028
4 changed files with 87 additions and 20 deletions

84
flake.lock generated
View File

@ -1,5 +1,23 @@
{ {
"nodes": { "nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1717285511,
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -21,22 +39,53 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nix-gaming": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
},
"locked": { "locked": {
"lastModified": 1717144377, "lastModified": 1718328127,
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=", "narHash": "sha256-2ldscRIlStuv/fRmifXbvjlMpyVuy8Z9zhiDBRM6oe0=",
"owner": "nixos", "owner": "fufexan",
"repo": "nixpkgs", "repo": "nix-gaming",
"rev": "805a384895c696f802a9bf5bf4720f37385df547", "rev": "2c9a664875b410d12282fed9043f4703b6fdb029",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "fufexan",
"ref": "nixos-24.05", "repo": "nix-gaming",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1717774105,
"narHash": "sha256-HV97wqUQv9wvptiHCb3Y0/YH0lJ60uZ8FYfEOIzYEqI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d226935fd75012939397c83f6c385e4d6d832288",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": {
"locked": {
"lastModified": 1717284937,
"narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
}
},
"nixpkgs-master": { "nixpkgs-master": {
"locked": { "locked": {
"lastModified": 1717264137, "lastModified": 1717264137,
@ -69,10 +118,27 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1717144377,
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nix-gaming": "nix-gaming",
"nixpkgs": "nixpkgs_2",
"nixpkgs-master": "nixpkgs-master", "nixpkgs-master": "nixpkgs-master",
"nixpkgs-unstable": "nixpkgs-unstable" "nixpkgs-unstable": "nixpkgs-unstable"
} }

View File

@ -6,6 +6,7 @@
nixpkgs-master.url = "github:nixos/nixpkgs?ref=master"; nixpkgs-master.url = "github:nixos/nixpkgs?ref=master";
home-manager.url = "github:nix-community/home-manager/release-24.05"; home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
nix-gaming.url = "github:fufexan/nix-gaming";
}; };
outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-master, home-manager, ... outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-master, home-manager, ...

View File

@ -1,4 +1,5 @@
{ config, lib, pkgs, ... }: { { config, lib, pkgs, inputs, ... }: {
imports = [ inputs.nix-gaming.nixosModules.platformOptimizations ];
options.my.apps.gaming.enable = lib.mkEnableOption "enable"; options.my.apps.gaming.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.apps.gaming.enable { config = lib.mkIf config.my.apps.gaming.enable {
programs = { programs = {
@ -8,6 +9,7 @@
gamescopeSession.enable = true; gamescopeSession.enable = true;
remotePlay.openFirewall = true; remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true; dedicatedServer.openFirewall = true;
platformOptimizations.enable = true;
}; };
}; };
users.users.jawz.packages = users.users.jawz.packages =

View File

@ -1,22 +1,20 @@
{ config, lib, ... }: { { config, lib, inputs, ... }: {
imports = [ imports = [ inputs.nix-gaming.nixosModules.pipewireLowLatency ];
# nixGaming.nixosModules.pipewireLowLatency
];
options.my.services.sound.enable = lib.mkEnableOption "enable"; options.my.services.sound.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.services.sound.enable { config = lib.mkIf config.my.services.sound.enable {
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;
security.rtkit.enable = true; security.rtkit.enable = true; # make pipewire realtime-capable
sound.enable = false; sound.enable = false;
services.pipewire = { services.pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;
alsa.support32Bit = true; alsa.support32Bit = true;
pulse.enable = true; pulse.enable = true;
# lowLatency = { lowLatency = {
# enable = true; enable = true;
# quantum = 64; quantum = 64;
# rate = 48000; rate = 48000;
# }; };
}; };
}; };
} }