diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-10-11 04:18:15 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-10-11 04:18:15 +0900 |
| commit | 662f2a9d2cea3f462cf5b508b3719d4d7a722146 (patch) | |
| tree | b1b1deedeeb22c3d09e600f87496cba107cfc939 /internal/app/launch.machinectl.go | |
| parent | 3ddfd76cdf82475a3600f8e1c835bf3529ea6a31 (diff) | |
app: integrate bwrap into environment setup
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'internal/app/launch.machinectl.go')
| -rw-r--r-- | internal/app/launch.machinectl.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/app/launch.machinectl.go b/internal/app/launch.machinectl.go index 19a81aab..59efd553 100644 --- a/internal/app/launch.machinectl.go +++ b/internal/app/launch.machinectl.go @@ -9,7 +9,7 @@ import ( ) func (a *app) commandBuilderMachineCtl(shimEnv string) (args []string) { - args = make([]string, 0, 9+len(a.seal.env)) + args = make([]string, 0, 9+len(a.seal.sys.bwrap.SetEnv)) // shell --uid=$USER args = append(args, "shell", "--uid="+a.seal.sys.Username) @@ -20,12 +20,12 @@ func (a *app) commandBuilderMachineCtl(shimEnv string) (args []string) { } // environ - envQ := make([]string, len(a.seal.env)+1) - for i, e := range a.seal.env { - envQ[i] = "-E" + e + envQ := make([]string, 0, len(a.seal.sys.bwrap.SetEnv)+1) + for k, v := range a.seal.sys.bwrap.SetEnv { + envQ = append(envQ, "-E"+k+"="+v) } // add shim payload to environment for shim path - envQ[len(a.seal.env)] = "-E" + shimEnv + envQ = append(envQ, "-E"+shimEnv) args = append(args, envQ...) // -- .host @@ -44,8 +44,8 @@ func (a *app) commandBuilderMachineCtl(shimEnv string) (args []string) { // apply custom environment variables to activation environment innerCommand.WriteString("dbus-update-activation-environment --systemd") - for _, e := range a.seal.env { - innerCommand.WriteString(" " + strings.SplitN(e, "=", 2)[0]) + for k := range a.seal.sys.bwrap.SetEnv { + innerCommand.WriteString(" " + k) } innerCommand.WriteString("; ") |
