Skip to content

Network Shares and Drives

Demi can discover, mount, and manage network shares (NFS, SMB/CIFS) and local drives. Mounts are declared in configuration.nix so they persist across reboots and can be rolled back.

Discovering Shares

Scan a NAS or server to see what's available:

You: scan my NAS at 192.168.1.50 for shares

Demi: ★ mount (action=scan, host=192.168.1.50)
      NFS exports:
        /volume1/media  (everyone)
        /volume1/backups  192.168.1.0/24

      SMB shares:
        //192.168.1.50/media
        //192.168.1.50/photos
        //192.168.1.50/backups

Mounting an NFS Share

You: mount the media share from my NAS for jellyfin

Demi: Plan:
      - Mount 192.168.1.50:/volume1/media at /mnt/media (NFS)
      - Options: nofail, x-systemd.automount (auto-mounts on access)
      - Update jellyfin volume to include /mnt/media:/media:ro

      Ready to proceed?

You: yes

Demi: Mount added. Rebuilding.
      ★ nixos_rebuild (action=switch)
      NFS share mounted at /mnt/media.

Mounting an SMB Share (with credentials)

SMB shares usually need authentication. Demi stores credentials securely:

You: mount //nas.local/photos at /mnt/photos, username erik password hunter2

Demi: Plan:
      - Mount //nas.local/photos at /mnt/photos (CIFS)
      - Credentials stored in /etc/nixos/smb-credentials-mnt-photos (mode 600)
      - Options: nofail, x-systemd.automount

      Note: Change the password from the default if this is sensitive data.

      Ready to proceed?

Credentials are stored in a separate file with restricted permissions (readable only by root), not in configuration.nix. The file format is:

username=erik
password=hunter2

Managing Mounts

You: what mounts do I have?

Demi: ★ mount (action=list)
      Configured mounts (2):
        /mnt/media
          Device: 192.168.1.50:/volume1/media
          Type: nfs
        /mnt/photos
          Device: //nas.local/photos
          Type: cifs

You: are they actually mounted right now?

Demi: ★ mount (action=status)
      /mnt/media  nfs  192.168.1.50:/volume1/media
      /mnt/photos  cifs  //nas.local/photos

You: remove the photos mount

Demi: Removing mount at /mnt/photos. Data on the NAS is not affected.
      Ready to proceed?

Common Setups

Jellyfin/Plex with NAS media:

You: I have a Synology NAS at nas.local with my movies at /volume1/media.
     Set it up for jellyfin.

Demi: Plan:
      1. Mount nas.local:/volume1/media at /mnt/media (NFS, read-only)
      2. Deploy jellyfin with /mnt/media:/media:ro

Shared backup storage:

You: mount the backups share from my NAS so I can back up postgres there

Demi: Plan:
      1. Mount nas.local:/volume1/backups at /mnt/backups (NFS)
      2. You can then schedule: podman exec postgres pg_dump > /mnt/backups/postgres.sql

External USB drive:

You: I plugged in a USB drive labeled "external", mount it

Demi: Plan:
      - Mount /dev/disk/by-label/external at /mnt/external (auto)
      - Options: nofail (won't block boot if unplugged)