git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/samba: allow dummy conf file to be overridden

This allows configuring samba clients on systems without a samba server.

commit51169880bd41b24642c5440c4d51c459aa2a8b05 authorJohannes Frankenau <johannes@frankenau.net> dateMon 30 Jul 2018, 20:13 (8 years ago) parent8868715
1 file changed+4−6
nixos/modules/services/network-filesystems/samba.nix+4−6
nixos/modules/services/network-filesystems/samba.nix+4−6
@@ -214,12 +214,10 @@ in
214214 }
215215 ];
216216 # Always provide a smb.conf to shut up programs like smbclient and smbspool.
217− environment.etc = singleton
218− { source =
219− if cfg.enable then configFile
220− else pkgs.writeText "smb-dummy.conf" "# Samba is disabled.";
221− target = "samba/smb.conf";
222− };
217+ environment.etc."samba/smb.conf".source = mkOptionDefault (
218+ if cfg.enable then configFile
219+ else pkgs.writeText "smb-dummy.conf" "# Samba is disabled."
220+ );
223221 }
224222
225223 (mkIf cfg.enable {