From d587cfd246001bb08053a81aecb4ea6e7072295e Mon Sep 17 00:00:00 2001 From: yaroslav Date: Wed, 11 Jun 2025 00:49:33 +0300 Subject: [PATCH] added smb for Qwark --- flake.nix | 1 + hosts/Quark/smb.nix | 47 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 hosts/Quark/smb.nix diff --git a/flake.nix b/flake.nix index eb737db..481dbe0 100644 --- a/flake.nix +++ b/flake.nix @@ -91,6 +91,7 @@ ./hosts/generic/configuration_generic.nix ./hosts/generic/users.nix ./hosts/Quark/Quark-hardware.nix + ./hosts/Quark/smb.nix ./hosts/generic/virtualization.nix # hm-stable.nixosModules.home-manager { # home-manager.useUserPackages = true; diff --git a/hosts/Quark/smb.nix b/hosts/Quark/smb.nix new file mode 100644 index 0000000..5794948 --- /dev/null +++ b/hosts/Quark/smb.nix @@ -0,0 +1,47 @@ +{ ... }: +{ +services.samba = { + enable = true; + openFirewall = true; + settings = { + global = { + "workgroup" = "WORKGROUP"; + "server string" = "Qwark"; + "netbios name" = "qwark"; + "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 192.168.122.2"; + "hosts deny" = "0.0.0.0/0"; + "guest account" = "nobody"; + "map to guest" = "bad user"; + }; + "private" = { + "path" = "/vol/dad"; + "browseable" = "yes"; + "read only" = "no"; + "guest ok" = "no"; + "create mask" = "0644"; + "directory mask" = "0755"; + "force user" = "yaroslav"; + "force group" = "users"; + }; + }; +}; + +services.samba-wsdd = { + enable = true; + openFirewall = true; +}; + +services.avahi = { + publish.enable = true; + publish.userServices = true; + # ^^ Needed to allow samba to automatically register mDNS records (without the need for an `extraServiceFile` + nssmdns4 = true; + # ^^ Not one hundred percent sure if this is needed- if it aint broke, don't fix it + enable = true; + openFirewall = true; +}; +}