aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/fpkg
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2024-12-29 18:32:44 +0900
committerOphestra <cat@gensokyo.uk>2024-12-29 18:32:44 +0900
commitaff80b6b00a5a1f595f12156797bb4fffebab5f1 (patch)
tree4c082a31f5d674ac123bd2f1d7aee95ac819fbdc /cmd/fpkg
parenta98a176907de419d395192f1806b337646f25f78 (diff)
cmd/fpkg: optional network access when invoking with nix daemon
This is useful for building nixGL. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/fpkg')
-rw-r--r--cmd/fpkg/install.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/fpkg/install.go b/cmd/fpkg/install.go
index 988f4a86..0b7ce7a6 100644
--- a/cmd/fpkg/install.go
+++ b/cmd/fpkg/install.go
@@ -154,7 +154,7 @@ func actionInstall(args []string) {
"rm -rf .local/state/{nix,home-manager}",
// run activation script
bundle.ActivationPackage + "/activate",
- }, workDir, bundle, pathSet, dropShellActivate, cleanup)
+ }, false, workDir, bundle, pathSet, dropShellActivate, cleanup)
/*
Installation complete. Write metadata to block re-installs or downgrades.
@@ -183,7 +183,7 @@ func actionInstall(args []string) {
cleanup()
}
-func withNixDaemon(action string, command []string, workDir string, bundle *bundleInfo, pathSet *appPathSet, dropShell bool, beforeFail func()) {
+func withNixDaemon(action string, command []string, net bool, workDir string, bundle *bundleInfo, pathSet *appPathSet, dropShell bool, beforeFail func()) {
fortifyAppDropShell(&fst.Config{
ID: bundle.ID,
Command: []string{shell, "-lc", "rm -f /nix/var/nix/daemon-socket/socket && " +
@@ -204,6 +204,7 @@ func withNixDaemon(action string, command []string, workDir string, bundle *bund
Sandbox: &fst.SandboxConfig{
Hostname: formatHostname(bundle.Name) + "-" + action,
UserNS: true, // nix sandbox requires userns
+ Net: net,
NoNewSession: dropShell,
Filesystem: []*fst.FilesystemConfig{
{Src: pathSet.nixPath, Dst: "/nix", Write: true, Must: true},