nixos-config/overlays/sandbox.nix

176 lines
5.0 KiB
Nix
Raw Normal View History

2022-01-14 17:08:47 +00:00
final: prev:
let
wrapInSandbox = prev.callPackage ../lib/sandbox.nix {};
in {
2022-03-27 10:30:13 +00:00
discord-app-wrapped = wrapInSandbox {
name = "discord-app-wrapped";
launchScriptName = "discord-app";
binary = "${prev.discord-app}/bin/discord-app";
2022-03-27 10:30:13 +00:00
mountInHome = [ ".local/share/discord-app" ];
additionalBlacklist = [ "/mnt" ];
chdirTo = "/home/$USER";
preDesktopFilePhase = ''
mkdir -p $out/share/icons
cp -L ${prev.discord}/share/pixmaps/discord.png $out/share/icons/discord.png
'';
desktopFileAttributes = {
2022-03-27 10:30:13 +00:00
name = "discord-app-wrapped";
#exec = "discord";
icon = "discord";
desktopName = "Discord-App (wrapped)";
genericName = "Instant Messenger";
#categories = [ "Network" "InstantMessaging" ];
2022-03-27 10:30:13 +00:00
};
enableDesktopFile = true;
2022-03-27 10:30:13 +00:00
};
/*minecraft-wrapped = wrapInSandbox {
2022-01-14 17:08:47 +00:00
name = "minecraft-launcher";
package = prev.minecraft;
binaryName = "minecraft-launcher";
mountInHome = [ ".local/share/minecraft" ".minecraft" ];
additionalBlacklist = [ "/mnt" ];
chdirTo = "/home/$USER";
2022-04-26 15:14:08 +00:00
};*/
2022-01-14 17:08:47 +00:00
steam-wrapped = wrapInSandbox {
2022-04-26 15:14:08 +00:00
name = "steam-wrapped";
binary = "${prev.steam}/bin/steam";
launchScriptName = "steam";
mountInHome = [
".steam"
".local/share/Steam"
"Downloads/Skyrim Mods"
];
2022-01-14 17:08:47 +00:00
additionalBlacklist = [ "/mnt" ];
additionalMounts = [ "/mnt/Storage/Games/SteamLibrary" ];
chdirTo = "/home/$USER";
2022-04-26 15:14:08 +00:00
preDesktopFilePhase = ''
cp -Lr ${prev.steam}/share/icons $out/share/icons
'';
desktopFileAttributes = {
name = "steam-wrapped";
icon = "steam";
desktopName = "Steam (wrapped)";
};
enableDesktopFile = true;
2022-01-14 17:08:47 +00:00
};
2022-04-26 15:14:08 +00:00
spotify-wrapped = wrapInSandbox {
name = "spotify-wrapped";
launchScriptName = "spotify";
binary = "${prev.spotify}/bin/spotify";
2022-01-14 17:08:47 +00:00
additionalBlacklist = [ "/mnt" ];
2022-04-26 15:14:08 +00:00
mountInHome = [ ".config/spotify" ];
2022-01-14 17:08:47 +00:00
chdirTo = "/home/$USER";
2022-04-26 15:14:08 +00:00
preDesktopFilePhase = ''
cp -Lr ${prev.spotify}/share/icons $out/share/icons
'';
desktopFileAttributes = {
name = "spotify-wrapped";
2022-04-26 15:20:56 +00:00
icon = "spotify-client";
2022-04-26 15:14:08 +00:00
desktopName = "Spotify (wrapped)";
};
enableDesktopFile = true;
2022-01-14 17:08:47 +00:00
};
2022-01-17 20:39:04 +00:00
2022-04-26 15:14:08 +00:00
lutris-free-wrapped = wrapInSandbox {
name = "lutris-free-wrapped";
launchScriptName = "lutris";
binary = "${prev.lutris-free}/bin/lutris";
2022-01-17 20:39:04 +00:00
additionalBlacklist = [ "/mnt" ];
additionalMounts = [
"/mnt/Storage/Games/LeagueOfLegends"
];
2022-04-26 15:14:08 +00:00
mountInHome = [ ".local/share/lutris" ".config/lutris" "Games" ];
2022-01-17 20:39:04 +00:00
chdirTo = "/home/$USER";
2022-04-26 15:14:08 +00:00
preDesktopFilePhase = ''
mkdir -p $out/share/
cp -Lr ${prev.lutris-free}/share/icons $out/share/icons/
'';
desktopFileAttributes = {
name = "lutris-wrapped";
icon = "lutris";
desktopName = "Lutris (wrapped)";
};
enableDesktopFile = true;
2022-01-17 20:39:04 +00:00
};
2022-02-02 14:55:38 +00:00
2022-04-26 15:14:08 +00:00
discord-wrapped = let
discordPkg = prev.discord;
in wrapInSandbox {
name = "discord-wrapped";
launchScriptName = "discord";
binary = "${discordPkg}/bin/discord";
mountInHome = [ ".config/discord" ".config/BetterDiscord" ];
2022-02-02 14:55:38 +00:00
additionalBlacklist = [ "/mnt" ];
chdirTo = "/home/$USER";
2022-04-26 15:14:08 +00:00
preDesktopFilePhase = ''
mkdir -p $out/share/icons
cp -L ${discordPkg}/share/pixmaps/discord.png $out/share/icons/discord.png
'';
desktopFileAttributes = {
name = "discord-wrapped";
#exec = "discord";
icon = "discord";
desktopName = "Discord (wrapped)";
genericName = "Instant Messenger";
#categories = [ "Network" "InstantMessaging" ];
};
enableDesktopFile = true;
};
vortex-wrapped = let
# The path to the wine prefix Vortex is installed in
prefixPath = "/mnt/Storage/Games/NewVortex";
vortexStartScript = prev.writeShellScriptBin "start-vortex.sh" ''
WINEARCH=win64 \
WINEPREFIX=${prefixPath} \
${prev.wineWowPackages.staging}/bin/wine "C:\Program Files\Black Tree Gaming Ltd\Vortex\Vortex.exe"
'';
vortexIcon = builtins.fetchurl {
url = "https://www.nexusmods.com/bootstrap/images/vortex/vortex-logomark.svg";
sha256 = "0237wbbyvgapmmjsq5xab0izzaciqjx1si163r75wa2g7xvz4s22";
};
in wrapInSandbox {
name = "vortex-wrapped";
launchScriptName = "vortex";
binary = "${vortexStartScript}/bin/start-vortex.sh";
chdirTo = "/mnt/Storage/Games/";
additionalBlacklist = [ "/mnt" ];
additionalMounts = [
# TODO: It doesn't work if we restrict it more
"/mnt/Storage"
2022-04-26 15:14:08 +00:00
# Wine prefix
#"/mnt/Storage/Games/NewVortex"
2022-04-26 15:14:08 +00:00
# Mod cache
#"/mnt/Storage/Vortex Mods"
2022-04-26 15:14:08 +00:00
# Only access Skyrim: SE
#"/mnt/Storage/Games/SteamLibrary/SteamLibrary/steamapps/common/Skyrim\ Special\ Edition/"
2022-04-26 15:14:08 +00:00
];
mountInHome = [
# Mod downloads
"Downloads/Skyrim Mods"
];
preDesktopFilePhase = ''
mkdir -p $out/share/icons
cp ${vortexIcon} $out/share/icons/vortex.svg
'';
desktopFileAttributes = {
name = "vortex-wrapped";
icon = "vortex";
desktopName = "Vortex Mod Manager (wrapped)";
};
enableDesktopFile = true;
2022-02-02 14:55:38 +00:00
};
2022-01-14 17:08:47 +00:00
}