1 { config, lib, pkgs, ... }:
6 cfg = config.services.u9fs;
17 description = lib.mdDoc "Whether to run the u9fs 9P server for Unix.";
20 listenStreams = mkOption {
21 type = types.listOf types.str;
23 example = [ "192.168.16.1:564" ];
24 description = lib.mdDoc ''
25 Sockets to listen for clients on.
26 See {command}`man 5 systemd.socket` for socket syntax.
34 lib.mdDoc "User to run u9fs under.";
37 extraArgs = mkOption {
43 Extra arguments to pass on invocation,
44 see {command}`man 4 u9fs`
52 config = mkIf cfg.enable {
56 description = "U9fs Listening Socket";
57 wantedBy = [ "sockets.target" ];
58 after = [ "network.target" ];
59 inherit (cfg) listenStreams;
60 socketConfig.Accept = "yes";
63 description = "9P Protocol Server";
64 reloadIfChanged = true;
65 requires = [ "u9fs.socket" ];
67 { ExecStart = "-${pkgs.u9fs}/bin/u9fs ${cfg.extraArgs}";
68 StandardInput = "socket";
69 StandardError = "journal";
71 AmbientCapabilities = "cap_setuid cap_setgid";