aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/hpkg/with.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-26 00:52:49 +0900
committerOphestra <cat@gensokyo.uk>2025-08-26 00:56:10 +0900
commitc9facb746b7be0f2d8f6b9b2227340ba2ec12060 (patch)
tree7a48ac5212b45908ecc5df7b08a0fc75c54fc7db /cmd/hpkg/with.go
parent878b66022e7573ca89fd1fbc266133c7776a98dd (diff)
hst/config: remove data field, rename dir to home
There is no reason to give the home directory special treatment, as this behaviour can be quite confusing. The home directory also does not necessarily require its own mount point, it could be provided by a parent or simply be ephemeral. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/hpkg/with.go')
-rw-r--r--cmd/hpkg/with.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/hpkg/with.go b/cmd/hpkg/with.go
index 03b2e5f1..1895a06f 100644
--- a/cmd/hpkg/with.go
+++ b/cmd/hpkg/with.go
@@ -33,8 +33,7 @@ func withNixDaemon(
Username: "hakurei",
Shell: pathShell,
- Data: pathSet.homeDir,
- Dir: pathDataData.Append(app.ID),
+ Home: pathDataData.Append(app.ID),
ExtraPerms: []*hst.ExtraPermConfig{
{Path: dataHome, Execute: true},
{Ensure: true, Path: pathSet.baseDir, Read: true, Write: true, Execute: true},
@@ -54,6 +53,7 @@ func withNixDaemon(
{FilesystemConfig: &hst.FSLink{Target: pathCurrentSystem, Linkname: app.CurrentSystem.String()}},
{FilesystemConfig: &hst.FSLink{Target: pathBin, Linkname: pathSwBin.String()}},
{FilesystemConfig: &hst.FSLink{Target: container.AbsFHSUsrBin, Linkname: pathSwBin.String()}},
+ {FilesystemConfig: &hst.FSBind{Target: pathDataData.Append(app.ID), Source: pathSet.homeDir, Write: true, Ensure: true}},
},
},
}), dropShell, beforeFail)
@@ -71,8 +71,7 @@ func withCacheDir(
Username: "nixos",
Shell: pathShell,
- Data: pathSet.cacheDir, // this also ensures cacheDir via shim
- Dir: pathDataData.Append(app.ID, "cache"),
+ Home: pathDataData.Append(app.ID, "cache"),
ExtraPerms: []*hst.ExtraPermConfig{
{Path: dataHome, Execute: true},
{Ensure: true, Path: pathSet.baseDir, Read: true, Write: true, Execute: true},
@@ -92,6 +91,7 @@ func withCacheDir(
{FilesystemConfig: &hst.FSLink{Target: pathBin, Linkname: pathSwBin.String()}},
{FilesystemConfig: &hst.FSLink{Target: container.AbsFHSUsrBin, Linkname: pathSwBin.String()}},
{FilesystemConfig: &hst.FSBind{Source: workDir, Target: hst.AbsTmp.Append("bundle")}},
+ {FilesystemConfig: &hst.FSBind{Target: pathDataData.Append(app.ID, "cache"), Source: pathSet.cacheDir, Write: true, Ensure: true}},
},
},
}, dropShell, beforeFail)