From 11e2ae7e335c4c0847bfc20a2a4cd7fe898f04b8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas <foodogsquared@foodogsquared.one> Date: Sat, 10 Aug 2024 21:28:31 +0800 Subject: [PATCH] wrapper-manager/sandboxing/boxxy: refactor --- modules/wrapper-manager/sandboxing/boxxy.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/wrapper-manager/sandboxing/boxxy.nix b/modules/wrapper-manager/sandboxing/boxxy.nix index 9bea0768..2a5bbd8e 100644 --- a/modules/wrapper-manager/sandboxing/boxxy.nix +++ b/modules/wrapper-manager/sandboxing/boxxy.nix @@ -99,10 +99,12 @@ in (_: metadata: let inherit (metadata) source destination mode; + ruleArg = + if mode != null + then "${source}:${destination}:${mode}" + else "${source}:${destination}"; in - if mode != null - then "--rule ${source}:${destination}:${mode}" - else "--rule ${source}:${destination}") + "--rule ${lib.escapeShellArg ruleArg}") submoduleCfg.rules); arg0 = lib.getExe submoduleCfg.package;