temp fix macos samba

This commit is contained in:
mjallen18
2025-05-23 14:33:26 -05:00
parent e71dc3c550
commit 6c9bd35f44
3 changed files with 39 additions and 17 deletions

View File

@@ -6,13 +6,18 @@ let
nextcloudUserId = config.users.users.nix-apps.uid; nextcloudUserId = config.users.users.nix-apps.uid;
nextcloudGroupId = config.users.groups.jallen-nas.gid; nextcloudGroupId = config.users.groups.jallen-nas.gid;
nextcloudPackage = pkgs.unstable.nextcloud31; nextcloudPackage = pkgs.unstable.nextcloud31;
hostAddress = "10.0.1.18";
localAddress = "10.0.2.18";
nextcloudPortExtHttp = 9988;
nextcloudPortExtHttps = 9943;
onlyofficePortExt = 9943;
in in
{ {
containers.nextcloud = { containers.nextcloud = {
autoStart = true; autoStart = true;
privateNetwork = true; privateNetwork = true;
hostAddress = "10.0.1.18"; hostAddress = hostAddress;
localAddress = "10.0.2.18"; localAddress = localAddress;
bindMounts = { bindMounts = {
secrets = { secrets = {
@@ -52,7 +57,7 @@ in
imports = [ ../../../../share/nvidia ]; imports = [ ../../../../share/nvidia ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
networking.extraHosts = '' networking.extraHosts = ''
10.0.1.18 host.containers protonmail-bridge ${hostAddress} host.containers protonmail-bridge
''; '';
services = { services = {
@@ -83,14 +88,14 @@ in
upgrade.disable-web = false; upgrade.disable-web = false;
datadirectory = "/data"; datadirectory = "/data";
trusted_domains = [ trusted_domains = [
"10.0.1.18:9988" "${hostAddress}:${toString nextcloudPortExtHttp}"
"10.0.1.18:9943" "${hostAddress}:${toString nextcloudPortExtHttps}"
"10.0.2.18:80" "${localAddress}:80"
"10.0.2.18:443" "${localAddress}:443"
"cloud.mjallen.dev" "cloud.mjallen.dev"
]; ];
opcache.interned_strings_buffer = 16; opcache.interned_strings_buffer = 16;
trusted_proxies = [ "10.0.1.18" ]; trusted_proxies = [ hostAddress ];
maintenance_window_start = 6; maintenance_window_start = 6;
default_phone_region = "US"; default_phone_region = "US";
enable_previews = true; enable_previews = true;
@@ -123,7 +128,7 @@ in
services.onlyoffice = { services.onlyoffice = {
enable = true; enable = true;
port = 9980; port = onlyofficePortExt;
hostname = "office.mjallen.dev"; hostname = "office.mjallen.dev";
jwtSecretFile = jwtSecretFile; jwtSecretFile = jwtSecretFile;
}; };
@@ -198,7 +203,7 @@ in
allowedTCPPorts = [ allowedTCPPorts = [
80 80
443 443
9980 onlyofficePortExt
]; ];
}; };
# Use systemd-resolved inside the container # Use systemd-resolved inside the container
@@ -214,20 +219,20 @@ in
nat = { nat = {
forwardPorts = [ forwardPorts = [
{ {
destination = "10.0.2.18:443"; destination = "${localAddress}:443";
sourcePort = 9943; sourcePort = nextcloudPortExtHttps;
} }
{ {
destination = "10.0.2.18:80"; destination = "${localAddress}:80";
sourcePort = 9988; sourcePort = nextcloudPortExtHttp;
} }
{ {
destination = "10.0.2.18:8000"; destination = "${localAddress}:8000";
sourcePort = 8000; sourcePort = 8000;
} }
{ {
destination = "10.0.2.18:9980"; destination = "${localAddress}:${toString onlyofficePortExt}";
sourcePort = 9980; sourcePort = onlyofficePortExt;
} }
]; ];
}; };

View File

@@ -185,6 +185,21 @@ in
}; };
}; };
# TODO move to normal samba settings
services.samba.settings.global = {
"workgroup" = "WORKGROUP";
"server string" = "Jallen-NAS";
"netbios name" = "Jallen-NAS";
"security" = "user";
#"use sendfile" = "yes";
#"max protocol" = "smb2";
# note: localhost is the ipv6 localhost ::1
"hosts allow" = "10.0.1. 127.0.0.1 localhost";
"hosts deny" = "0.0.0.0/0";
"guest account" = "nobody";
"map to guest" = "bad user";
};
systemd.services = { systemd.services = {
btrfs-balance = { btrfs-balance = {
description = "BTRFS Balance Service"; description = "BTRFS Balance Service";

View File

@@ -30,6 +30,8 @@ in
services.samba = { services.samba = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
nsswins = true;
nmbd.enable = true;
settings = settings =
let let
make = make =