Talk: Samba

From NixOS Wiki
Revision as of 15:10, 23 February 2024 by Freelancer42 (talk | contribs) (Created page with "The "mount as user" section on this page suggests the following to pull the uid and gid from the configuration: <syntaxhighlight lang="nix"> ["${automount_opts},credentials=/...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The "mount as user" section on this page suggests the following to pull the uid and gid from the configuration:

["${automount_opts},credentials=/etc/nixos/smb-secrets,${config.users.users.<username>.uid},gid=${config.users.groups.<group>.gid}"];

Two issues with this:

  1. It's missing "uid="
  2. The uid and gid attributes are integers, and nix refuses to coerce them to strings


It should probably read something like this (which is working for me):

["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=${toString config.users.users.<username>.uid},gid=${toString config.users.groups.<group>.gid}"];


I'm very new to NixOS though so I don't want to update the page in case I've missed something.

--Freelancer42 (talk) 15:10, 23 February 2024 (UTC)