Skip to content

Commit

Permalink
feat(jeeves): add samba
Browse files Browse the repository at this point in the history
  • Loading branch information
reo101 committed Jan 22, 2024
1 parent 62ae512 commit a6efd41
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions machines/nixos/x86_64-linux/jeeves/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
./wireguard.nix
./jellyfin.nix
./mindustry.nix
./samba.nix
];

age.rekey = {
Expand Down
3 changes: 3 additions & 0 deletions machines/nixos/x86_64-linux/jeeves/disko.nix
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@
"/data/torrents/download" = { };
"/data/torrents/incomplete" = { };
"/data/media/jellyfin" = { };
"/data/samba" = { };
"/data/samba/private" = { };
"/data/samba/public" = { };
};
};
};
Expand Down
61 changes: 61 additions & 0 deletions machines/nixos/x86_64-linux/jeeves/samba.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{ lib, pkgs, config, ... }:
{
environment.systemPackages = with pkgs; [
];

# TODO: smbpasswd -a <USER>

services.samba-wsdd = {
# make shares visible for Windows clients
enable = true;
openFirewall = true;
};

services.samba = {
enable = true;
package = pkgs.sambaFull;
openFirewall = true;
securityType = "user";
extraConfig = ''
# Files
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. 192.168.1. 10.100.0. 127.0.0.1 localhost
hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
# Printers
load printers = yes
printing = cups
printcap name = cups
'';
shares = {
public = {
path = "/data/samba/public";
browseable = "yes";
"read only" = "no";
"guest ok" = "yes";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = "jeeves";
"force group" = "users";
};
private = {
path = "/data/samba/private";
browseable = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = "jeeves";
"force group" = "users";
};
};
};
}

0 comments on commit a6efd41

Please sign in to comment.