From 87fe29f3d8a04903c223f8b046d6d28ec7b7fb0d Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 28 Dec 2025 09:41:13 +0900 Subject: [PATCH] nix: set x-systemd options directly 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 --- nixos.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/nixos.nix b/nixos.nix index 800c81e..ea19329 100644 --- a/nixos.nix +++ b/nixos.nix @@ -25,12 +25,13 @@ let getsubname = userid: appid: "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) { - depends = [ cfg.sharefs.source ]; device = "sharefs"; fsType = "fuse.sharefs"; - noCheck = true; options = [ "rw" "noexec" @@ -42,6 +43,11 @@ let "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}" ]; }; };