diff --git a/nixos/server.nix b/nixos/server.nix index 02304a1..da5d15f 100644 --- a/nixos/server.nix +++ b/nixos/server.nix @@ -27,8 +27,6 @@ ./server/gitea.nix ./server/mailserver.nix ./server/mariadb.nix - ./server/nextcloud.nix - ./server/nfs.nix ./server/nginx.nix ./server/owncast.nix ./server/photoprism.nix @@ -38,6 +36,11 @@ ./server/wireguard.nix ./server/misc.nix + # File server + ./server/nextcloud.nix + ./server/nfs.nix + ./server/samba.nix + # Matrix ./server/synapse.nix ./server/element.nix diff --git a/nixos/server/nextcloud.nix b/nixos/server/nextcloud.nix index a553091..644bcb2 100644 --- a/nixos/server/nextcloud.nix +++ b/nixos/server/nextcloud.nix @@ -8,7 +8,7 @@ https = true; config = { adminuser = "jimbo"; - adminpassFile = "${pkgs.writeText "nextpass" outputs.secrets.nextcloudPass}"; + adminpassFile = "/mnt/nextcloud/password.txt"; }; settings = { trusted_proxies = [ "127.0.0.1" ]; diff --git a/nixos/server/samba.nix b/nixos/server/samba.nix new file mode 100644 index 0000000..29f5a89 --- /dev/null +++ b/nixos/server/samba.nix @@ -0,0 +1,37 @@ +{ + services = { + samba = { + enable = true; + securityType = "user"; + openFirewall = true; + extraConfig = let + ips = import ../modules/ips.nix; + in '' + workgroup = WORKGROUP + server string = JimSMB + security = user + hosts allow = ${ips.localSpan}. 127.0.0.1 localhost + hosts deny = 0.0.0.0/0 + guest account = nobody + map to guest = bad user + ''; + shares = { + roms = { + comment = "Samba share with my ROMs"; + path = "/export/JimboNFS/Downloads/GameFiles/ROMS"; + browseable = "yes"; + "read only" = "no"; + "guest ok" = "no"; + "create mask" = "0644"; + "directory mask" = "0755"; + }; + }; + }; + + # Advertise to Windows + samba-wsdd = { + enable = true; + openFirewall = true; + }; + }; +} diff --git a/secrets.nix b/secrets.nix index 72d7ab0..b2f7f35 100644 Binary files a/secrets.nix and b/secrets.nix differ