From 73616d498ca7e15c07ab53744da42db56ca51010 Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Sun, 9 Feb 2025 19:42:29 +0100 Subject: samba meuk --- configuration/snorlax/default.nix | 1 + configuration/snorlax/disk-config.nix | 6 ++++++ configuration/snorlax/samba.nix | 37 ++++++++++++++++++++++++++++++++++ flake.lock | Bin 24506 -> 24358 bytes flake.nix | 2 +- 5 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 configuration/snorlax/samba.nix diff --git a/configuration/snorlax/default.nix b/configuration/snorlax/default.nix index 65e6f6f..4355364 100644 --- a/configuration/snorlax/default.nix +++ b/configuration/snorlax/default.nix @@ -3,6 +3,7 @@ imports = [ ./disk-config.nix ./git.nix + ./samba.nix ../core ]; diff --git a/configuration/snorlax/disk-config.nix b/configuration/snorlax/disk-config.nix index 8c910d6..9bac5f0 100644 --- a/configuration/snorlax/disk-config.nix +++ b/configuration/snorlax/disk-config.nix @@ -45,6 +45,12 @@ mountpoint = "/var/lib/git"; options."com.sun:auto-snapshot" = "true"; }; + + samba = { + type = "zfs_fs"; + mountpoint = "/srv/samba"; + options."com.sun:auto-snapshot" = "true"; + }; }; }; }; diff --git a/configuration/snorlax/samba.nix b/configuration/snorlax/samba.nix new file mode 100644 index 0000000..44a4be9 --- /dev/null +++ b/configuration/snorlax/samba.nix @@ -0,0 +1,37 @@ +{ ... }: +{ + services.samba = { + enable = true; + securityType = "user"; + openFirewall = true; + settings = { + global = { + "workgroup" = "WORKGROUP"; + "server string" = "smbnix"; + "netbios name" = "smbnix"; + "security" = "user"; + "hosts allow" = "192.168.50. 127.0.0.1 localhost"; + "hosts deny" = "0.0.0.0/0"; + "guest account" = "nobody"; + "map to guest" = "bad user"; + }; + + photos = { + "path" = "/srv/samba/photos"; + "browseable" = "yes"; + "read only" = "no"; + "guest ok" = "yes"; + "create mask" = "0644"; + "directory mask" = "0755"; + "force user" = "nobody"; + "force group" = "nogroup"; + }; + }; + }; + + # Used to advertise to Windows hosts + services.samba-wsdd = { + enable = true; + openFirewall = true; + }; +} diff --git a/flake.lock b/flake.lock index d024757..126021d 100644 Binary files a/flake.lock and b/flake.lock differ diff --git a/flake.nix b/flake.nix index 0c43107..20bb675 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,7 @@ nil.url = "github:oxalica/nil"; - astal-bar.url = "git+http://tarreltaart.home:3000/jras/astal-bar.git"; + astal-bar.url = "path:/home/jras/projects/astal-bar"; }; outputs = inputs@{ -- cgit v1.2.3