From 18caa3165211644b8c0a7cd8d4a9000bc9af6dc4 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Tue, 7 Sep 2021 12:12:05 +0200 Subject: [PATCH] packages: Finally fix the conundrum with bubblewrapped steam --- hosts/miku.nix | 4 ++-- overlays/default.nix | 1 - overlays/steam.nix | 51 -------------------------------------------- packages/default.nix | 16 +++++++++++++- 4 files changed, 17 insertions(+), 55 deletions(-) delete mode 100644 overlays/steam.nix diff --git a/hosts/miku.nix b/hosts/miku.nix index 773f98c..0749be3 100644 --- a/hosts/miku.nix +++ b/hosts/miku.nix @@ -5,7 +5,7 @@ let in mkHost config { userName = "alexander"; hostName = "miku"; - overlays = [ "nur" "steam" "unstable" "simple" "custom" "emacs" ]; + overlays = [ "nur" "unstable" "simple" "custom" "emacs" ]; hardwareImports = [ "amdgpu" "amd" ]; programImports = [ "zsh" "git" "mpv" "tmux" "emacs" "firefox" "gnome-terminal" "gnome" "i18n" "gamemode" @@ -36,7 +36,7 @@ in mkHost config { replaysorcery # Custom package evdev-proxy # Custom package vfio-isolate # Custom Package - steam + steam-wrapped discord-system-electron-wrapped # Custom package superpaper # Custom package mumble diff --git a/overlays/default.nix b/overlays/default.nix index a760f29..ef3f103 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -9,7 +9,6 @@ ref = "master"; rev = "ce0e9482d53d69bedc8416d8a984d00e17607826"; }); - steam = import ./steam.nix { pkgs = pkgs; lib = lib; }; nur = import ./nur.nix pkgs; unstable = import ./unstable.nix pkgs; custom = import ./custom.nix pkgs; diff --git a/overlays/steam.nix b/overlays/steam.nix deleted file mode 100644 index bc91528..0000000 --- a/overlays/steam.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ pkgs, lib }: -final: prev: - -# TODO: Replace with the commented out version below -let - buildFHSUserEnvBubblewrap = prev.callPackage ../packages/build-support/build-fhs-userenv-bubblewrap {}; - steamPackages = lib.dontRecurseIntoAttrs (prev.callPackage ../packages/games/steam { - buildFHSUserEnv = buildFHSUserEnvBubblewrap; - }); -in { - buildFHSUserEnvBubblewrap = buildFHSUserEnvBubblewrap; - steamPackages = steamPackages; - steam = steamPackages.steam-fhsenv.override { - extraPkgs = pkgsx: with pkgsx; [ gamemode ]; - }; -} - -/* -let - # NOTE: This is a really messy solution - buildFHSUserEnvBubblewrap = prev.callPackage ../packages/build-support/build-fhs-userenv-bubblewrap {}; -in { - steamPackages = prev.steamPackages.override { - buildFHSUserEnv = buildFHSUserEnvBubblewrap; - # Include gamemode in the FHS - #extraPkgs = (pkgs: with pkgs; [ gamemode ]); - }; - - steam = lib.overrideDerivation prev.steamPackages.steam-fhsenv (old: { - specifyHomeDirs = true; - mountInHome = [ - ".steam" - ".local/share/Steam" - ]; - chdirTo = "/home/$USER"; - additionalBlacklist = [ "/mnt" ]; - additionalMounts = [ "/mnt/Storage/Games/SteamLibrary" ]; - #extraEnv = { - # DRI_PRIME = "1"; - #}; - }); - #steam = final.steamPackages.steam-fhsenv.override { - # extraPkgs = pkgs: with pkgs; [ gamemode ]; - #}; - steam-run = final.steam.run; - steam-run-native = (final.steam.override { - nativeOnly = true; - }); - steamcmd = final.steamPackages.steamcmd; -} -*/ diff --git a/packages/default.nix b/packages/default.nix index 9cbd534..f33d355 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -4,7 +4,6 @@ let pySmartDL = pkgs.callPackage ./development/python/pySmartDL {}; cfscrape = pkgs.callPackage ./development/python/cfscrape {}; system_hotkey = pkgs.callPackage ./development/python/system_hotkey {}; - buildFHSUserEnvBubblewrap = pkgs.callPackage ./build-support/build-fhs-userenv-bubblewrap {}; discord-system-electron = pkgs.callPackage ./applications/networking/instant-messengers/discord { # Wayland # NOTE: electron under Wayland has no window titlebars @@ -60,4 +59,19 @@ in { surface-control = pkgs.callPackage ./tools/system/surface-control {}; trackma = pkgs.callPackage ./tools/video/trackma {}; + + steam-wrapped = wrapInSandbox { + name = "steam"; + package = pkgs.steam; + binaryName = "steam"; + mountInHome = [ ".steam" ".local/share/Steam" ]; + additionalBlacklist = [ "/mnt" ]; + additionalMounts = [ "/mnt/Storage/Games/SteamLibrary" ]; + chdirTo = "/home/$USER"; + extraEnv = { + DRI_PRIME = "1"; + }; + + copyIntoSandbox = [ "/share" ]; + }; }