From 7bc9fa44deebd5edf3478e05ca326079739d12af Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Fri, 15 Mar 2024 18:43:24 -0400 Subject: [PATCH] mauville: added samba shares --- hosts/mauville/hardware-configuration.nix | 10 +++---- modules/homelab/default.nix | 3 +- modules/homelab/samba.nix | 36 +++++++++++++++++++++++ 3 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 modules/homelab/samba.nix diff --git a/hosts/mauville/hardware-configuration.nix b/hosts/mauville/hardware-configuration.nix index 69577f4b..b2b849b4 100644 --- a/hosts/mauville/hardware-configuration.nix +++ b/hosts/mauville/hardware-configuration.nix @@ -23,15 +23,15 @@ fsType = "vfat"; }; - fileSystems."/mnt/Media" = + fileSystems."/mnt/Archive" = { device = "/dev/disk/by-uuid/f7e9e6d6-2bf6-429a-aaf0-49b55d53fc83"; fsType = "ext4"; }; - # fileSystems."/mnt/Media" = - # { device = "/dev/disk/by-uuid/d988d5ca-f9d6-4d85-aa0e-8a437b3c859a"; - # fsType = "ext4"; - # }; + fileSystems."/mnt/Media" = + { device = "/dev/disk/by-uuid/d988d5ca-f9d6-4d85-aa0e-8a437b3c859a"; + fsType = "ext4"; + }; swapDevices = [ { device = "/dev/disk/by-uuid/26094ada-7ba4-4437-bacb-b3cdf6c3397b"; } diff --git a/modules/homelab/default.nix b/modules/homelab/default.nix index a072b217..5507227a 100644 --- a/modules/homelab/default.nix +++ b/modules/homelab/default.nix @@ -4,6 +4,7 @@ imports = [ ./virtualization.nix ./nginx_proxy.nix + ./samba.nix ]; # services.ddclient.enable = true; @@ -76,4 +77,4 @@ }; }; }; -} \ No newline at end of file +} diff --git a/modules/homelab/samba.nix b/modules/homelab/samba.nix new file mode 100644 index 00000000..8db6ee9c --- /dev/null +++ b/modules/homelab/samba.nix @@ -0,0 +1,36 @@ +{ config, pkgs, ... }: + +{ + + services.samba = { + enable = true; + securityType = "user"; + openFirewall = true; + shares = { + Media = { + comment = "Media @Mauville"; + path = "/mnt/Media"; + browseable = "yes"; + "read only" = "no"; + "guest ok" = "yes"; + "create mask" = "0755"; + "directory mask" = "0755"; + }; + Archive = { + comment = "Archive @Mauville"; + path = "/mnt/Media"; + browseable = "yes"; + "read only" = "no"; + "guest ok" = "yes"; + "create mask" = "0755"; + "directory mask" = "0755"; + }; + }; + }; + + services.samba-wsdd = { + enable = true; + openFirewall = true; + }; +} +