nixos-config/profiles/filesystems.nix

120 lines
3.2 KiB
Nix
Raw Normal View History

2019-09-18 02:23:45 +04:00
{ pkgs, lib, config, ... }:
with rec {
2021-06-29 22:28:37 +03:00
inherit (config) deviceSpecific secrets device;
2019-09-18 02:23:45 +04:00
};
2020-08-07 15:57:08 +04:00
with deviceSpecific;
{
2021-06-29 22:28:37 +03:00
secrets.samba = {
2021-06-16 23:42:44 +03:00
services = [ ];
};
2020-09-08 03:07:50 +04:00
2019-08-27 23:41:02 +04:00
fileSystems = {
2019-09-18 02:23:45 +04:00
"/shared/nixos" = lib.mkIf isVM {
2019-08-27 23:41:02 +04:00
fsType = "vboxsf";
device = "shared";
2019-09-16 15:01:09 +04:00
options = [
"rw"
"nodev"
"relatime"
"nofail"
"dmode=0755"
"fmode=0644"
"uid=${toString config.users.users.alukard.uid}"
2021-09-28 01:39:21 +03:00
"gid=${toString config.users.groups.smbuser.gid}"
2019-09-16 15:01:09 +04:00
];
2019-08-27 23:41:02 +04:00
};
2021-06-29 22:28:37 +03:00
"/media/data" = if (device == "AMD-Workstation") then {
2019-09-29 14:59:51 +04:00
# Samba host
2019-09-28 01:53:49 +04:00
fsType = "ntfs";
2021-06-29 22:28:37 +03:00
device = "/dev/disk/by-partuuid/a61ac8ea-53b9-462f-8a93-a5c07b131209";
2019-09-28 01:53:49 +04:00
options = [
# "noatime"
"nofail"
"uid=${toString config.users.users.alukard.uid}"
2021-09-28 01:39:21 +03:00
"gid=${toString config.users.groups.smbuser.gid}"
2019-09-28 01:53:49 +04:00
];
2019-09-29 14:59:51 +04:00
} else {
# Linux samba
fsType = "cifs";
device = "//192.168.0.100/data";
options = [
2021-06-29 22:28:37 +03:00
"credentials=${secrets.samba.decrypted}"
2019-09-29 14:59:51 +04:00
"uid=${toString config.users.users.alukard.uid}"
"gid=${toString config.users.groups.users.gid}"
2020-08-07 15:57:08 +04:00
"vers=3.0"
"nofail"
"noauto"
"x-systemd.automount"
2021-06-29 22:28:37 +03:00
"x-systemd.mount-timeout=5"
2020-08-07 15:57:08 +04:00
"_netdev"
2019-09-29 14:59:51 +04:00
];
2019-09-28 01:53:49 +04:00
};
2021-06-29 22:28:37 +03:00
"/media/files" = if (device == "AMD-Workstation") then {
2019-09-29 14:59:51 +04:00
# Samba host
2019-09-28 01:53:49 +04:00
fsType = "ntfs";
device = "/dev/disk/by-partuuid/8a1d933c-302b-4e62-b9af-a45ecd05777f";
options = [
# "noatime"
"nofail"
"uid=${toString config.users.users.alukard.uid}"
2021-09-28 01:39:21 +03:00
"gid=${toString config.users.groups.smbuser.gid}"
2019-09-28 01:53:49 +04:00
];
2019-09-29 14:59:51 +04:00
} else {
# Linux samba
fsType = "cifs";
device = "//192.168.0.100/files";
options = [
2021-06-29 22:28:37 +03:00
"credentials=${secrets.samba.decrypted}"
2019-09-18 02:23:45 +04:00
"uid=${toString config.users.users.alukard.uid}"
"gid=${toString config.users.groups.users.gid}"
2020-08-07 15:57:08 +04:00
"vers=3.0"
"nofail"
"noauto"
"x-systemd.automount"
2021-06-29 22:28:37 +03:00
"x-systemd.mount-timeout=5"
2020-08-07 15:57:08 +04:00
"_netdev"
2019-09-18 02:23:45 +04:00
];
};
2020-08-15 19:36:16 +04:00
2021-11-12 05:39:29 +03:00
"/media/local/win-data" = lib.mkIf (device == "Dell-Laptop") {
2021-09-28 01:40:42 +03:00
fsType = "ntfs";
device = "/dev/disk/by-partuuid/506c04f2-ecb1-4747-843a-576163828373";
options = [
"nofail"
"uid=${toString config.users.users.alukard.uid}"
"gid=${toString config.users.groups.users.gid}"
"dmask=027"
"fmask=137"
"rw"
];
};
2021-11-12 05:39:29 +03:00
"/media/local/win-sys" = lib.mkIf (device == "Dell-Laptop") {
2021-09-28 01:40:42 +03:00
fsType = "ntfs";
2021-11-12 05:39:29 +03:00
device = "/dev/disk/by-partuuid/e4786ca3-bebf-4a03-9dbf-49ec65b24984";
2021-09-28 01:40:42 +03:00
options = [
"nofail"
"uid=${toString config.users.users.alukard.uid}"
"gid=${toString config.users.groups.users.gid}"
"dmask=027"
"fmask=137"
"ro"
];
};
2020-08-15 19:36:16 +04:00
# Music folder
2021-06-16 05:30:04 +03:00
# TODO: FIXIT
2020-08-15 19:36:16 +04:00
"/home/alukard/Music" = {
fsType = "none";
2021-06-29 22:28:37 +03:00
device = "/media/files/Music";
depends = [ "/media/files" ];
2020-08-15 19:36:16 +04:00
options = [
"uid=${toString config.users.users.alukard.uid}"
"gid=${toString config.users.groups.users.gid}"
"bind"
"nofail"
"_netdev"
];
};
2019-08-27 23:41:02 +04:00
};
2020-03-22 01:07:54 +04:00
}