diff options
author | Johannes Frankenau <johannes@frankenau.net> | 2018-07-30 20:13:32 +0200 |
---|---|---|
committer | Johannes Frankenau <johannes@frankenau.net> | 2018-08-16 10:24:09 +0200 |
commit | 51169880bd41b24642c5440c4d51c459aa2a8b05 (patch) | |
tree | 64910c241150a799b02f2f68990ffef1f592659e /nixos | |
parent | 886871538c15681575925a990a3f1b68ed9d5477 (diff) | |
download | nixlib-51169880bd41b24642c5440c4d51c459aa2a8b05.tar nixlib-51169880bd41b24642c5440c4d51c459aa2a8b05.tar.gz nixlib-51169880bd41b24642c5440c4d51c459aa2a8b05.tar.bz2 nixlib-51169880bd41b24642c5440c4d51c459aa2a8b05.tar.lz nixlib-51169880bd41b24642c5440c4d51c459aa2a8b05.tar.xz nixlib-51169880bd41b24642c5440c4d51c459aa2a8b05.tar.zst nixlib-51169880bd41b24642c5440c4d51c459aa2a8b05.zip |
nixos/samba: allow dummy conf file to be overridden
This allows configuring samba clients on systems without a samba server.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/network-filesystems/samba.nix | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/nixos/modules/services/network-filesystems/samba.nix b/nixos/modules/services/network-filesystems/samba.nix index b23266e8d43a..10dc58311212 100644 --- a/nixos/modules/services/network-filesystems/samba.nix +++ b/nixos/modules/services/network-filesystems/samba.nix @@ -214,12 +214,10 @@ in } ]; # Always provide a smb.conf to shut up programs like smbclient and smbspool. - environment.etc = singleton - { source = - if cfg.enable then configFile - else pkgs.writeText "smb-dummy.conf" "# Samba is disabled."; - target = "samba/smb.conf"; - }; + environment.etc."samba/smb.conf".source = mkOptionDefault ( + if cfg.enable then configFile + else pkgs.writeText "smb-dummy.conf" "# Samba is disabled." + ); } (mkIf cfg.enable { |