From 7c88b0f0772f32d1aa6990a28146e9e75bf000b2 Mon Sep 17 00:00:00 2001 From: nathan mccarty Date: Mon, 1 Aug 2022 18:10:41 -0400 Subject: [PATCH] Gamescope --- flake.lock | 81 +++++++++++++++++++++++++-- flake.nix | 5 ++ machines/levitation/configuration.nix | 14 ++++- modules/swaywm.nix | 7 --- 4 files changed, 95 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index f70d2f0..1961273 100644 --- a/flake.lock +++ b/flake.lock @@ -300,6 +300,47 @@ "type": "github" } }, + "gamescope": { + "inputs": { + "gamescope-src": "gamescope-src", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-unstable": "nixpkgs-unstable", + "utils": "utils" + }, + "locked": { + "lastModified": 1658887125, + "narHash": "sha256-evUl+58qvhEYA/A55hd8Y/bQMwS7i1GuUlVeTHg9IDk=", + "owner": "nathans-flakes", + "repo": "gamescope", + "rev": "019dfcc926a31dd399940befe1ac67c17a442db8", + "type": "github" + }, + "original": { + "owner": "nathans-flakes", + "repo": "gamescope", + "type": "github" + } + }, + "gamescope-src": { + "flake": false, + "locked": { + "lastModified": 1658761788, + "narHash": "sha256-tyzRnyB4MZ3e30pn/mPxE5E0VOBeKgcnFmhB8iM0IJA=", + "ref": "master", + "rev": "cce6a29a2494eaf8f99e299a39b957fda3fcdb2a", + "revCount": 1140, + "submodules": true, + "type": "git", + "url": "https://github.com/Plagman/gamescope.git" + }, + "original": { + "submodules": true, + "type": "git", + "url": "https://github.com/Plagman/gamescope.git" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -326,7 +367,7 @@ "nixpkgs": [ "nixpkgs" ], - "utils": "utils" + "utils": "utils_2" }, "locked": { "lastModified": 1656122108, @@ -348,7 +389,7 @@ "quilt-server", "nixpkgs" ], - "utils": "utils_2" + "utils": "utils_3" }, "locked": { "lastModified": 1656122108, @@ -527,6 +568,22 @@ } }, "nixpkgs-unstable": { + "locked": { + "lastModified": 1658644204, + "narHash": "sha256-MWyfCH9K3eVTXJUxBi67OQSAh9jJAnvWklM6qm4j8w8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2f0c3be57c348f4cfd8820f2d189e29a685d9c41", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable_2": { "locked": { "lastModified": 1658557357, "narHash": "sha256-0gqNef6skYQKJSS2vLojxrXOrc72zoX5VTDKUqEo6Gk=", @@ -718,13 +775,14 @@ "darwin": "darwin", "emacs": "emacs", "fenix": "fenix", + "gamescope": "gamescope", "home-manager": "home-manager", "java": "java", "mozilla": "mozilla", "nix-doom-emacs": "nix-doom-emacs", "nixos-generators": "nixos-generators", "nixpkgs": "nixpkgs_2", - "nixpkgs-unstable": "nixpkgs-unstable", + "nixpkgs-unstable": "nixpkgs-unstable_2", "polymc": "polymc", "quilt-server": "quilt-server", "sops-nix": "sops-nix", @@ -818,6 +876,21 @@ } }, "utils": { + "locked": { + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_2": { "locked": { "lastModified": 1653893745, "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", @@ -832,7 +905,7 @@ "type": "github" } }, - "utils_2": { + "utils_3": { "locked": { "lastModified": 1653893745, "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", diff --git a/flake.nix b/flake.nix index e69832f..f81d01e 100644 --- a/flake.nix +++ b/flake.nix @@ -53,6 +53,10 @@ url = "github:nix-community/NixOS-WSL"; inputs.nixpkgs.follows = "nixpkgs"; }; + gamescope = { + url = "github:nathans-flakes/gamescope"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = @@ -71,6 +75,7 @@ , quilt-server , nixos-generators , wsl + , gamescope }@inputs: let makeNixosSystem = { system, hostName, extraModules ? [ ], ourNixpkgs ? nixpkgs }: ourNixpkgs.lib.nixosSystem { diff --git a/machines/levitation/configuration.nix b/machines/levitation/configuration.nix index 0f763a6..803351d 100644 --- a/machines/levitation/configuration.nix +++ b/machines/levitation/configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, inputs, ... }: { # Sops setup for this machine @@ -79,4 +79,16 @@ }; kernelParams = [ "crypt-pv.luks.options=tpm2-device=auto" ]; }; + + # Install gamescope + environment.systemPackages = [ + inputs.gamescope.defaultPackage."x86_64-linux" + ]; + nixpkgs.config.packageOverrides = pkgs: { + steam = pkgs.steam.override { + extraPkgs = pkgs: [ + inputs.gamescope.defaultPackage."x86_64-linux" + ]; + }; + }; } diff --git a/modules/swaywm.nix b/modules/swaywm.nix index 5d365f5..2b982f3 100644 --- a/modules/swaywm.nix +++ b/modules/swaywm.nix @@ -28,15 +28,8 @@ with lib; hardware.opengl = { # Enable vulkan driSupport = true; - # Force vulkan drivers - extraPackages = [ - pkgs.amdvlk - ]; # Same as above, but enable 32 bit legacy support (for games) driSupport32Bit = true; - extraPackages32 = [ - pkgs.driversi686Linux.amdvlk - ]; }; # Basic packages that are effectively required for a graphical system environment.systemPackages = with pkgs; [