add sambna and change backups to hourly

This commit is contained in:
death916 2025-06-16 02:22:12 -07:00
parent a884bd2911
commit e39c36d8a5
2 changed files with 33 additions and 2 deletions

30
modules/smb.nix Normal file
View file

@ -0,0 +1,30 @@
{ config, pkgs, ... }:
{
services.samba = {
enable = true;
openFirewall = false;
shares = {
Media = {
browseable = "yes";
"read only" = "no";
"guest ok" = "no"; # Disables guest access, requires a user login
# This is the key: any new file or directory created through the share
# will be assigned to the 'media_services' group.
"force group" = "media_services";
# Set permissions for new files/dirs to allow group write access.
"create mask" = "0660"; # File permissions: rw-rw----
"directory mask" = "0770"; # Directory permissions: rwxrwx---
};
};
};
# Enable network discovery service for clients.
services.samba-wsdd = {
enable = true;
openFirewall = false;
};
}

View file

@ -15,9 +15,10 @@
# ../modules/home-assistant.nix
# ../modules/home-assistant-vm.nix
../modules/vms/incus-base.nix
../modules/smb.nix
];
arrSuite.enable = true;
services.samba.shares.Media.path = "/media/storage/media"
# nixpkgs.config.allowUnfree = true;
boot.loader.systemd-boot.enable = true; # Or grub, as appropriate for your server
boot.loader.efi.canTouchEfiVariables = true;
@ -284,7 +285,7 @@
wantedBy = [ "timers.target" ];
partOf = [ "kopia-backup.service" ]; # Links timer to the service
timerConfig = {
OnCalendar = "daily"; # Or "hourly", "*-*-* 02:00:00" for 2 AM daily, etc.
OnCalendar = "hourly"; # Or "hourly", "*-*-* 02:00:00" for 2 AM daily, etc.
Persistent = true; # Run on next boot if a scheduled run was missed
Unit = "kopia-backup.service";
};