feat: added better samba mounts
This commit is contained in:
parent
9bd1b00f17
commit
69526fea77
|
@ -0,0 +1 @@
|
|||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMIyksR1mSMNMBurwJTONANGLg/+SUOrbJz0u7G9XUdS root@desktopnix
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
42
modules/optional/smb-mounts.nix
Normal file
42
modules/optional/smb-mounts.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -118,7 +118,11 @@
|
|||
}
|
||||
{
|
||||
workspace = "2";
|
||||
output = "DP-3";
|
||||
output = "HDMI-A-1";
|
||||
}
|
||||
{
|
||||
workspace = "2";
|
||||
output = "DVI-D-1";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
@ -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
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue