mirror of
https://github.com/Nickiel12/nicks-nix-config.git
synced 2025-01-17 23:43:27 -08:00
Added a backup for a specific shared folder
This commit is contained in:
parent
716da06947
commit
663e78e5dd
3 changed files with 34 additions and 2 deletions
|
@ -37,6 +37,11 @@
|
||||||
backup_dir = "/Aurora/Backups/Vaultwarden";
|
backup_dir = "/Aurora/Backups/Vaultwarden";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
samba_shares = {
|
||||||
|
enable = true;
|
||||||
|
backup_dir = "/Aurora/SharedFolders/Blizzard"; # only backup one folder
|
||||||
|
};
|
||||||
|
|
||||||
forgejo = {
|
forgejo = {
|
||||||
enable = true;
|
enable = true;
|
||||||
backups_dir = "/Aurora/Backups/Forgejo";
|
backups_dir = "/Aurora/Backups/Forgejo";
|
||||||
|
|
|
@ -63,6 +63,18 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
samba_shares = {
|
||||||
|
enable = lib.mkEnableOption (lib.mdDoc "Back up Samba shared folders");
|
||||||
|
|
||||||
|
backup_dir = lib.mkOption {
|
||||||
|
type = lib.types.path;
|
||||||
|
default = "/Aurora/SharedFolders";
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
The path of the shared folders used by samba
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
nextcloud = {
|
nextcloud = {
|
||||||
enable = lib.mkEnableOption (lib.mkDoc "Back up nextcloud instance");
|
enable = lib.mkEnableOption (lib.mkDoc "Back up nextcloud instance");
|
||||||
root_dir = lib.mkOption {
|
root_dir = lib.mkOption {
|
||||||
|
@ -139,6 +151,12 @@ in
|
||||||
echo "Mounting the external backup drive"
|
echo "Mounting the external backup drive"
|
||||||
mount /dev/disk/by-label/${cfg.backup1_drive_label} ${builtins.toString cfg.tmp_mount_point} -t ntfs3
|
mount /dev/disk/by-label/${cfg.backup1_drive_label} ${builtins.toString cfg.tmp_mount_point} -t ntfs3
|
||||||
|
|
||||||
|
#----- BEGIN SAMBA SHARES
|
||||||
|
if [ "${builtins.toString cfg.samba_shares.enable}" = "1" ]; then
|
||||||
|
rsync -av ${cfg.samba_shares.backup_dir} ${builtins.toString cfg.tmp_mount_point}
|
||||||
|
fi
|
||||||
|
#----- END SAMBA SHARES
|
||||||
|
|
||||||
#------ BEGIN NEXTCLOUD
|
#------ BEGIN NEXTCLOUD
|
||||||
if [ "${builtins.toString cfg.nextcloud.enable}" = "1" ]; then
|
if [ "${builtins.toString cfg.nextcloud.enable}" = "1" ]; then
|
||||||
echo "Putting nextcloud into maintenance mode so that changes cannot happen during the backup"
|
echo "Putting nextcloud into maintenance mode so that changes cannot happen during the backup"
|
||||||
|
|
|
@ -7,18 +7,27 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
global.workgroup = "WORKGROUP";
|
||||||
global."invalid users" = [
|
global."invalid users" = [
|
||||||
"root"
|
"root"
|
||||||
];
|
];
|
||||||
global.security = "user";
|
global.security = "user";
|
||||||
global."passwd program" = "/run/wrappers/bin/passwd %u";
|
global."passwd program" = "/run/wrappers/bin/passwd %u";
|
||||||
Iceberg = {
|
iceberg = {
|
||||||
comment = "the Alaska SMB share";
|
comment = "the Alaska SMB share";
|
||||||
path = "/Aurora/SharedFolders/Iceberg";
|
path = "/Aurora/SharedFolders/Iceberg";
|
||||||
"guest ok" = "yes";
|
"guest ok" = "no";
|
||||||
"read only" = "no";
|
"read only" = "no";
|
||||||
browseable = "yes";
|
browseable = "yes";
|
||||||
};
|
};
|
||||||
|
blizzard = {
|
||||||
|
comment = "Backed up Alaska SMB share";
|
||||||
|
path = "/Aurora/SharedFolders/Blizzard";
|
||||||
|
"guest ok" = "no";
|
||||||
|
"read only" = "no";
|
||||||
|
browseable = "yes";
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue