-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/samba: migrate to structural settings (RFC42) #302681
Conversation
@ofborg test samba |
3adf657
to
7d780cc
Compare
ed753ae
to
eaf3910
Compare
eaf3910
to
5d12ce4
Compare
Fixed merge conflict |
5d12ce4
to
9b0a4d2
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/4040 |
Rebased against master branch and fixed merge conflict |
473caea
to
345deec
Compare
345deec
to
516aef2
Compare
Hello @trofi, I noticed that you've recently modified the Samba package. So I thought you might be interested in reviewing this pull request to migrate the NixOS Samba module to RFC42 :) |
Looks like the |
@misuzu Hello, thank you for pointing this out. The smb.conf documentation does not mention anything about the section ordering, especially regarding the special global section. But yes indeed, you're right, I was able to reproduce the issue you mentioned with the following configuration: services.samba = {
enable = true;
openFirewall = true;
settings = {
global = {
"guest ok" = true;
};
"public" = {
"path" = "/public";
"browseable" = "yes";
"comment" = "Public samba share.";
};
"Shared" = {
"path" = "/shared";
"browseable" = "yes";
"comment" = "Shared samba share.";
};
};
};
}; In this configuration, the public share will allow guest access, while the Shared share won't. I see a few possible ways to address this issue:
Does anyone have any other ideas? Unfortunately, I’m not available to work on this today. |
There is no need to split the section from a user perspective. We can also do this via somthing along the lines of:
However I'm not sure how to tell |
I think I found a solution in #341257 I just ran the samba module test |
Follows changes made in NixOS/nixpkgs#302681
|
||
restartTriggers = [ configFile ]; | ||
}; | ||
settingsFormat = pkgs.formats.ini { }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Samba settings aren't strict INI so this breaks things - specifically configuring extensions like fruit:appl = yes
for enabling the Darwin compatibility layer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Thank you for the feedback.
Could you provide an example where this configuration isn’t working as expected, please?
To configure fruit:appl = yes
for vfs_fruit
, you can use this syntax:
services.samba.settings.global."fruit:appl" = "yes";
Hi. I've update the NixOS Wiki article: https://nixos.wiki/index.php?title=Samba&diff=13441&oldid=13357 Cheers! |
Thank you @brookst. There is also https://wiki.nixos.org/wiki/Samba which is linked from the official nixos.org page. Maybe it makes sense to update there too. |
Description of changes
See RFC42
Also see #302645
TODO / Work in progress:
Also planned later:
with lib;
(in another PR)This PR is a requirement to start the work on Samba AD DC NixOS module.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.