Commit e7bcab80 authored by Pascal Bach's avatar Pascal Bach
Browse files

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.
parent fab6b97b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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