Heavily inspired by https://github.com/Doc-Steve/dendritic-design-with-flake-parts. > Atomic commits? Never heard of them!
37 lines
699 B
Nix
37 lines
699 B
Nix
{
|
|
config.flake.factory.mount-cifs =
|
|
{ host
|
|
, resource
|
|
, destination
|
|
, credentials_path
|
|
, UID
|
|
, GID
|
|
,
|
|
}: {
|
|
fileSystems."${destination}" = {
|
|
device = "//${host}/${resource}";
|
|
fsType = "cifs";
|
|
options = [
|
|
# automount
|
|
"x-systemd.automount"
|
|
"noauto"
|
|
"nofail"
|
|
"soft"
|
|
"x-systemd.idle-timeout=60"
|
|
"x-systemd.device-timeout=5s"
|
|
"x-systemd.mount-timeout=5s"
|
|
|
|
# mount options
|
|
"rw"
|
|
"iocharset=utf8"
|
|
|
|
# user
|
|
"uid=${UID}"
|
|
"gid=${GID}"
|
|
|
|
"credentials=${credentials_path}"
|
|
];
|
|
};
|
|
};
|
|
}
|