Mount Moosefs share on nixos using configuration.nix

Hi, I’m very new to nixos and at the moment I’m testing a lot of thigs I usually use at work.

Usually I would connect to my moosefs share with the following line in my /etc/fstab

mfsmount /mnt/mfs fuse mfsmaster=mfs-master01,_netdev 0 0

How does this translate to the configuration.nix file?

You just need to enable the client side utilities and add entry to fileSystems`:

   services.moosefs.client.enable = true;
   fileSystems = {
      "/mnt/mfs" = {
        fsType = "moosefs";
        device = "mfs-master01:/";
        options = [ "_netdev" ];

Worked first try, thank you. I expected it to be a bit more complicated to be honest.
Is there any documentation I can reference for stuff like setting up master, metalogger and chunk servers?

1 Like

All the options are listed here:

The services.moosefs.*.settings parameters takes the config file options for the config files. I.e.,this example configures chunk server and a metalogger:

    services.moosefs = {
      client.enable = true;
      masterHost = "mfsmaster";
      metalogger = {
        enable = true;
        settings.DATA_PATH = "/srv/moosefs/meta/logger";
      chunkserver = {
        enable = true;
        hdds = [ "~/srv/moosefs/data" ];
        settings = {
          DATA_PATH = "/srv/moosefs/meta/chuncks";
          LABELS = "A";

Thanks, this is very helpful.

1 Like