diff options
author | Franck Cuny <franck@fcuny.net> | 2023-05-10 19:57:20 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2023-05-10 19:57:20 -0700 |
commit | 0bece1c755a7869bf0d5194ae37da3113856a2f6 (patch) | |
tree | a2d098744d265d1d9ca2cd34c9a01c6f5d7d58a1 /modules/services | |
parent | hosts/tahoe: move avahi configuration here (diff) | |
download | world-0bece1c755a7869bf0d5194ae37da3113856a2f6.tar.gz |
profiles/samba: convert the old module as a profile
Diffstat (limited to 'modules/services')
-rw-r--r-- | modules/services/default.nix | 1 | ||||
-rw-r--r-- | modules/services/samba/default.nix | 52 |
2 files changed, 0 insertions, 53 deletions
diff --git a/modules/services/default.nix b/modules/services/default.nix index d04e5cf..2cf7f86 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -4,7 +4,6 @@ imports = [ ./backup ./monitoring - ./samba ./sendsms ./syncthing ./transmission diff --git a/modules/services/samba/default.nix b/modules/services/samba/default.nix deleted file mode 100644 index 6dc6671..0000000 --- a/modules/services/samba/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ config, pkgs, lib, ... }: -let - cfg = config.my.services.samba; - makePublicShare = path: { - name = builtins.baseNameOf path; - value = { - inherit path; - browseable = "yes"; - writeable = "no"; - "guest ok" = "yes"; - "guest only" = "yes"; - "force user" = "nobody"; - }; - }; -in -{ - options.my.services.samba = with lib; { - enable = mkEnableOption "Samba"; - publicShares = mkOption { - type = with types; listOf str; - default = [ ]; - example = literalExample '' - [ - "/data/fast/music" - ] - ''; - description = "Which directories to share publicly"; - }; - }; - - config = lib.mkIf cfg.enable { - services.samba = { - enable = true; - securityType = "user"; - extraConfig = '' - workgroup = WORKGROUP - server string = tahoe - netbios name = tahoe - security = user - guest account = nobody - mangled names = no - client min protocol = SMB2 - map to guest = bad user - ntlm auth = true - ''; - shares = with lib; (listToAttrs (map makePublicShare cfg.publicShares)); - }; - - networking.firewall.allowedTCPPorts = [ 445 139 ]; - networking.firewall.allowedUDPPorts = [ 137 138 ]; - }; -} |