aboutsummaryrefslogtreecommitdiffhomepage
path: root/nixos.nix
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-03-25 01:52:49 +0900
committerOphestra <cat@gensokyo.uk>2025-03-25 01:52:49 +0900
commit5c4058d5ac7e7944973ca8216c258fc50c194e22 (patch)
treec06597903233c75eca5a1edae8b06d93f0f81774 /nixos.nix
parente732dca7629edb503df0c65df5f37a99600d567d (diff)
app: run in native sandbox
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'nixos.nix')
-rw-r--r--nixos.nix21
1 files changed, 9 insertions, 12 deletions
diff --git a/nixos.nix b/nixos.nix
index 37ef5563..2c5b5db9 100644
--- a/nixos.nix
+++ b/nixos.nix
@@ -86,12 +86,11 @@ in
enablements = with app.capability; (if wayland then 1 else 0) + (if x11 then 2 else 0) + (if dbus then 4 else 0) + (if pulse then 8 else 0);
conf = {
inherit (app) id;
- command = [
- (pkgs.writeScript "${app.name}-start" ''
- #!${pkgs.zsh}${pkgs.zsh.shellPath}
- ${script}
- '')
- ];
+ path = pkgs.writeScript "${app.name}-start" ''
+ #!${pkgs.zsh}${pkgs.zsh.shellPath}
+ ${script}
+ '';
+ args = [ "${app.name}-start" ];
confinement = {
app_id = aid;
inherit (app) groups;
@@ -99,17 +98,15 @@ in
home = getsubhome fid aid;
sandbox = {
inherit (app)
+ devel
userns
net
dev
+ tty
+ multiarch
env
;
- syscall = {
- inherit (app) compat multiarch bluetooth;
- deny_devel = !app.devel;
- };
map_real_uid = app.mapRealUid;
- no_new_session = app.tty;
direct_wayland = app.insecureWayland;
filesystem =
let
@@ -149,7 +146,7 @@ in
]
++ app.extraPaths;
auto_etc = true;
- override = [ "/var/run/nscd" ];
+ cover = [ "/var/run/nscd" ];
};
inherit enablements;
inherit (dbusConfig) session_bus system_bus;