Fix SMB service

This commit is contained in:
♥ Minnie ♥ 2024-07-16 21:27:20 +08:00
parent 98891a9b15
commit 1fa3e16a8c
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
4 changed files with 15 additions and 11 deletions

View file

@ -1,14 +1,18 @@
{ config, ... }:
{ pkgs, config, ... }:
{
age.secrets.smb-secrets = {
rekeyFile = ./smb-secrets.age;
};
# For mount.cifs, required unless domain name resolution is not needed.
environment.systemPackages = [ pkgs.cifs-utils ];
fileSystems."/home/sajenim/.backup" = {
device = "//192.168.1.102/sajenim";
device = "//192.168.20.4/sajenim";
fsType = "cifs";
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,user,users";
in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1000,gid=100"];