mount a share

This commit is contained in:
able 2023-10-04 04:52:32 -05:00
parent be29f3167a
commit a9e45d5b17
2 changed files with 21 additions and 1 deletions

1
.gitignore vendored
View file

@ -0,0 +1 @@
smb-secrets

View file

@ -388,6 +388,21 @@
"inode/directory" = [ "nemo.desktop" "code.desktop" ]; "inode/directory" = [ "nemo.desktop" "code.desktop" ];
}; };
services.gvfs.enable = true;
environment.systemPackages = [ pkgs.cifs-utils ];
fileSystems."/home/able/Documents/media" = {
device = "//10.0.0.28/media/";
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";
in
[
"${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1000,gid=100"
];
};
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
# services.openssh.enable = true; # services.openssh.enable = true;
@ -403,5 +418,9 @@
# this value at the release version of the first install of this system. # this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment? system.stateVersion = "
22.11
"; # Did you read the comment?
} }