about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorAnthony Roussel <anthony@roussel.dev>2024-06-07 08:43:54 +0200
committerAnthony Roussel <anthony@roussel.dev>2024-06-07 08:44:21 +0200
commit46db91c0d789d62d5e44e9ef01f97b12f465c33e (patch)
treefa149abb2b90127a8af93990debc29b52b7333c1 /nixos
parent4f4846ed59f5c171ffdc6e17cb690e0010d0d12e (diff)
nixos/samba: only create /etc/samba/smb.conf when samba is enabled
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/network-filesystems/samba.nix6
1 files changed, 1 insertions, 5 deletions
diff --git a/nixos/modules/services/network-filesystems/samba.nix b/nixos/modules/services/network-filesystems/samba.nix
index 66ef3f14ed700..c70d0cf7beac3 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";