From cea4ee54fc793a380b9510be3beb21d7a224e1f5 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Sun, 29 May 2022 22:12:19 +0300 Subject: [PATCH] wow --- pkgs-set/default.nix | 34 ++++++++---- pkgs-set/pkgs-to-export.nix | 2 +- pkgs-set/pkgs/gamescope.nix | 104 ++++++++++++++++++++++++++++++++++++ users/patriot/default.nix | 2 + 4 files changed, 130 insertions(+), 12 deletions(-) create mode 100644 pkgs-set/pkgs/gamescope.nix diff --git a/pkgs-set/default.nix b/pkgs-set/default.nix index 1c66472..84e5268 100644 --- a/pkgs-set/default.nix +++ b/pkgs-set/default.nix @@ -5,20 +5,32 @@ ... }: let l = lib; + overlays = + l.mapAttrsToList + ( + name: _: let + o = import "${./overlays}/${name}"; + in + if (l.functionArgs o) ? inputs + then o {inherit inputs;} + else o + ) + (l.readDir ./overlays); + newPkgs = + l.mapAttrsToList + ( + name: _: final: prev: { + ${l.removeSuffix ".nix" name} = + prev.callPackage + "${./pkgs}/${name}" + {inherit inputs;}; + } + ) + (l.readDir ./pkgs); pkgs = import inputs.nixpkgs { inherit system; config.allowUnfree = true; - overlays = - l.mapAttrsToList - ( - name: _: let - o = import "${./overlays}/${name}"; - in - if (l.functionArgs o) ? inputs - then o {inherit inputs;} - else o - ) - (l.readDir ./overlays); + overlays = overlays ++ newPkgs; }; pkgsToExport = import ./pkgs-to-export.nix; in diff --git a/pkgs-set/pkgs-to-export.nix b/pkgs-set/pkgs-to-export.nix index edfa699..15fb98a 100644 --- a/pkgs-set/pkgs-to-export.nix +++ b/pkgs-set/pkgs-to-export.nix @@ -1 +1 @@ -["discord-system-electron" "fractal-next"] +["discord-system-electron" "fractal-next" "gamescope"] diff --git a/pkgs-set/pkgs/gamescope.nix b/pkgs-set/pkgs/gamescope.nix new file mode 100644 index 0000000..5b3cf33 --- /dev/null +++ b/pkgs-set/pkgs/gamescope.nix @@ -0,0 +1,104 @@ +{ + lib, + stdenv, + fetchFromGitHub, + meson, + pkgconfig, + libdrm, + xorg, + wayland, + wayland-protocols, + libxkbcommon, + libcap, + SDL2, + mesa, + libinput, + pixman, + xcbutilerrors, + xcbutilwm, + glslang, + ninja, + makeWrapper, + xwayland, + libuuid, + xcbutilrenderutil, + pipewire, + stb, + writeText, + wlroots, + vulkan-loader, + vulkan-headers, + libseat, + ... +}: let + stbpc = writeText "stbpc" '' + prefix=${stb} + includedir=''${prefix}/include/stb + Cflags: -I''${includedir} + Name: stb + Version: ${stb.version} + Description: stb + ''; + stb_ = stb.overrideAttrs (oldAttrs: rec { + installPhase = '' + ${oldAttrs.installPhase} + install -Dm644 ${stbpc} $out/lib/pkgconfig/stb.pc + ''; + }); +in + stdenv.mkDerivation rec { + pname = "gamescope"; + version = "3.11.30"; + + src = fetchFromGitHub { + owner = "Plagman"; + repo = "gamescope"; + rev = version; + sha256 = "sha256-dSQrOlQfUZkA8Vrc/Tj9dAWIIBOeb+tAen21fZe3Gto="; + fetchSubmodules = true; + }; + + postInstall = '' + wrapProgram $out/bin/gamescope \ + --prefix PATH : "${lib.makeBinPath [xwayland]}" + ''; + + buildInputs = with xorg; [ + libX11 + libXdamage + libXcomposite + libXrender + libXext + libXxf86vm + libXtst + libdrm + vulkan-loader + wayland + wayland-protocols + libxkbcommon + libcap + SDL2 + mesa + libinput + pixman + xcbutilerrors + xcbutilwm + libXi + libXres + libuuid + xcbutilrenderutil + xwayland + pipewire + wlroots + libseat + ]; + nativeBuildInputs = [meson pkgconfig glslang ninja makeWrapper stb_]; + + meta = with lib; { + description = "The micro-compositor formerly known as steamcompmgr"; + license = licenses.bsd2; + homepage = src.meta.homepage; + platforms = platforms.linux; + maintainers = with maintainers; []; + }; + } diff --git a/users/patriot/default.nix b/users/patriot/default.nix index 0eccc41..5405302 100644 --- a/users/patriot/default.nix +++ b/users/patriot/default.nix @@ -144,6 +144,7 @@ in { dejavu_fonts #(nerdfonts.override {fonts = [font.name];}) # Programs + gamescope wezterm cargo-outdated cargo-release @@ -162,6 +163,7 @@ in { mupdf transmission-qt lutris + bottles xdg_utils tagref papirus-icon-theme