25 lines
690 B
Nix
25 lines
690 B
Nix
{ config, lib, ... }:
|
|
let
|
|
inherit (lib) mkDefault mkOption types;
|
|
|
|
cfg = config.custom;
|
|
in
|
|
{
|
|
options = {
|
|
custom.cifs-mounts = mkOption { type = with types; (listOf str); };
|
|
};
|
|
|
|
config = {
|
|
services.cachefilesd.enable = true;
|
|
|
|
systemd.mounts = map (share: {
|
|
what = "//u380335-sub1.your-storagebox.de/u380335-sub1/${share}";
|
|
where = "/mnt/storage/${share}";
|
|
type = "cifs";
|
|
options = mkDefault "rw,uid=${share},gid=${share},credentials=${config.sops.secrets.storage_box_mount.path},_netdev,fsc";
|
|
before = [ "${share}.service" ];
|
|
after = [ "cachefilesd.service" ];
|
|
wantedBy = [ "${share}.service" ];
|
|
}) cfg.cifs-mounts;
|
|
};
|
|
}
|