Home Explore Blog Models CI



nixpkgs

nixos/modules/services/network-filesystems/samba.md
6337859115648e0867c0500501d65ec4baf307c0ea3a3aa300000003000003a9
# 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.";
      };
    };
  };
}
```

Chunks
9870787a (1st chunk of `nixos/modules/services/network-filesystems/samba.md`)
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.