diff --git a/home-pc.nix b/home-pc.nix index b455bcf..cba147e 100644 --- a/home-pc.nix +++ b/home-pc.nix @@ -10,6 +10,7 @@ ./system/gaming.nix ./desktop ./virtualisation/docker.nix + ./services/samba/home-pc.nix ./services/syncthing/felix-nixos.nix ./services/restic/home-pc.nix ./services/pcscd.nix diff --git a/rpi4.nix b/rpi4.nix index 9918681..75fab4c 100644 --- a/rpi4.nix +++ b/rpi4.nix @@ -17,6 +17,7 @@ in with builtins; { ./system/i18n.nix ./system/networking.nix ./services/restic/rpi4.nix + ./services/samba/rpi4.nix ./services/syncthing/rpi4.nix # ./services/kodi.nix ./services/jellyfin.nix diff --git a/services/restic/home-pc.nix b/services/restic/home-pc.nix index 108e498..81b07fd 100644 --- a/services/restic/home-pc.nix +++ b/services/restic/home-pc.nix @@ -24,8 +24,8 @@ in { /home/*/.steam /home/*/.local/share/Steam /home/*/.local/share/lutris + /home/felschr/media /home/felschr/sync - /home/felschr/Sync /home/felschr/keybase ''; in '' diff --git a/services/samba/home-pc.nix b/services/samba/home-pc.nix new file mode 100644 index 0000000..7f6136c --- /dev/null +++ b/services/samba/home-pc.nix @@ -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" + ]; + }; +} diff --git a/services/samba/rpi4.nix b/services/samba/rpi4.nix new file mode 100644 index 0000000..7d017e7 --- /dev/null +++ b/services/samba/rpi4.nix @@ -0,0 +1,28 @@ +{ config, pkgs, ... }: + +{ + # Use `smbpasswd -a ` 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"; + }; + }; + }; +} diff --git a/services/syncthing/felix-nixos.nix b/services/syncthing/felix-nixos.nix index 903b362..5abc5e6 100644 --- a/services/syncthing/felix-nixos.nix +++ b/services/syncthing/felix-nixos.nix @@ -28,12 +28,6 @@ in { path = "/home/felschr/sync/backups"; devices = [ "rpi4" ]; }; - "Media" = { - id = "media"; - path = "/home/felschr/sync/media"; - devices = [ "rpi4" ]; - inherit versioning; - }; }; }; } diff --git a/services/syncthing/rpi4.nix b/services/syncthing/rpi4.nix index cd287d7..81a3272 100644 --- a/services/syncthing/rpi4.nix +++ b/services/syncthing/rpi4.nix @@ -31,13 +31,6 @@ in { devices = [ "felix-nixos" ]; inherit versioning; }; - "Media" = { - id = "media"; - path = "/media"; - # path = "/media/inbox"; - devices = [ "felix-nixos" ]; - # inherit versioning; - }; }; }; }