From 46db91c0d789d62d5e44e9ef01f97b12f465c33e Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Fri, 7 Jun 2024 08:43:54 +0200 Subject: [PATCH] nixos/samba: only create /etc/samba/smb.conf when samba is enabled --- nixos/modules/services/network-filesystems/samba.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nixos/modules/services/network-filesystems/samba.nix b/nixos/modules/services/network-filesystems/samba.nix index 66ef3f14ed70..c70d0cf7beac 100644 --- a/nixos/modules/services/network-filesystems/samba.nix +++ b/nixos/modules/services/network-filesystems/samba.nix @@ -201,14 +201,10 @@ in message = "If samba.nsswins is enabled, then samba.enableWinbindd must also be enabled"; } ]; - # Always provide a smb.conf to shut up programs like smbclient and smbspool. - environment.etc."samba/smb.conf".source = mkOptionDefault ( - if cfg.enable then configFile - else pkgs.writeText "smb-dummy.conf" "# Samba is disabled." - ); } (mkIf cfg.enable { + environment.etc."samba/smb.conf".source = configFile; system.nssModules = optional cfg.nsswins samba; system.nssDatabases.hosts = optional cfg.nsswins "wins";