add cifs client side mounts
This commit is contained in:
70
modules/system/cifs_mounts/default.nix
Normal file
70
modules/system/cifs_mounts/default.nix
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.system.flatpak;
|
||||
sec = config.sops.secrets;
|
||||
in {
|
||||
options.system.flatpak = {
|
||||
enable = lib.mkEnableOption "enables mounting holocron fileshare on the client side";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
cifs-utils
|
||||
];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
fileSystems."/media/holocron/blake" = {
|
||||
device = "//10.10.0.10/users/blake";
|
||||
fsType = "cifs";
|
||||
options = [
|
||||
"x-systemd.automount"
|
||||
"noauto"
|
||||
"_netdev"
|
||||
"credentials=${sec."holocron_creds".path}"
|
||||
"uid=1000"
|
||||
"gid=1000"
|
||||
"file_mode=0664"
|
||||
"dir_mode=0775"
|
||||
];
|
||||
};
|
||||
fileSystems."/media/holocron/archives" = {
|
||||
device = "//10.10.0.10/archives";
|
||||
fsType = "cifs";
|
||||
options = [
|
||||
"x-systemd.automount"
|
||||
"noauto"
|
||||
"_netdev"
|
||||
"credentials=${sec."holocron_creds".path}"
|
||||
"uid=1000"
|
||||
"gid=1000"
|
||||
"file_mode=0664"
|
||||
"dir_mode=0775"
|
||||
];
|
||||
};
|
||||
fileSystems."/media/holocron/media" = {
|
||||
device = "//10.10.0.10/media";
|
||||
fsType = "cifs";
|
||||
options = [
|
||||
"x-systemd.automount"
|
||||
"noauto"
|
||||
"_netdev"
|
||||
"credentials=${sec."holocron_creds".path}"
|
||||
"uid=1000"
|
||||
"gid=1000"
|
||||
"file_mode=0664"
|
||||
"dir_mode=0775"
|
||||
];
|
||||
};
|
||||
# manage secrets with sops
|
||||
sops.secrets = {
|
||||
"holocron_creds" = {
|
||||
owner = "blake";
|
||||
group = "blake";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user