Create samba shares
This commit is contained in:
parent
29e0251a95
commit
958f1e7042
7 changed files with 94 additions and 0 deletions
|
@ -35,6 +35,12 @@
|
|||
options = [ "subvol=containers" "compress=zstd" ];
|
||||
};
|
||||
|
||||
fileSystems."/srv/shares" = {
|
||||
device = "/dev/disk/by-label/data";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=shares" "compress=zstd" ];
|
||||
};
|
||||
|
||||
fileSystems."/srv/backup" = {
|
||||
device = "/dev/disk/by-label/data";
|
||||
fsType = "btrfs";
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
];
|
||||
encryption.mode = "none";
|
||||
repo = "/srv/backup/borg/containers";
|
||||
shares = {
|
||||
paths = [
|
||||
"/srv/shares"
|
||||
];
|
||||
encryption.mode = "none";
|
||||
repo = "/srv/backup/shares";
|
||||
compression = "auto,zstd";
|
||||
startAt = "daily";
|
||||
};
|
||||
|
|
|
@ -7,5 +7,6 @@
|
|||
./borgbackup.nix
|
||||
./forgejo.nix
|
||||
./mpd.nix
|
||||
./samba.nix
|
||||
];
|
||||
}
|
||||
|
|
52
nixos/viridian/services/samba.nix
Normal file
52
nixos/viridian/services/samba.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
services.samba = {
|
||||
enable = true;
|
||||
securityType = "user";
|
||||
openFirewall = true;
|
||||
extraConfig = ''
|
||||
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.1.101 192.168.1.108 127.0.0.1 localhost
|
||||
hosts deny = 0.0.0.0/0
|
||||
guest account = nobody
|
||||
map to guest = bad user
|
||||
'';
|
||||
shares = {
|
||||
spectre = {
|
||||
path = "/srv/shares/spectre";
|
||||
browseable = "yes";
|
||||
"read only" = "no";
|
||||
"guest ok" = "no";
|
||||
"create mask" = "0644";
|
||||
"directory mask" = "0755";
|
||||
"force user" = "spectre";
|
||||
"force group" = "users";
|
||||
};
|
||||
sajenim = {
|
||||
path = "/srv/shares/sajenim";
|
||||
browseable = "yes";
|
||||
"read only" = "no";
|
||||
"guest ok" = "no";
|
||||
"create mask" = "0644";
|
||||
"directory mask" = "0755";
|
||||
"force user" = "sajenim";
|
||||
"force group" = "users";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.samba-wsdd = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
networking.firewall.enable = true;
|
||||
networking.firewall.allowPing = true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue