nix: set x-systemd options directly
All checks were successful
Test / ShareFS (push) Successful in 40s
Test / Sandbox (race detector) (push) Successful in 44s
Test / Create distribution (push) Successful in 43s
Test / Sandbox (push) Successful in 48s
Test / Hpkg (push) Successful in 49s
Test / Hakurei (push) Successful in 56s
Test / Hakurei (race detector) (push) Successful in 55s
Test / Flake checks (push) Successful in 1m36s

NixOS generates two x-systemd.requires-mounts-for options for some reason, and there seems to be no knob for configuring ordering.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-12-28 09:41:13 +09:00
parent c9cd16fd2a
commit 924e411417

View File

@@ -25,12 +25,15 @@ let
getsubname = userid: appid: "u${toString userid}_a${toString appid}"; getsubname = userid: appid: "u${toString userid}_a${toString appid}";
getsubhome = userid: appid: "${cfg.stateDir}/u${toString userid}/a${toString appid}"; getsubhome = userid: appid: "${cfg.stateDir}/u${toString userid}/a${toString appid}";
mountpoints = { mountpoints =
let
after = "sys-module-fuse.device";
before = "nix-daemon.socket";
in
{
${cfg.sharefs.name} = mkIf (cfg.sharefs.source != null) { ${cfg.sharefs.name} = mkIf (cfg.sharefs.source != null) {
depends = [ cfg.sharefs.source ];
device = "sharefs"; device = "sharefs";
fsType = "fuse.sharefs"; fsType = "fuse.sharefs";
noCheck = true;
options = [ options = [
"rw" "rw"
"noexec" "noexec"
@@ -42,6 +45,11 @@ let
"source=${cfg.sharefs.source}" "source=${cfg.sharefs.source}"
"setuid=${toString config.users.users.${cfg.sharefs.user}.uid}" "setuid=${toString config.users.users.${cfg.sharefs.user}.uid}"
"setgid=${toString config.users.groups.${cfg.sharefs.group}.gid}" "setgid=${toString config.users.groups.${cfg.sharefs.group}.gid}"
"x-systemd.requires=${after}"
"x-systemd.before=${before}"
"x-systemd.required-by=${before}"
"x-systemd.requires-mounts-for=${cfg.sharefs.source}"
]; ];
}; };
}; };