Modularizing samba and file mounts
This commit is contained in:
+2
-124
@@ -11,6 +11,8 @@
|
|||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./modules/mounts.nix
|
||||||
|
./modules/samba.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
@@ -35,62 +37,6 @@
|
|||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
fileSystems = {
|
|
||||||
"/mnt/games" = {
|
|
||||||
device = "/dev/disk/by-uuid/969eb1a0-fb99-46d1-96cf-57a8644ee2d1";
|
|
||||||
fsType = "btrfs";
|
|
||||||
options = [
|
|
||||||
"users"
|
|
||||||
"compress=zstd"
|
|
||||||
"subvol=@games"
|
|
||||||
"nofail"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
"/mnt/photo" = {
|
|
||||||
device = "/dev/disk/by-uuid/969eb1a0-fb99-46d1-96cf-57a8644ee2d1";
|
|
||||||
fsType = "btrfs";
|
|
||||||
options = [
|
|
||||||
"users"
|
|
||||||
"compress=zstd"
|
|
||||||
"subvol=@Pictures"
|
|
||||||
"nofail"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
"/mnt/media" = {
|
|
||||||
device = "/dev/disk/by-uuid/969eb1a0-fb99-46d1-96cf-57a8644ee2d1";
|
|
||||||
fsType = "btrfs";
|
|
||||||
options = [
|
|
||||||
"users"
|
|
||||||
"compress=zstd"
|
|
||||||
"subvol=@media"
|
|
||||||
"nofail"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
"/mnt/winbackup" = {
|
|
||||||
device = "/dev/disk/by-uuid/969eb1a0-fb99-46d1-96cf-57a8644ee2d1";
|
|
||||||
fsType = "btrfs";
|
|
||||||
options = [
|
|
||||||
"users"
|
|
||||||
"compress=zstd"
|
|
||||||
"subvol=@winbackup"
|
|
||||||
"nofail"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
"/mnt/winhdd" = {
|
|
||||||
device = "/dev/sdb1";
|
|
||||||
fsType = "ntfs";
|
|
||||||
options = [
|
|
||||||
"users"
|
|
||||||
"windows_names"
|
|
||||||
"noatime"
|
|
||||||
"nofail"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualisation.libvirtd = {
|
virtualisation.libvirtd = {
|
||||||
"enable" = true;
|
"enable" = true;
|
||||||
allowedBridges = ["br0"];
|
allowedBridges = ["br0"];
|
||||||
@@ -273,7 +219,6 @@
|
|||||||
git
|
git
|
||||||
kitty
|
kitty
|
||||||
python3
|
python3
|
||||||
samba
|
|
||||||
deno
|
deno
|
||||||
qbittorrent-nox
|
qbittorrent-nox
|
||||||
sonarr
|
sonarr
|
||||||
@@ -349,73 +294,6 @@
|
|||||||
services.flaresolverr = {
|
services.flaresolverr = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
services.samba = {
|
|
||||||
enable = true;
|
|
||||||
openFirewall = true;
|
|
||||||
settings = {
|
|
||||||
global = {
|
|
||||||
"security" = "user";
|
|
||||||
"workgroup" = "WORKGROUP";
|
|
||||||
"server string" = "smbnix";
|
|
||||||
"netbios name" = "smbnix";
|
|
||||||
#"use sendfile" = "yes";
|
|
||||||
#"max protocol" = "smb2";
|
|
||||||
# note: localhost is the ipv6 localhost ::1
|
|
||||||
"hosts allow" = "192.168.1.1/24 127.0.0.1 localhost";
|
|
||||||
"guest account" = "nobody";
|
|
||||||
"map to guest" = "bad user";
|
|
||||||
};
|
|
||||||
|
|
||||||
"games" = {
|
|
||||||
"path" = "/mnt/games";
|
|
||||||
"browseable" = "yes";
|
|
||||||
"read only" = "no";
|
|
||||||
"guest ok" = "no";
|
|
||||||
"create mask" = "0644";
|
|
||||||
"directory mask" = "0755";
|
|
||||||
};
|
|
||||||
|
|
||||||
"media" = {
|
|
||||||
"path" = "/mnt/media";
|
|
||||||
"browseable" = "yes";
|
|
||||||
"read only" = "no";
|
|
||||||
"guest ok" = "no";
|
|
||||||
"create mask" = "0644";
|
|
||||||
"directory mask" = "0755";
|
|
||||||
};
|
|
||||||
|
|
||||||
"photos" = {
|
|
||||||
"path" = "/mnt/photo";
|
|
||||||
"browseable" = "yes";
|
|
||||||
"read only" = "no";
|
|
||||||
"guest ok" = "no";
|
|
||||||
"create mask" = "0644";
|
|
||||||
"directory mask" = "0755";
|
|
||||||
};
|
|
||||||
|
|
||||||
"winhdd" = {
|
|
||||||
"path" = "/mnt/winhdd";
|
|
||||||
"browseable" = "yes";
|
|
||||||
"read only" = "no";
|
|
||||||
"guest ok" = "no";
|
|
||||||
"create mask" = "0644";
|
|
||||||
"directory mask" = "0755";
|
|
||||||
};
|
|
||||||
|
|
||||||
"winback" = {
|
|
||||||
"path" = "/mnt/winbackup";
|
|
||||||
"browseable" = "yes";
|
|
||||||
"read only" = "no";
|
|
||||||
"guest ok" = "no";
|
|
||||||
"create mask" = "0644";
|
|
||||||
"directory mask" = "0755";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services.samba-wsdd = {
|
|
||||||
enable = true;
|
|
||||||
openFirewall = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.mongodb = {
|
services.mongodb = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
{
|
||||||
|
fileSystems = {
|
||||||
|
"/mnt/games" = {
|
||||||
|
device = "/dev/disk/by-uuid/969eb1a0-fb99-46d1-96cf-57a8644ee2d1";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [
|
||||||
|
"users"
|
||||||
|
"compress=zstd"
|
||||||
|
"subvol=@games"
|
||||||
|
"nofail"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"/mnt/photo" = {
|
||||||
|
device = "/dev/disk/by-uuid/969eb1a0-fb99-46d1-96cf-57a8644ee2d1";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [
|
||||||
|
"users"
|
||||||
|
"compress=zstd"
|
||||||
|
"subvol=@Pictures"
|
||||||
|
"nofail"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/mnt/media" = {
|
||||||
|
device = "/dev/disk/by-uuid/969eb1a0-fb99-46d1-96cf-57a8644ee2d1";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [
|
||||||
|
"users"
|
||||||
|
"compress=zstd"
|
||||||
|
"subvol=@media"
|
||||||
|
"nofail"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/mnt/winbackup" = {
|
||||||
|
device = "/dev/disk/by-uuid/969eb1a0-fb99-46d1-96cf-57a8644ee2d1";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [
|
||||||
|
"users"
|
||||||
|
"compress=zstd"
|
||||||
|
"subvol=@winbackup"
|
||||||
|
"nofail"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/mnt/winhdd" = {
|
||||||
|
device = "/dev/sdb1";
|
||||||
|
fsType = "ntfs";
|
||||||
|
options = [
|
||||||
|
"users"
|
||||||
|
"windows_names"
|
||||||
|
"noatime"
|
||||||
|
"nofail"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
services.samba = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
settings = {
|
||||||
|
global = {
|
||||||
|
"security" = "user";
|
||||||
|
"workgroup" = "WORKGROUP";
|
||||||
|
"server string" = "smbnix";
|
||||||
|
"netbios name" = "smbnix";
|
||||||
|
#"use sendfile" = "yes";
|
||||||
|
#"max protocol" = "smb2";
|
||||||
|
# note: localhost is the ipv6 localhost ::1
|
||||||
|
"hosts allow" = "192.168.1.1/24 127.0.0.1 localhost";
|
||||||
|
"guest account" = "nobody";
|
||||||
|
"map to guest" = "bad user";
|
||||||
|
};
|
||||||
|
|
||||||
|
"games" = {
|
||||||
|
"path" = "/mnt/games";
|
||||||
|
"browseable" = "yes";
|
||||||
|
"read only" = "no";
|
||||||
|
"guest ok" = "no";
|
||||||
|
"create mask" = "0644";
|
||||||
|
"directory mask" = "0755";
|
||||||
|
};
|
||||||
|
|
||||||
|
"media" = {
|
||||||
|
"path" = "/mnt/media";
|
||||||
|
"browseable" = "yes";
|
||||||
|
"read only" = "no";
|
||||||
|
"guest ok" = "no";
|
||||||
|
"create mask" = "0644";
|
||||||
|
"directory mask" = "0755";
|
||||||
|
};
|
||||||
|
|
||||||
|
"photos" = {
|
||||||
|
"path" = "/mnt/photo";
|
||||||
|
"browseable" = "yes";
|
||||||
|
"read only" = "no";
|
||||||
|
"guest ok" = "no";
|
||||||
|
"create mask" = "0644";
|
||||||
|
"directory mask" = "0755";
|
||||||
|
};
|
||||||
|
|
||||||
|
"winhdd" = {
|
||||||
|
"path" = "/mnt/winhdd";
|
||||||
|
"browseable" = "yes";
|
||||||
|
"read only" = "no";
|
||||||
|
"guest ok" = "no";
|
||||||
|
"create mask" = "0644";
|
||||||
|
"directory mask" = "0755";
|
||||||
|
};
|
||||||
|
|
||||||
|
"winback" = {
|
||||||
|
"path" = "/mnt/winbackup";
|
||||||
|
"browseable" = "yes";
|
||||||
|
"read only" = "no";
|
||||||
|
"guest ok" = "no";
|
||||||
|
"create mask" = "0644";
|
||||||
|
"directory mask" = "0755";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.samba-wsdd = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [pkgs.samba];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user