Compare commits
8 Commits
abf0583f17
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 2644e7f843 | |||
| 4ba0830997 | |||
| 1b3257fbf2 | |||
| 7a484976f8 | |||
| e27b5206e7 | |||
| 103a5f3b2d | |||
| 4ff36b1000 | |||
| ae5f6f1fc4 |
@@ -26,15 +26,15 @@
|
|||||||
# fsType = "ext4";
|
# fsType = "ext4";
|
||||||
# };
|
# };
|
||||||
|
|
||||||
#fileSystems."/srv/dev-disk-by-uuid-18333f38-626c-4c22-af29-314a87282809" =
|
fileSystems."/srv/private" =
|
||||||
# { device = "/dev/mapper/base--storage-ShatteredMINT";
|
{ device = "/dev/mapper/base--storage-ShatteredMINT";
|
||||||
# fsType = "ext4";
|
fsType = "ext4";
|
||||||
# };
|
};
|
||||||
|
|
||||||
#fileSystems."/srv/dev-disk-by-uuid-98570615-8eda-4a45-8a20-3c58b50e3d79" =
|
fileSystems."/srv/shared" =
|
||||||
# { device = "/dev/mapper/base--storage-NAS";
|
{ device = "/dev/mapper/base--storage-NAS";
|
||||||
# fsType = "ext4";
|
fsType = "ext4";
|
||||||
# };
|
};
|
||||||
|
|
||||||
#fileSystems."/export/ShatteredMINT" =
|
#fileSystems."/export/ShatteredMINT" =
|
||||||
# { device = "/srv/dev-disk-by-uuid-18333f38-626c-4c22-af29-314a87282809";
|
# { device = "/srv/dev-disk-by-uuid-18333f38-626c-4c22-af29-314a87282809";
|
||||||
@@ -73,4 +73,11 @@
|
|||||||
networking.useDHCP = lib.mkDefault true;
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||||
|
|
||||||
|
services.cron = {
|
||||||
|
enable = true;
|
||||||
|
systemCronJobs = [
|
||||||
|
"* 20 * * * root rsync -Pav -e 'ssh -i /root/.ssh/backup' /srv backup@192.168.178.24:/ 1>> /root/backup.log 2>> /root/backup.err"
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,7 @@
|
|||||||
./configuration.nix
|
./configuration.nix
|
||||||
|
|
||||||
./users/shatteredmint.nix
|
./users/shatteredmint.nix
|
||||||
|
./software/samba.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,17 +1,37 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# mount network shares
|
environment.systemPackages = [ pkgs.cifs-utils ];
|
||||||
fileSystems."/mnt/nas/private" = {
|
fileSystems."/mnt/share/private" = {
|
||||||
device = "dashboard.omv:/ShatteredMINT";
|
device = "//192.168.178.108/shatteredmint";
|
||||||
fsType = "nfs";
|
fsType = "cifs";
|
||||||
options = [ "x-systemd.automount" "noauto" ];
|
options = let
|
||||||
|
# this line prevents hanging on network split
|
||||||
|
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
|
||||||
|
|
||||||
|
in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=${toString config.users.users.shatteredmint.uid},gid=${toString config.users.groups.users.gid}"];
|
||||||
};
|
};
|
||||||
fileSystems."/mnt/nas/shared" = {
|
fileSystems."/mnt/share/shared" = {
|
||||||
device = "dashboard.omv:/default-nas";
|
device = "//192.168.178.108/shared";
|
||||||
fsType = "nfs";
|
fsType = "cifs";
|
||||||
options = [ "x-systemd.automount" "noauto" ];
|
options = let
|
||||||
|
# this line prevents hanging on network split
|
||||||
|
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
|
||||||
|
|
||||||
|
in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=${toString config.users.users.shatteredmint.uid},gid=${toString config.users.groups.users.gid}"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# # mount network shares
|
||||||
|
# fileSystems."/mnt/nas/private" = {
|
||||||
|
# device = "dashboard.omv:/ShatteredMINT";
|
||||||
|
# fsType = "nfs";
|
||||||
|
# options = [ "x-systemd.automount" "noauto" ];
|
||||||
|
#
|
||||||
|
# };
|
||||||
|
# fileSystems."/mnt/nas/shared" = {
|
||||||
|
# device = "dashboard.omv:/default-nas";
|
||||||
|
# fsType = "nfs";
|
||||||
|
# options = [ "x-systemd.automount" "noauto" ];
|
||||||
|
#
|
||||||
|
# };
|
||||||
}
|
}
|
||||||
|
|||||||
49
software/samba.nix
Normal file
49
software/samba.nix
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
{config, pkgs, ...} : {
|
||||||
|
services = {
|
||||||
|
samba = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.samba4Full;
|
||||||
|
openFirewall = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
global = {
|
||||||
|
"server smb encrypt" = "required";
|
||||||
|
"server min protocol" = "SMB3_00";
|
||||||
|
"workgroup" = "WORKGROUP";
|
||||||
|
"security" = "user";
|
||||||
|
"browseable" = "yes";
|
||||||
|
};
|
||||||
|
|
||||||
|
# "private-shatteredmint" = {
|
||||||
|
# "path" = "/srv/shatteredmint";
|
||||||
|
# "writable" = "yes";
|
||||||
|
# "comment" = "private share for shatteredmint";
|
||||||
|
# "browseable" = "yes";
|
||||||
|
# };
|
||||||
|
"homes" = {
|
||||||
|
"path" = "/srv/private/%S";
|
||||||
|
"valid users" = "%S";
|
||||||
|
"writable" = "yes";
|
||||||
|
"comment" = "homes share";
|
||||||
|
"browseable" = "no";
|
||||||
|
"create mask" = "0700";
|
||||||
|
"directory mask" = "0700";
|
||||||
|
};
|
||||||
|
|
||||||
|
"shared" = {
|
||||||
|
"path" = "/srv/shared";
|
||||||
|
"writable" = "yes";
|
||||||
|
"comment" = "homes share";
|
||||||
|
"browseable" = "yes";
|
||||||
|
"create mask" = "0700";
|
||||||
|
"directory mask" = "0700";
|
||||||
|
"force user" = "shatteredmint";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
samba-wsdd = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKT9u43WNMlu3gnu5z9Twt1vkdNdpf6REfEK/OT4qxjK shatteredmint"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKT9u43WNMlu3gnu5z9Twt1vkdNdpf6REfEK/OT4qxjK shatteredmint"
|
||||||
];
|
];
|
||||||
|
uid = 1000;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user