nixos/samba: allow dummy conf file to be overridden

This allows configuring samba clients on systems without a samba server.
This commit is contained in:
Johannes Frankenau 2018-07-30 20:13:32 +02:00
parent 886871538c
commit 51169880bd

View File

@ -214,12 +214,10 @@ in
} }
]; ];
# Always provide a smb.conf to shut up programs like smbclient and smbspool. # Always provide a smb.conf to shut up programs like smbclient and smbspool.
environment.etc = singleton environment.etc."samba/smb.conf".source = mkOptionDefault (
{ source =
if cfg.enable then configFile if cfg.enable then configFile
else pkgs.writeText "smb-dummy.conf" "# Samba is disabled."; else pkgs.writeText "smb-dummy.conf" "# Samba is disabled."
target = "samba/smb.conf"; );
};
} }
(mkIf cfg.enable { (mkIf cfg.enable {