1 { config, lib, pkgs, ...} :
6 cfg = config.services.orangefs.client;
12 services.orangefs.client = {
13 enable = mkEnableOption (lib.mdDoc "OrangeFS client daemon");
15 extraOptions = mkOption {
16 type = with types; listOf str;
18 description = lib.mdDoc "Extra command line options for pvfs2-client.";
21 fileSystems = mkOption {
22 description = lib.mdDoc ''
23 The orangefs file systems to be mounted.
24 This option is preferred over using {option}`fileSystems` directly since
25 the pvfs client service needs to be running for it to be mounted.
29 mountPoint = "/orangefs";
30 target = "tcp://server:3334/orangefs";
33 type = with types; listOf (submodule ({ ... } : {
36 mountPoint = mkOption {
38 default = "/orangefs";
39 description = lib.mdDoc "Mount point.";
43 type = with types; listOf str;
45 description = lib.mdDoc "Mount options";
50 example = "tcp://server:3334/orangefs";
51 description = lib.mdDoc "Target URL";
62 config = mkIf cfg.enable {
63 environment.systemPackages = [ pkgs.orangefs ];
65 boot.supportedFilesystems = [ "pvfs2" ];
66 boot.kernelModules = [ "orangefs" ];
68 systemd.services.orangefs-client = {
69 requires = [ "network-online.target" ];
70 after = [ "network-online.target" ];
76 ${pkgs.orangefs}/bin/pvfs2-client-core \
77 --logtype=syslog ${concatStringsSep " " cfg.extraOptions}
80 TimeoutStopSec = "120";
84 systemd.mounts = map (fs: {
85 requires = [ "orangefs-client.service" ];
86 after = [ "orangefs-client.service" ];
87 bindsTo = [ "orangefs-client.service" ];
88 wantedBy = [ "remote-fs.target" ];
90 options = concatStringsSep "," fs.options;
92 where = fs.mountPoint;