1 { config, lib, pkgs, ...} :
3 cfg = config.services.orangefs.client;
9 services.orangefs.client = {
10 enable = lib.mkEnableOption "OrangeFS client daemon";
12 extraOptions = lib.mkOption {
13 type = with lib.types; listOf str;
15 description = "Extra command line options for pvfs2-client.";
18 fileSystems = lib.mkOption {
20 The orangefs file systems to be mounted.
21 This option is preferred over using {option}`fileSystems` directly since
22 the pvfs client service needs to be running for it to be mounted.
26 mountPoint = "/orangefs";
27 target = "tcp://server:3334/orangefs";
30 type = with lib.types; listOf (submodule ({ ... } : {
33 mountPoint = lib.mkOption {
35 default = "/orangefs";
36 description = "Mount point.";
39 options = lib.mkOption {
40 type = with lib.types; listOf str;
42 description = "Mount options";
45 target = lib.mkOption {
47 example = "tcp://server:3334/orangefs";
48 description = "Target URL";
59 config = lib.mkIf cfg.enable {
60 environment.systemPackages = [ pkgs.orangefs ];
62 boot.supportedFilesystems = [ "pvfs2" ];
63 boot.kernelModules = [ "orangefs" ];
65 systemd.services.orangefs-client = {
66 requires = [ "network-online.target" ];
67 after = [ "network-online.target" ];
73 ${pkgs.orangefs}/bin/pvfs2-client-core \
74 --logtype=syslog ${lib.concatStringsSep " " cfg.extraOptions}
77 TimeoutStopSec = "120";
81 systemd.mounts = map (fs: {
82 requires = [ "orangefs-client.service" ];
83 after = [ "orangefs-client.service" ];
84 bindsTo = [ "orangefs-client.service" ];
85 wantedBy = [ "remote-fs.target" ];
87 options = lib.concatStringsSep "," fs.options;
89 where = fs.mountPoint;