50 lines
1 KiB
Nix
50 lines
1 KiB
Nix
{ config, ... }: let
|
|
SMBShares = [
|
|
{
|
|
host = "bastion.mlaga97.space";
|
|
share = "MyBook";
|
|
}
|
|
{
|
|
host = "bastion.mlaga97.space";
|
|
share = "Frigate";
|
|
}
|
|
{
|
|
host = "blockhouse.mlaga97.space";
|
|
share = "Parlor";
|
|
}
|
|
{
|
|
host = "blockhouse.mlaga97.space";
|
|
share = "Archive";
|
|
}
|
|
];
|
|
in {
|
|
sops.secrets = builtins.listToAttrs(
|
|
map (
|
|
x: {
|
|
name = "dotspace/smb/${x.share}";
|
|
value = {};
|
|
}
|
|
) SMBShares
|
|
);
|
|
|
|
systemd.mounts = map (
|
|
x: {
|
|
type = "cifs";
|
|
options = "rw,vers=3,credentials=${config.sops.secrets."dotspace/smb/${x.share}".path},uid=1000,gid=100,dir_mode=0775,file_mode=0775";
|
|
what = "//${x.host}.mlaga97.space/${x.share}";
|
|
where = "/${x.share}";
|
|
}
|
|
) SMBShares;
|
|
|
|
systemd.automounts = map (
|
|
x: {
|
|
wantedBy = [ "multi-user.target" ];
|
|
automountConfig = {
|
|
TimeoutIdleSec = "60";
|
|
DeviceTimeout = "5";
|
|
MountTimeout = "5";
|
|
};
|
|
where = "/${x.share}";
|
|
}
|
|
) SMBShares;
|
|
}
|