From 810b341958db486c0b7d7897e662454c89207c64 Mon Sep 17 00:00:00 2001 From: Adrian Gunnar Lauterer Date: Sun, 7 Apr 2024 16:34:42 +0200 Subject: [PATCH] added smb share --- machines/galadriel/configuration.nix | 3 +- services/smb.nix | 64 ++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 services/smb.nix diff --git a/machines/galadriel/configuration.nix b/machines/galadriel/configuration.nix index 34d3558..12d9074 100644 --- a/machines/galadriel/configuration.nix +++ b/machines/galadriel/configuration.nix @@ -15,7 +15,8 @@ ../../profiles/sops.nix ./zfs.nix ./backup.nix - ../../services/stableDiffusion.nix + ../../services/smb.nix + #../../services/stableDiffusion.nix #../../services/freshrrs.nix #../../services/torrent.nix diff --git a/services/smb.nix b/services/smb.nix new file mode 100644 index 0000000..ab6b1dd --- /dev/null +++ b/services/smb.nix @@ -0,0 +1,64 @@ +{ config, pkgs, lib, ... }: +{ + + +services.samba = { + enable = true; + securityType = "user"; + openFirewall = true; + extraConfig = '' + workgroup = WORKGROUP + server string = smbnix + netbios name = smbnix + security = user + #use sendfile = yes + #max protocol = smb2 + # note: localhost is the ipv6 localhost ::1 + hosts allow = 192.168.0. 127.0.0.1 localhost 100.0.0.0/8 + hosts deny = 0.0.0.0/0 + guest account = nobody + map to guest = bad user + ''; + shares = { + # public = { + # path = "/mnt/Shares/Public"; + # browseable = "yes"; + # "read only" = "no"; + # "guest ok" = "yes"; + # "create mask" = "0644"; + # "directory mask" = "0755"; + # "force user" = "username"; + # "force group" = "groupname"; + # }; + Main = { + path = "/Main"; + "valid users" = "gunalx"; + "force user" = "gunalx"; + "force group" = "gunalx"; + + public = "no"; + browseable = "yes"; + writeable = "yes"; + + "fruit:aapl" = "yes"; + "fruit:time machine" = "yes"; + "vfs objects" = "catia fruit streams_xattr"; + + "read only" = "no"; + "guest ok" = "no"; + "create mask" = "0644"; + "directory mask" = "0755"; + }; + }; +}; + +services.samba-wsdd = { + enable = true; + openFirewall = true; +}; + +#networking.firewall.enable = true; +networking.firewall.allowPing = true; + + +}