Major refactor of dotspace config
This commit is contained in:
parent
53c3b2bb19
commit
f6e96617df
24 changed files with 198 additions and 172 deletions
50
dotspace/parts/cifs.nix
Normal file
50
dotspace/parts/cifs.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{ 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue