feat: switch to samba for media share
This commit is contained in:
parent
a9e41abe2f
commit
dfe6dbecf3
7 changed files with 50 additions and 14 deletions
services/samba
19
services/samba/home-pc.nix
Normal file
19
services/samba/home-pc.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
fileSystems."/home/felschr/media" = {
|
||||
device = "//192.168.1.234:/media";
|
||||
fsType = "cifs";
|
||||
options = [
|
||||
# automount options
|
||||
"x-systemd.automount"
|
||||
"noauto"
|
||||
"x-systemd.idle-timeout=60"
|
||||
"x-systemd.device-timeout=5s"
|
||||
"x-systemd.mount-timeout=5s"
|
||||
|
||||
"uid=1000"
|
||||
"credentials=/etc/nixos/secrets/samba"
|
||||
];
|
||||
};
|
||||
}
|
28
services/samba/rpi4.nix
Normal file
28
services/samba/rpi4.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Use `smbpasswd -a <user>` to set passwords
|
||||
|
||||
services.samba = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
securityType = "user";
|
||||
extraConfig = ''
|
||||
guest account = nobody
|
||||
map to guest = bad user
|
||||
use sendfile = true
|
||||
'';
|
||||
shares = {
|
||||
media = {
|
||||
path = "/media";
|
||||
public = "no";
|
||||
browseable = "yes";
|
||||
writeable = "yes";
|
||||
"create mask" = "0644";
|
||||
"directory mask" = "0755";
|
||||
"force user" = "felschr";
|
||||
"force group" = "users";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue