mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-06 21:17:14 -06:00
feat: added samba mount
This commit is contained in:
parent
b9d448a009
commit
35676b37f7
1 changed files with 48 additions and 1 deletions
|
|
@ -1,3 +1,34 @@
|
|||
{
|
||||
flake,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (flake.config.machines.devices) ceres;
|
||||
inherit (flake.config.services) instances;
|
||||
ceresSecrets = config.sops.secrets."network/server".path;
|
||||
|
||||
sambaDrives = [
|
||||
"samba0"
|
||||
];
|
||||
|
||||
sambaFolders = [
|
||||
instances.jellyfin.name
|
||||
];
|
||||
|
||||
sambaMounts = sambaDrive: folder: {
|
||||
name = "${ceres.${sambaDrive}.mount}/${folder}";
|
||||
value = {
|
||||
device = "${ceres.${sambaDrive}.device}/${folder}";
|
||||
fsType = "cifs";
|
||||
options = ceres.${sambaDrive}.options ++ [
|
||||
"credentials=${ceresSecrets}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
|
|
@ -8,11 +39,27 @@
|
|||
device = "/dev/disk/by-uuid/B645-7527";
|
||||
fsType = "vfat";
|
||||
};
|
||||
};
|
||||
"/mnt/raid0" = {
|
||||
device = "/dev/md0";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"defaults"
|
||||
"nofail"
|
||||
];
|
||||
};
|
||||
}
|
||||
// (builtins.listToAttrs (
|
||||
builtins.concatMap (drive: map (folder: sambaMounts drive folder) sambaFolders) sambaDrives
|
||||
));
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-uuid/9a2e032d-8627-49cf-8f3f-8fdf2be5fed4"; }
|
||||
];
|
||||
|
||||
boot.swraid.enable = true;
|
||||
boot.swraid.mdadmConf = ''
|
||||
ARRAY /dev/md0 level=raid0 num-devices=2 metadata=1.2
|
||||
'';
|
||||
|
||||
services.udisks2.enable = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue