diff --git a/flake.lock b/flake.lock index d9b5fbf..1324b17 100644 --- a/flake.lock +++ b/flake.lock @@ -58,6 +58,21 @@ } }, "flake-utils": { + "locked": { + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "locked": { "lastModified": 1634851050, "narHash": "sha256-N83GlSGPJJdcqhUxSCS/WwW5pksYf3VP1M13cDRTSVA=", @@ -113,7 +128,7 @@ }, "naersk_2": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1635777496, @@ -129,6 +144,27 @@ "type": "github" } }, + "nix-gaming": { + "inputs": { + "nixpkgs": "nixpkgs_3", + "oglfPatches": "oglfPatches", + "tkgPatches": "tkgPatches", + "utils": "utils_2" + }, + "locked": { + "lastModified": 1637691862, + "narHash": "sha256-ZkUW8JfjDmFZnRQKeBKQvqlWLRgIq4p6v2QfLrjSm0s=", + "owner": "fufexan", + "repo": "nix-gaming", + "rev": "caf86b1dd4b4cdd59970590eaaa9c009c9f1e6ea", + "type": "github" + }, + "original": { + "owner": "fufexan", + "repo": "nix-gaming", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1632086102, @@ -176,6 +212,21 @@ } }, "nixpkgs_3": { + "locked": { + "lastModified": 1628417749, + "narHash": "sha256-LI00lL97qfnVPYLM50nh9BhHY9viHziuLjkMzBrIuTE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3a8b5de9f0db6be3eccf4987b09af26499ceff6f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1638239011, "narHash": "sha256-AjhmbT4UBlJWqxY0ea8a6GU2C2HdKUREkG43oRr3TZg=", @@ -191,7 +242,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1625223284, "narHash": "sha256-jjLcDSU1rRiJb+n3uez23XAa7kbnPcGZTa6jIKh1GMQ=", @@ -207,7 +258,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1635956637, "narHash": "sha256-65J/mVWr0M1y/59QOGSq6jOqiYYo6zoURJqdc0EzSZA=", @@ -221,7 +272,7 @@ "type": "indirect" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1635956637, "narHash": "sha256-65J/mVWr0M1y/59QOGSq6jOqiYYo6zoURJqdc0EzSZA=", @@ -250,6 +301,23 @@ "type": "github" } }, + "oglfPatches": { + "flake": false, + "locked": { + "lastModified": 1629854275, + "narHash": "sha256-hnj86MirD0jU4NzkdRoaODuryGRPUavA9qhGWlixk2Y=", + "owner": "openglfreak", + "repo": "wine-tkg-userpatches", + "rev": "c5d849279c8a90123162d92413aa249c2f044dc0", + "type": "github" + }, + "original": { + "owner": "openglfreak", + "repo": "wine-tkg-userpatches", + "rev": "c5d849279c8a90123162d92413aa249c2f044dc0", + "type": "github" + } + }, "rnix-lsp": { "inputs": { "naersk": [ @@ -258,7 +326,7 @@ "nixpkgs": [ "nixpkgs-unstable" ], - "utils": "utils_2" + "utils": "utils_3" }, "locked": { "lastModified": 1634449716, @@ -280,7 +348,8 @@ "deploy-rs": "deploy-rs", "home-manager": "home-manager", "naersk": "naersk", - "nixpkgs": "nixpkgs_3", + "nix-gaming": "nix-gaming", + "nixpkgs": "nixpkgs_4", "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", "rnix-lsp": "rnix-lsp", @@ -306,7 +375,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1633273832, @@ -322,6 +391,23 @@ "type": "github" } }, + "tkgPatches": { + "flake": false, + "locked": { + "lastModified": 1628767531, + "narHash": "sha256-tcprbnfojbCQLiebOaiOp0Occ/6f0m38N56bzgGKuJc=", + "owner": "Frogging-Family", + "repo": "wine-tkg-git", + "rev": "de6cd55961861c254bb4d96481a75bfb78553e5d", + "type": "github" + }, + "original": { + "owner": "Frogging-Family", + "ref": "6.14.r6.g1bc4da9d", + "repo": "wine-tkg-git", + "type": "github" + } + }, "utils": { "locked": { "lastModified": 1631561581, @@ -338,6 +424,25 @@ } }, "utils_2": { + "inputs": { + "flake-utils": "flake-utils" + }, + "locked": { + "lastModified": 1626816926, + "narHash": "sha256-mJKFdfc4UWL49ar2Tc4krKMnDUa0Dkhj8QmbR3SThHo=", + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "5dba7556e1c7f36152c9f65c16bc813ec73ee6a5", + "type": "github" + }, + "original": { + "owner": "gytis-ivaskevicius", + "ref": "staging", + "repo": "flake-utils-plus", + "type": "github" + } + }, + "utils_3": { "locked": { "lastModified": 1629481132, "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=", @@ -354,9 +459,9 @@ }, "youmubot": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "naersk": "naersk_2", - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1637534778, diff --git a/flake.nix b/flake.nix index 08d271d..ead6cf9 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,7 @@ rnix-lsp.inputs.naersk.follows = "naersk"; rnix-lsp.inputs.nixpkgs.follows = "nixpkgs-unstable"; youmubot.url = "github:natsukagami/youmubot"; + nix-gaming.url = github:fufexan/nix-gaming; # --- # DEPLOYMENT ONLY! secrets @@ -28,6 +29,36 @@ outputs = { self, darwin, nixpkgs, nixpkgs-unstable, home-manager, deploy-rs, sops-nix, nur, ... }@inputs: let overlayForSystem = import ./overlay.nix inputs; + + nixpkgsAsRegistry = { ... }: { + nix.registry.nixpkgs.flake = nixpkgs; + nix.registry.nixpkgs-unstable.flake = nixpkgs-unstable; + nix.nixPath = [ + "nixpkgs=${nixpkgs}" + "nixpkgs-unstable=${nixpkgs-unstable}" + "/nix/var/nix/profiles/per-user/root/channels" + ]; + }; + + enableOsuStable = { lib, ... }: { + imports = [ inputs.nix-gaming.nixosModules.pipewireLowLatency ]; + + services.pipewire = { + enable = true; + # alsa is optional + alsa.enable = true; + alsa.support32Bit = true; + # needed for osu + pulse.enable = true; + lowLatency.enable = true; + }; + hardware.pulseaudio.enable = lib.mkOverride 0 false; + + nix.binaryCaches = [ "https://nix-gaming.cachix.org" ]; + nix.binaryCachePublicKeys = [ "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" ]; + + environment.systemPackages = [ inputs.nix-gaming.packages.x86_64-linux.osu-stable ]; + }; in { # MacBook configuration: nix-darwin + home-manager @@ -52,6 +83,8 @@ ./modules/my-tinc sops-nix.nixosModules.sops ./nki-home/configuration.nix + nixpkgsAsRegistry + enableOsuStable home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; diff --git a/nki-home/configuration.nix b/nki-home/configuration.nix index d6fe731..b5ce8fa 100644 --- a/nki-home/configuration.nix +++ b/nki-home/configuration.nix @@ -253,5 +253,8 @@ # Gaming! programs.steam.enable = true; + hardware.opengl.driSupport = true; + # For 32 bit applications + hardware.opengl.driSupport32Bit = true; } diff --git a/nki-home/hardware-configuration.nix b/nki-home/hardware-configuration.nix index e23c948..3c83d5e 100644 --- a/nki-home/hardware-configuration.nix +++ b/nki-home/hardware-configuration.nix @@ -9,7 +9,7 @@ ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.initrd.kernelModules = [ "dm-snapshot" "amdgpu" ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; @@ -29,4 +29,8 @@ # high-resolution display hardware.video.hidpi.enable = lib.mkDefault true; + + # GPU options + services.xserver.videoDrivers = [ "amdgpu" ]; + hardware.opengl.enable = true; }