Talk: Samba
From NixOS Wiki
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:
- It's missing "uid="
- 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)
services.samba.settings available on unstable, it does not exist for nixos 24.05
services.samba.settings is available on unstable, it does not exist for nixos 24.05
To use the configuration for 24.05, use services.samba.extraConfig