Skip to content

Commit 83253c7

Browse files
committed
firejail
1 parent 2c54ceb commit 83253c7

File tree

1 file changed

+88
-5
lines changed

1 file changed

+88
-5
lines changed

nix/configuration.nix

Lines changed: 88 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
"err.ee"
5050
"delfi.ee"
5151
"postimees.ee"
52-
"rumble.com"
53-
"odysee.com"
54-
"bastyon.com"
55-
"bitchute.com"
52+
# "rumble.com"
53+
# "odysee.com"
54+
# "bastyon.com"
55+
# "bitchute.com"
5656
]
5757
else []
5858
));
@@ -87,6 +87,75 @@
8787
${pkgs.glib}/bin/gsettings set $gnome_schema gtk-theme 'Dracula'
8888
'';
8989
};
90+
mkFirejailSimple = pkg: {
91+
"${pkg}" = {
92+
executable = "${pkgs."${pkg}"}/bin/${pkg}";
93+
profile = "${pkgs.firejail}/etc/firejail/${pkg}.profile";
94+
};
95+
};
96+
mkFirejailCustom = {
97+
pkg,
98+
exe,
99+
cfg ? "",
100+
}: {
101+
"${pkg}" = {
102+
executable = exe;
103+
profile = pkgs.writeText "${pkg}.local" (
104+
''
105+
include default.profile
106+
107+
include disable-X11.inc
108+
include disable-common.inc
109+
include disable-devel.inc
110+
include disable-exec.inc
111+
include disable-interpreters.inc
112+
include disable-proc.inc
113+
include disable-programs.inc
114+
include disable-shell.inc
115+
include disable-write-mnt.inc
116+
include disable-xdg.inc
117+
118+
# no3d
119+
# nosound
120+
apparmor
121+
caps.drop all
122+
machine-id
123+
net none
124+
netfilter
125+
nodvd
126+
nogroups
127+
noinput
128+
nonewprivs
129+
noprinters
130+
noroot
131+
notv
132+
nou2f
133+
novideo
134+
shell none
135+
136+
disable-mnt
137+
private ''${HOME}/.firejail/${pkg}
138+
private-bin none
139+
private-cache
140+
private-cwd
141+
private-dev
142+
private-etc none
143+
private-lib none
144+
private-opt none
145+
private-srv none
146+
private-tmp
147+
seccomp
148+
x11 none
149+
150+
dbus-system none
151+
dbus-user none
152+
153+
restrict-namespaces
154+
''
155+
+ cfg
156+
);
157+
};
158+
};
90159
mkKbd = cfg: dev: {
91160
config = cfg;
92161
device = dev;
@@ -724,6 +793,21 @@ in {
724793
via
725794
];
726795

796+
#
797+
# Firejail
798+
#
799+
programs.firejail.enable = true;
800+
programs.firejail.wrappedBinaries =
801+
mkFirejailSimple "xonotic"
802+
// mkFirejailCustom {
803+
pkg = "doom";
804+
exe = ''
805+
${pkgs.gzdoom}/bin/gzdoom \
806+
-iwad ./mods/freedoom-0.13.0/freedoom2.wad \
807+
-file ./mods/brutalv22test4.pk3
808+
'';
809+
};
810+
727811
#
728812
# Home
729813
#
@@ -796,7 +880,6 @@ in {
796880
gnome.simple-scan
797881
system-config-printer
798882
pulsemixer
799-
xonotic
800883
];
801884
programs.git = {
802885
enable = true;

0 commit comments

Comments
 (0)