mirror of
https://github.com/librephoenix/nixos-config
synced 2025-01-18 22:55:52 +05:30
Firejail to sandbox online games
This commit is contained in:
parent
2459f01634
commit
a81aecff5c
|
@ -11,6 +11,7 @@
|
|||
( import ../../system/app/docker.nix {storageDriver = "btrfs"; inherit username pkgs config lib;} )
|
||||
../../system/app/gamemode.nix
|
||||
../../system/app/steam.nix
|
||||
../../system/app/prismlauncher.nix
|
||||
../../system/security/doas.nix
|
||||
../../system/security/gpg.nix
|
||||
../../system/security/blocklist.nix
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
../../system/security/gpg.nix
|
||||
../../system/security/blocklist.nix
|
||||
../../system/security/firewall.nix
|
||||
../../system/security/firejail.nix
|
||||
../../system/security/openvpn.nix
|
||||
../../system/style/stylix.nix
|
||||
];
|
||||
|
|
5
system/app/prismlauncher.nix
Normal file
5
system/app/prismlauncher.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = [ pkgs.prismlauncher ];
|
||||
}
|
|
@ -3,4 +3,5 @@
|
|||
{
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
programs.steam.enable = true;
|
||||
environment.systemPackages = [ pkgs.steam ];
|
||||
}
|
||||
|
|
51
system/security/firejail-profiles/prismlauncher.profile
Normal file
51
system/security/firejail-profiles/prismlauncher.profile
Normal file
|
@ -0,0 +1,51 @@
|
|||
# Firejail profile for prismlauncher
|
||||
# Description: An Open Source Minecraft launcher that can manage multiple instances
|
||||
# This file is overwritten after every install/update
|
||||
# Persistent global definitions
|
||||
include globals.local
|
||||
|
||||
ignore noexec ${HOME}
|
||||
|
||||
noblacklist ${HOME}/.local/share/PrismLauncher
|
||||
|
||||
include allow-java.inc
|
||||
|
||||
include disable-common.inc
|
||||
include disable-devel.inc
|
||||
include disable-interpreters.inc
|
||||
include disable-programs.inc
|
||||
include disable-shell.inc
|
||||
include disable-xdg.inc
|
||||
|
||||
mkdir ${HOME}/.local/share/PrismLauncher
|
||||
whitelist ${HOME}/.local/share/PrismLauncher
|
||||
include whitelist-common.inc
|
||||
include whitelist-runuser-common.inc
|
||||
include whitelist-usr-share-common.inc
|
||||
include whitelist-var-common.inc
|
||||
|
||||
caps.drop all
|
||||
netfilter
|
||||
nodvd
|
||||
nogroups
|
||||
noinput
|
||||
nonewprivs
|
||||
noroot
|
||||
notv
|
||||
nou2f
|
||||
novideo
|
||||
protocol unix,inet,inet6,netlink
|
||||
seccomp
|
||||
tracelog
|
||||
|
||||
disable-mnt
|
||||
private-bin java,java-config,minecraft-launcher,prismlauncher
|
||||
private-cache
|
||||
private-dev
|
||||
# If multiplayer or realms break, add 'private-etc <your-own-java-folder-from-/etc>'
|
||||
# or 'ignore private-etc' to your minecraft-launcher.local.
|
||||
private-tmp
|
||||
|
||||
dbus-system none
|
||||
|
||||
restrict-namespaces
|
20
system/security/firejail.nix
Normal file
20
system/security/firejail.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [ firejail ];
|
||||
programs.firejail.enable = true;
|
||||
programs.firejail.wrappedBinaries = {
|
||||
prismlauncher = {
|
||||
executable = "${pkgs.prismlauncher}/bin/prismlauncher";
|
||||
profile = ./firejail-profiles/prismlauncher.profile;
|
||||
};
|
||||
steam = {
|
||||
executable = "${pkgs.steam}/bin/steam";
|
||||
profile = "${pkgs.firejail}/etc/firejail/steam.profile";
|
||||
};
|
||||
steam-run = {
|
||||
executable = "${pkgs.steam}/bin/steam-run";
|
||||
profile = "${pkgs.firejail}/etc/firejail/steam.profile";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -14,13 +14,10 @@ in
|
|||
{
|
||||
home.packages = with pkgs; [
|
||||
# Games
|
||||
steam # also requires system-level steam.nix to run
|
||||
gamehub
|
||||
myRetroarch
|
||||
airshipper
|
||||
qjoypad
|
||||
prismlauncher
|
||||
#TODO need flatpak steam - I don't have this declaratively yet
|
||||
];
|
||||
# The following 2 declarations allow retroarch to be imported into gamehub
|
||||
# Set retroarch core directory to ~/.local/bin/libretro
|
||||
|
|
Loading…
Reference in a new issue