mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
wrapper-manager/sandboxing/bubblewrap: fix config
This commit is contained in:
parent
bf51e0dcde
commit
50e7d29620
@ -120,7 +120,7 @@ in
|
||||
|
||||
bubblewrapModule = { config, lib, pkgs, name, ... }:
|
||||
let
|
||||
submoduleCfg = config;
|
||||
submoduleCfg = config.sandboxing.bubblewrap;
|
||||
in
|
||||
{
|
||||
options.sandboxing.bubblewrap =
|
||||
@ -151,7 +151,7 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.sandboxing.variant == "bubblewrap") {
|
||||
bubblewrap.dbus.filter.extraArgs =
|
||||
sandboxing.bubblewrap.dbus.filter.extraArgs =
|
||||
let
|
||||
makeDbusProxyArgs = address: metadata:
|
||||
[ address metadata.path ] ++ metadata.extraArgs;
|
||||
|
@ -121,7 +121,7 @@ in
|
||||
# TODO: All of the Linux-exclusive flags could be handled by the
|
||||
# launcher instead. ALSO MODULARIZE THIS CRAP!
|
||||
# Ordering of the arguments here matter(?).
|
||||
bubblewrap.extraArgs =
|
||||
sandboxing.bubblewrap.extraArgs =
|
||||
cfg.extraArgs
|
||||
++ lib.optionals stdenv.isLinux [
|
||||
"--proc" "/proc"
|
||||
@ -138,14 +138,14 @@ in
|
||||
}
|
||||
|
||||
(lib.mkIf submoduleCfg.enableSharedNixStore {
|
||||
bubblewrap.binds.ro = [ builtins.storeDir ] ++ lib.optionals (builtins.storeDir != "/nix/store") [ "/nix/store" ];
|
||||
sandboxing.bubblewrap.binds.ro = [ builtins.storeDir ] ++ lib.optionals (builtins.storeDir != "/nix/store") [ "/nix/store" ];
|
||||
})
|
||||
|
||||
(lib.mkIf submoduleCfg.enableNetwork {
|
||||
# In case isolation is also enabled, we'll have this still
|
||||
# enabled at least.
|
||||
bubblewrap.extraArgs = lib.mkAfter [ "--share-net" ];
|
||||
bubblewrap.binds.ro = [
|
||||
sandboxing.bubblewrap.extraArgs = lib.mkAfter [ "--share-net" ];
|
||||
sandboxing.bubblewrap.binds.ro = [
|
||||
"/etc/ssh"
|
||||
"/etc/hosts"
|
||||
"/etc/resolv.conf"
|
||||
@ -153,7 +153,8 @@ in
|
||||
})
|
||||
|
||||
(lib.mkIf submoduleCfg.enableIsolation {
|
||||
bubblewrap.extraArgs = lib.mkBefore [ "--unshare-all" ];
|
||||
sandboxing.bubblewrap.extraArgs = lib.mkBefore [ "--unshare-all" ];
|
||||
})
|
||||
})
|
||||
]);
|
||||
};
|
||||
|
@ -77,7 +77,7 @@ in
|
||||
options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = false; };
|
||||
|
||||
config = lib.mkIf (config.sandboxing.variant == "bubblewrap") {
|
||||
bubblewrap.extraArgs =
|
||||
sandboxing.bubblewrap.filesystem =
|
||||
lib.lists.flatten
|
||||
(lib.mapAttrsToList
|
||||
(dst: metadata:
|
||||
|
Loading…
Reference in New Issue
Block a user