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,26 +25,34 @@ let
getsubname = userid: appid: "u${toString userid}_a${toString appid}";
getsubhome = userid: appid: "${cfg.stateDir}/u${toString userid}/a${toString appid}";
mountpoints = {
${cfg.sharefs.name} = mkIf (cfg.sharefs.source != null) {
depends = [ cfg.sharefs.source ];
device = "sharefs";
fsType = "fuse.sharefs";
noCheck = true;
options = [
"rw"
"noexec"
"nosuid"
"nodev"
"noatime"
"allow_other"
"mkdir"
"source=${cfg.sharefs.source}"
"setuid=${toString config.users.users.${cfg.sharefs.user}.uid}"
"setgid=${toString config.users.groups.${cfg.sharefs.group}.gid}"
];
mountpoints =
let
after = "sys-module-fuse.device";
before = "nix-daemon.socket";
in
{
${cfg.sharefs.name} = mkIf (cfg.sharefs.source != null) {
device = "sharefs";
fsType = "fuse.sharefs";
options = [
"rw"
"noexec"
"nosuid"
"nodev"
"noatime"
"allow_other"
"mkdir"
"source=${cfg.sharefs.source}"
"setuid=${toString config.users.users.${cfg.sharefs.user}.uid}"
"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}"
];
};
};
};
in
{