feat: added better samba mounts

This commit is contained in:
Patrick 2023-09-02 21:23:47 +02:00
parent 9bd1b00f17
commit 69526fea77
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
5 changed files with 49 additions and 32 deletions

View file

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMIyksR1mSMNMBurwJTONANGLg/+SUOrbJz0u7G9XUdS root@desktopnix

View file

@ -1,31 +0,0 @@
{
pkgs,
lib,
config,
...
}: let
options = [
"noauto"
"x-systemd.idle-timeout=60"
"x-systemd.device-timeout=5s"
"x-systemd.mount-timeout=5s"
"credentials=${config.age.secrets.smb-creds.path}"
"uid=${builtins.toString config.users.users.patrick.uid}"
"gid=${builtins.toString config.users.groups.patrick.gid}"
];
in {
environment.systemPackages = [pkgs.cifs-utils];
age.secrets.smb-creds.rekeyFile = ../../secrets/smb.cred.age;
fileSystems = {
"/mnt/smb/patri-data" = {
device = "//10.0.0.1/patri-data";
fsType = "cifs";
inherit options;
};
"/mnt/smb/patri-paperless" = {
device = "//10.0.0.1/patri-paperless";
fsType = "cifs";
inherit options;
};
};
}

View file

@ -0,0 +1,42 @@
userName: {
pkgs,
config,
...
}: let
options = [
"noauto"
"x-systemd.idle-timeout=60"
"x-systemd.device-timeout=5s"
"x-systemd.mount-timeout=5s"
"credentials=${config.age.secrets.smb-creds.path}"
"uid=${builtins.toString config.users.users.${userName}.uid}"
"gid=${builtins.toString config.users.groups.${userName}.gid}"
];
in {
environment.systemPackages = [pkgs.cifs-utils];
age.secrets.smb-creds.rekeyFile = ../../secrets/smb.cred.age;
fileSystems = let
home = "/home/${userName}";
in {
"${home}/smb/patri-data" = {
device = "//192.168.178.2/patri-data";
fsType = "cifs";
inherit options;
};
"${home}/smb/ggr-data" = {
device = "//192.168.178.2/patri-paperless";
fsType = "cifs";
inherit options;
};
"${home}/smb/media" = {
device = "//192.168.178.2/media";
fsType = "cifs";
inherit options;
};
"${home}/smb/patri-paperless" = {
device = "//192.168.178.2/patri-paperless";
fsType = "cifs";
inherit options;
};
};
}

View file

@ -118,7 +118,11 @@
}
{
workspace = "2";
output = "DP-3";
output = "HDMI-A-1";
}
{
workspace = "2";
output = "DVI-D-1";
}
];
};

View file

@ -8,6 +8,7 @@
../../modules/graphical/wayland.nix
../../modules/graphical/steam.nix
(import ../../modules/impermanence/users.nix "patrick")
(import ../../modules/optional/smb-mounts.nix "patrick")
./impermanence.nix
];