programs: sandbox: allow all programs to access media
hopefully this is just a stopgap
This commit is contained in:
@@ -40,12 +40,24 @@ let
|
|||||||
let
|
let
|
||||||
makeSandboxed = pkgs.callPackage ./make-sandboxed.nix { sane-sandboxed = config.sane.sandboxHelper; };
|
makeSandboxed = pkgs.callPackage ./make-sandboxed.nix { sane-sandboxed = config.sane.sandboxHelper; };
|
||||||
vpn = lib.findSingle (v: v.default) null null (builtins.attrValues config.sane.vpn);
|
vpn = lib.findSingle (v: v.default) null null (builtins.attrValues config.sane.vpn);
|
||||||
|
# TODO: restrict access to these media paths a bit more.
|
||||||
|
# maybe mount them user=nobody and restrict based on group?
|
||||||
|
mediaHomePaths = [
|
||||||
|
"Books"
|
||||||
|
"Music"
|
||||||
|
"Pictures"
|
||||||
|
"Videos"
|
||||||
|
"tmp"
|
||||||
|
];
|
||||||
|
mediaRootPaths = [
|
||||||
|
"/mnt/servo-media"
|
||||||
|
];
|
||||||
in
|
in
|
||||||
makeSandboxed {
|
makeSandboxed {
|
||||||
inherit pkgName package;
|
inherit pkgName package;
|
||||||
inherit (sandbox) binMap method;
|
inherit (sandbox) binMap method;
|
||||||
vpn = if net == "vpn" then vpn else null;
|
vpn = if net == "vpn" then vpn else null;
|
||||||
allowedHomePaths = builtins.attrNames fs ++ builtins.attrNames persist.byPath;
|
allowedHomePaths = builtins.attrNames fs ++ builtins.attrNames persist.byPath ++ mediaHomePaths;
|
||||||
allowedRootPaths = [
|
allowedRootPaths = [
|
||||||
"/nix/store"
|
"/nix/store"
|
||||||
"/etc" #< especially for /etc/profiles/per-user/$USER/bin
|
"/etc" #< especially for /etc/profiles/per-user/$USER/bin
|
||||||
@@ -58,7 +70,7 @@ let
|
|||||||
"/run/opengl-driver-32"
|
"/run/opengl-driver-32"
|
||||||
"/run/user" #< particularly /run/user/$id/wayland-1, pulse, etc.
|
"/run/user" #< particularly /run/user/$id/wayland-1, pulse, etc.
|
||||||
# "/dev/dri" #< fix non-fatal "libEGL warning: wayland-egl: could not open /dev/dri/renderD128" (geary)
|
# "/dev/dri" #< fix non-fatal "libEGL warning: wayland-egl: could not open /dev/dri/renderD128" (geary)
|
||||||
];
|
] ++ mediaRootPaths;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
pkgSpec = with lib; types.submodule ({ config, name, ... }: {
|
pkgSpec = with lib; types.submodule ({ config, name, ... }: {
|
||||||
|
Reference in New Issue
Block a user