Skip to content

Commit c98702d

Browse files
committed
sandbox prismlauncher
1 parent ad498b1 commit c98702d

3 files changed

Lines changed: 89 additions & 3 deletions

File tree

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
lib,
3+
pkgs,
4+
inputs,
5+
config,
6+
...
7+
}:
8+
let
9+
config' = config;
10+
mkNixPak = inputs.nixpak.lib.nixpak {
11+
inherit pkgs lib;
12+
};
13+
prismlauncher' = mkNixPak {
14+
config =
15+
{ sloth, config, ... }:
16+
{
17+
etc.sslCertificates.enable = true;
18+
dbus.policies = {
19+
"${config.flatpak.appId}" = "own";
20+
"${config.flatpak.appId}.*" = "own";
21+
"org.freedesktop.DBus" = "talk";
22+
"org.gtk.vfs.*" = "talk";
23+
"org.gtk.vfs" = "talk";
24+
"ca.desrt.dconf" = "talk";
25+
"org.freedesktop.portal.*" = "talk";
26+
"org.a11y.Bus" = "talk";
27+
};
28+
gpu = {
29+
enable = true;
30+
provider = "nixos";
31+
};
32+
app.package = config'.uwumarie.prismlauncher.package;
33+
flatpak.appId = "org.prismlauncher.PrismLauncher";
34+
bubblewrap = {
35+
bind.rw = [
36+
sloth.xdgDownloadDir
37+
(sloth.concat' sloth.homeDir "/.ftba")
38+
(sloth.concat' sloth.homeDir "/.local/share/PrismLauncher")
39+
"/sys/kernel/mm/hugepages"
40+
"/sys/kernel/mm/transparent_hugepage"
41+
[
42+
sloth.appCacheDir
43+
sloth.xdgCacheHome
44+
]
45+
(sloth.concat' sloth.xdgCacheHome "/fontconfig")
46+
(sloth.concat' sloth.xdgCacheHome "/mesa_shader_cache")
47+
(sloth.concat' sloth.xdgCacheHome "/mesa_shader_cache_db")
48+
(sloth.concat' sloth.xdgCacheHome "/radv_builtin_shaders")
49+
50+
(sloth.concat' sloth.runtimeDir "/at-spi/bus")
51+
(sloth.concat' sloth.runtimeDir "/gvfsd")
52+
(sloth.concat' sloth.runtimeDir "/dconf")
53+
(sloth.concat' sloth.runtimeDir "/doc")
54+
];
55+
bind.ro = [
56+
(sloth.concat' sloth.xdgConfigHome "/gtk-2.0")
57+
(sloth.concat' sloth.xdgConfigHome "/gtk-3.0")
58+
(sloth.concat' sloth.xdgConfigHome "/gtk-4.0")
59+
(sloth.concat' sloth.xdgConfigHome "/fontconfig")
60+
(sloth.concat' sloth.xdgConfigHome "/dconf")
61+
(sloth.concat' sloth.xdgConfigHome "/kdeglobals")
62+
];
63+
sockets = {
64+
wayland = true;
65+
x11 = true;
66+
pulse = true;
67+
};
68+
network = true;
69+
bind.dev = [ "/dev/input" ];
70+
};
71+
};
72+
};
73+
in
74+
{
75+
options.uwumarie.prismlauncher = {
76+
enable = lib.mkEnableOption "prismlauncher";
77+
package = lib.mkPackageOption pkgs "prismlauncher" { };
78+
};
79+
config = lib.mkIf config.uwumarie.prismlauncher.enable {
80+
environment.systemPackages = [ prismlauncher'.config.env ];
81+
};
82+
}

config/nixos/module-list.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
./applications/nginx.nix
44
./applications/nix.nix
55
./applications/openssh.nix
6+
./applications/prismlauncher.nix
67
./applications/tailscale.nix
78
./applications/valkey.nix
89
./applications/tools.nix

hosts/marie-desktop/gaming.nix

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55
...
66
}:
77
{
8-
environment.systemPackages = with pkgs; [
9-
(prismlauncher.override {
8+
uwumarie.prismlauncher = {
9+
enable = true;
10+
package = pkgs.prismlauncher.override {
1011
jdks = [
1112
pkgs.jdk21
1213
pkgs.jdk25
1314
];
14-
})
15+
};
16+
};
17+
environment.systemPackages = with pkgs; [
1518
heroic
1619
winetricks
1720
wineWowPackages.unstable

0 commit comments

Comments
 (0)