From 6763a973a058199499efcc2422f08e8a8cdf1ee3 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Wed, 31 Jul 2024 17:04:56 +0000 Subject: [PATCH] Add basic Samba config for the scanner This allows the scanner to log into samba with its own username and password. --- quinn/etc/nixos/configuration.nix | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/quinn/etc/nixos/configuration.nix b/quinn/etc/nixos/configuration.nix index 36ba9be..38bf555 100644 --- a/quinn/etc/nixos/configuration.nix +++ b/quinn/etc/nixos/configuration.nix @@ -58,6 +58,7 @@ # Enable touchpad support (enabled default in most desktopManager). # services.libinput.enable = true; + users.groups.scanner = {}; users.groups.step = {}; # Define a user account. Don't forget to set a password with ‘passwd’. @@ -70,6 +71,12 @@ # tree # ]; }; + users.users.scanner = { + group = "scanner"; + isNormalUser = false; + isSystemUser = true; + description = "User for the scanner to log in to samba"; + }; users.users.step = { group = "step"; isNormalUser = false; @@ -173,6 +180,45 @@ # Enable the OpenSSH daemon. services.openssh.enable = true; + # Set up a samba share for the scanner + services.samba = { + enable = true; + openFirewall = true; + extraConfig = '' + workgroup = WORKGROUP + server string smbnix + netbios name = smbnix + security = user + 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"; + }; + private = { + path = "/mnt/shares/private"; + browseable = "yes"; + "read only" = "no"; + "guest ok" = "no"; + "create mask" = "0644"; + "directory mask" = "0755"; + "force user" = "username"; + "force group" = "groupname"; + }; + }; + }; + services.samba-wsdd = { + enable = true; + openFirewall = true; + }; # Enable Tailscale services.tailscale.enable = true;