nixos/samba: ensure global section is always first
The order of the [global] section matters as settings defined there are only applied to shares that are defines after it.
This commit is contained in:
@@ -6,7 +6,11 @@ let
|
||||
cfg = config.services.samba;
|
||||
|
||||
settingsFormat = pkgs.formats.ini { };
|
||||
configFile = settingsFormat.generate "smb.conf" cfg.settings;
|
||||
# Ensure the global section is always first
|
||||
globalConfigFile = settingsFormat.generate "smb-global.conf" { global = cfg.settings.global; };
|
||||
sharesConfigFile = settingsFormat.generate "smb-shares.conf" (lib.removeAttrs cfg.settings [ "global" ]);
|
||||
|
||||
configFile = pkgs.concatText "smb.conf" [ globalConfigFile sharesConfigFile ];
|
||||
|
||||
in
|
||||
|
||||
|
||||
Reference in New Issue
Block a user