From 701b68f46b65285ea19233c336644eeb6d742f95 Mon Sep 17 00:00:00 2001 From: oqyude Date: Thu, 7 Aug 2025 13:25:33 +0300 Subject: [PATCH] 123 --- nixosConfigurations/hosts/server.nix | 46 ------------------------ nixosModules/server/default.nix | 3 +- nixosModules/server/samba.nix | 54 ++++++++++++++++++++++++++++ nixosModules/server/systemd.nix | 2 -- 4 files changed, 56 insertions(+), 49 deletions(-) create mode 100755 nixosModules/server/samba.nix diff --git a/nixosConfigurations/hosts/server.nix b/nixosConfigurations/hosts/server.nix index 561ced5..460a236 100755 --- a/nixosConfigurations/hosts/server.nix +++ b/nixosConfigurations/hosts/server.nix @@ -97,52 +97,6 @@ let SystemMaxUse=512M ''; }; - samba = { - enable = true; - settings = { - global = { - "invalid users" = [ ]; - "passwd program" = "/run/wrappers/bin/passwd %u"; - security = "user"; - }; - nixos = { - "path" = "/etc/nixos"; - "browseable" = "yes"; - "read only" = "no"; - "valid users" = "${config.xlib.device.username}"; - "guest ok" = "no"; - "writable" = "yes"; - "create mask" = 755; - "directory mask" = 755; - "force user" = "${config.xlib.device.username}"; - "force group" = "users"; - }; - root = { - "path" = "/"; - "browseable" = "yes"; - "read only" = "no"; - "valid users" = "${config.xlib.device.username}"; - "guest ok" = "no"; - "writable" = "yes"; - #"create mask" = 0644; - #"directory mask" = 0644; - "force user" = "root"; - "force group" = "root"; - }; - "${config.xlib.device.username}" = { - "path" = "${config.xlib.dirs.server-home}"; - "browseable" = "yes"; - "read only" = "no"; - "valid users" = "${config.xlib.device.username}"; - "guest ok" = "no"; - "writable" = "yes"; - "create mask" = 700; - "directory mask" = 700; - "force user" = "${config.xlib.device.username}"; - "force group" = "users"; - }; - }; - }; calibre-web = { enable = true; group = "users"; diff --git a/nixosModules/server/default.nix b/nixosModules/server/default.nix index 07dc55e..1aab75a 100755 --- a/nixosModules/server/default.nix +++ b/nixosModules/server/default.nix @@ -12,8 +12,9 @@ ./miniflux.nix ./nextcloud.nix ./nginx.nix + ./samba.nix ./stirling-pdf.nix - ./zerotier.nix ./systemd.nix + ./zerotier.nix ]; } diff --git a/nixosModules/server/samba.nix b/nixosModules/server/samba.nix new file mode 100755 index 0000000..fb95022 --- /dev/null +++ b/nixosModules/server/samba.nix @@ -0,0 +1,54 @@ +{ + config, + ... +}: +{ + services = { + samba = { + enable = true; + settings = { + global = { + "invalid users" = [ ]; + "passwd program" = "/run/wrappers/bin/passwd %u"; + security = "user"; + }; + nixos = { + "path" = "/etc/nixos"; + "browseable" = "yes"; + "read only" = "no"; + "valid users" = "${config.xlib.device.username}"; + "guest ok" = "no"; + "writable" = "yes"; + "create mask" = 755; + "directory mask" = 755; + "force user" = "${config.xlib.device.username}"; + "force group" = "users"; + }; + root = { + "path" = "/"; + "browseable" = "yes"; + "read only" = "no"; + "valid users" = "${config.xlib.device.username}"; + "guest ok" = "no"; + "writable" = "yes"; + #"create mask" = 0644; + #"directory mask" = 0644; + "force user" = "root"; + "force group" = "root"; + }; + "${config.xlib.device.username}" = { + "path" = "${config.xlib.dirs.server-home}"; + "browseable" = "yes"; + "read only" = "no"; + "valid users" = "${config.xlib.device.username}"; + "guest ok" = "no"; + "writable" = "yes"; + "create mask" = 700; + "directory mask" = 700; + "force user" = "${config.xlib.device.username}"; + "force group" = "users"; + }; + }; + }; + }; +} diff --git a/nixosModules/server/systemd.nix b/nixosModules/server/systemd.nix index 289a3f4..c186c7b 100644 --- a/nixosModules/server/systemd.nix +++ b/nixosModules/server/systemd.nix @@ -19,8 +19,6 @@ Type = "oneshot"; User = "root"; Group = "root"; - # ExecStart = '' - # ''; Nice = 19; IOSchedulingClass = "idle"; };