Home Explore Blog Models CI



nixpkgs

1st chunk of `nixos/modules/services/network-filesystems/samba.md`
9870787ae2ebcf65821c41fc8d492199a514efc14fc3fdb200000001000003a9
# Samba {#module-services-samba}

[Samba](https://www.samba.org/), a SMB/CIFS file, print, and login server for Unix.

## Basic Usage {#module-services-samba-basic-usage}

A minimal configuration looks like this:

```nix
{ services.samba.enable = true; }
```

This configuration automatically enables `smbd`, `nmbd` and `winbindd` services by default.

## Configuring {#module-services-samba-configuring}

Samba configuration is located in the `/etc/samba/smb.conf` file.

### File share {#module-services-samba-configuring-file-share}

This configuration will configure Samba to serve a `public` file share
which is read-only and accessible without authentication:

```nix
{
  services.samba = {
    enable = true;
    settings = {
      "public" = {
        "path" = "/public";
        "read only" = "yes";
        "browseable" = "yes";
        "guest ok" = "yes";
        "comment" = "Public samba share.";
      };
    };
  };
}
```

Title: Samba Module Configuration
Summary
This document introduces Samba, an SMB/CIFS file, print, and login server for Unix. It details how to enable Samba with a minimal configuration (`services.samba.enable = true;`), which automatically activates `smbd`, `nmbd`, and `winbindd` services. The main configuration file for Samba is `/etc/samba/smb.conf`. An example is provided for setting up a basic 'public' file share that is read-only, browsable, guest-accessible, and requires no authentication, mapping to the `/public` directory.