Added SMB share to Desktop

This commit is contained in:
2026-04-16 16:12:32 +02:00
parent 43ab264adc
commit 36c407cb55
2 changed files with 51 additions and 7 deletions

View File

@@ -2,6 +2,7 @@
config,
lib,
modulesPath,
primaryUser,
...
}:
@@ -32,6 +33,17 @@
'';
};
sops = {
secrets.smb_passwd = { };
templates.smb_credentials = {
content = ''
username=${primaryUser}
password=${config.sops.placeholder.smb_passwd}
'';
};
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXROOT";
@@ -51,7 +63,32 @@
device = "/dev/disk/by-label/STORAGE";
fsType = "ext4";
};
};
}
// builtins.listToAttrs (
map
(share: {
name = "/shares/${share}";
value = {
device = "//127.0.0.1/${share}";
fsType = "cifs";
options = [
"credentials=${config.sops.templates.smb_credentials.path}"
"iocharset=utf8"
"_netdev"
"auto"
"x-systemd.requires=samba-smbd.service"
"x-systemd.after=samba-smbd.service"
"x-systemd.requires=sops-install-secrets.service"
"x-systemd.after=sops-install-secrets.service"
];
};
})
[
"internal"
"fast"
"backup"
]
);
swapDevices = [ ];