mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-04-25 18:19:10 +00:00
wrapper-manager/sandboxing/bubblewrap: update closure path mount binds
It could be done by removing the string context but it is more tedious to maintain in the long run so it would be best to have them separate.
This commit is contained in:
parent
c127b79eb1
commit
7524d87b49
@ -173,12 +173,12 @@ let
|
|||||||
|
|
||||||
# TODO: There has to be a better way to get this info without relying on
|
# TODO: There has to be a better way to get this info without relying on
|
||||||
# pkgs.closureInfo builder, right?
|
# pkgs.closureInfo builder, right?
|
||||||
getClosurePaths = rootpaths:
|
getClosurePaths = rootPaths:
|
||||||
let
|
let
|
||||||
sharedNixPathsClosureInfo = pkgs.closureInfo { inherit rootpaths; };
|
sharedNixPathsClosureInfo = pkgs.closureInfo { inherit rootPaths; };
|
||||||
closurePaths = lib.readFile "${sharedNixPathsClosureInfo}/store-paths";
|
closurePaths = lib.readFile "${sharedNixPathsClosureInfo}/store-paths";
|
||||||
in
|
in
|
||||||
lib.lists.filter (p: p != "") (lib.splitStrings "\n" closurePaths);
|
lib.lists.filter (p: p != "") (lib.splitString "\n" closurePaths);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = true; };
|
options.sandboxing.bubblewrap = bubblewrapModuleFactory { isGlobal = true; };
|
||||||
@ -198,7 +198,6 @@ in
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
sandboxing.bubblewrap.binds.ro = getClosurePaths submoduleCfg.sharedNixPaths;
|
|
||||||
sandboxing.bubblewrap.filesystem =
|
sandboxing.bubblewrap.filesystem =
|
||||||
let
|
let
|
||||||
renameNixStorePaths = path:
|
renameNixStorePaths = path:
|
||||||
@ -241,6 +240,14 @@ in
|
|||||||
(lib.mkIf submoduleCfg.enableSharedNixStore {
|
(lib.mkIf submoduleCfg.enableSharedNixStore {
|
||||||
sandboxing.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.sharedNixPaths != [ ]) {
|
||||||
|
sandboxing.bubblewrap.extraArgs =
|
||||||
|
let
|
||||||
|
closurePaths = getClosurePaths submoduleCfg.sharedNixPaths;
|
||||||
|
in
|
||||||
|
builtins.map (p: "--ro-bind ${lib.escapeShellArg p} ${lib.escapeShellArg p}") closurePaths;
|
||||||
|
})
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
Loading…
Reference in New Issue
Block a user