feat: switch to samba for media share

This commit is contained in:
Felix Schröter 2022-02-04 23:23:34 +01:00
parent a9e41abe2f
commit dfe6dbecf3
Signed by: felschr
GPG key ID: 671E39E6744C807D
7 changed files with 50 additions and 14 deletions

View file

@ -10,6 +10,7 @@
./system/gaming.nix ./system/gaming.nix
./desktop ./desktop
./virtualisation/docker.nix ./virtualisation/docker.nix
./services/samba/home-pc.nix
./services/syncthing/felix-nixos.nix ./services/syncthing/felix-nixos.nix
./services/restic/home-pc.nix ./services/restic/home-pc.nix
./services/pcscd.nix ./services/pcscd.nix

View file

@ -17,6 +17,7 @@ in with builtins; {
./system/i18n.nix ./system/i18n.nix
./system/networking.nix ./system/networking.nix
./services/restic/rpi4.nix ./services/restic/rpi4.nix
./services/samba/rpi4.nix
./services/syncthing/rpi4.nix ./services/syncthing/rpi4.nix
# ./services/kodi.nix # ./services/kodi.nix
./services/jellyfin.nix ./services/jellyfin.nix

View file

@ -24,8 +24,8 @@ in {
/home/*/.steam /home/*/.steam
/home/*/.local/share/Steam /home/*/.local/share/Steam
/home/*/.local/share/lutris /home/*/.local/share/lutris
/home/felschr/media
/home/felschr/sync /home/felschr/sync
/home/felschr/Sync
/home/felschr/keybase /home/felschr/keybase
''; '';
in '' in ''

View 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
View 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";
};
};
};
}

View file

@ -28,12 +28,6 @@ in {
path = "/home/felschr/sync/backups"; path = "/home/felschr/sync/backups";
devices = [ "rpi4" ]; devices = [ "rpi4" ];
}; };
"Media" = {
id = "media";
path = "/home/felschr/sync/media";
devices = [ "rpi4" ];
inherit versioning;
};
}; };
}; };
} }

View file

@ -31,13 +31,6 @@ in {
devices = [ "felix-nixos" ]; devices = [ "felix-nixos" ];
inherit versioning; inherit versioning;
}; };
"Media" = {
id = "media";
path = "/media";
# path = "/media/inbox";
devices = [ "felix-nixos" ];
# inherit versioning;
};
}; };
}; };
} }