cmd/sharefs: create directory as root
All checks were successful
Test / Create distribution (push) Successful in 42s
Test / Sandbox (push) Successful in 2m20s
Test / Hakurei (push) Successful in 3m30s
Test / Sandbox (race detector) (push) Successful in 4m42s
Test / Flake checks (push) Successful in 1m36s
Test / ShareFS (push) Successful in 3m26s
Test / Hpkg (push) Successful in 4m19s
Test / Hakurei (race detector) (push) Successful in 5m30s

This optional behaviour is required on NixOS as it is otherwise impossible to set this up: systemd.mounts breaks startup order somehow even though my unit looks identical to generated ones, fileSystems does not support any kind of initialisation or ordering other than against other mount points.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-12-27 22:09:55 +09:00
parent ef1ebf12d9
commit e7982b4ee9
3 changed files with 36 additions and 5 deletions

View File

@@ -73,11 +73,7 @@ in
NoNewPrivileges = true;
};
script = ''
${pkgs.coreutils}/bin/install \
-dm0700 \
-o ${cfg.sharefs.user} \
-g ${cfg.sharefs.group} \
${cfg.sharefs.source} ${cfg.sharefs.name}
${pkgs.coreutils}/bin/install -dm0 ${cfg.sharefs.name}
exec ${cfg.package}/libexec/sharefs -f \
-o ${
@@ -91,6 +87,7 @@ in
"setuid=$(id -u ${cfg.sharefs.user})"
"setgid=$(id -g ${cfg.sharefs.group})"
"source=${cfg.sharefs.source}"
"mkdir"
]
} ${cfg.sharefs.name}
'';