summaryrefslogtreecommitdiff
path: root/hosts/shared
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-11-01 23:54:56 -0700
committerFuwn <[email protected]>2024-11-01 23:54:56 -0700
commitb7f007010e6e0eb5501dabb1898f466659cf1ff9 (patch)
treed525741855eeaf8ba2f7201dba422d6e31c7fc4d /hosts/shared
parenthosts: kioku mount options (diff)
downloadnixos-config-b7f007010e6e0eb5501dabb1898f466659cf1ff9.tar.xz
nixos-config-b7f007010e6e0eb5501dabb1898f466659cf1ff9.zip
kansai: plex mount module, extra kioku mount options
Diffstat (limited to 'hosts/shared')
-rw-r--r--hosts/shared/hardware-configuration.nix91
1 files changed, 63 insertions, 28 deletions
diff --git a/hosts/shared/hardware-configuration.nix b/hosts/shared/hardware-configuration.nix
index eed2ce3..7f5bb4f 100644
--- a/hosts/shared/hardware-configuration.nix
+++ b/hosts/shared/hardware-configuration.nix
@@ -1,33 +1,68 @@
{ config, ... }:
+let
+ plex = config.modules.mounts.plex;
+ kioku = config.modules.mounts.kioku;
+in
{
- fileSystems."/mnt/kioku" =
- let
- sharedOptions = [
- "x-systemd.automount"
- "noauto"
- "x-systemd.idle-timeout=60"
- "x-systemd.device-timeout=5s"
- "x-systemd.mount-timeout=5s"
- "rw"
- "nofail"
- "noatime"
- "uid=1000"
- "gid=1000"
- ];
- in
- if config.modules.mounts.kioku.withSamba then
- {
- device = "//kioku/usb";
- fsType = "cifs";
+ fileSystems =
+ {
+ "/mnt/${kioku.name}" =
+ let
+ sharedOptions = [
+ "x-systemd.automount"
+ "noauto"
+ "x-systemd.idle-timeout=60"
+ "x-systemd.device-timeout=5s"
+ "x-systemd.mount-timeout=5s"
+ "rw"
+ "nofail"
+ "noatime"
+ "uid=1000"
+ "gid=1000"
+ ];
+ in
+ if kioku.withSamba then
+ {
+ device = "//${kioku.name}/${kioku.shareName}";
+ fsType = "cifs";
- options = [
- "credentials=${config.sops.secrets.samba_secrets.path}"
- ] ++ sharedOptions;
- }
+ options = [
+ "credentials=${config.sops.secrets.samba_secrets.path}"
+ ] ++ sharedOptions ++ kioku.extraOptions;
+ }
+ else
+ {
+ device = kioku.device;
+ fsType = "exfat";
+ options = sharedOptions;
+ };
+ }
+ // (
+ if plex.enable then
+ {
+ "/mnt/${plex.name}" = {
+ device = "/dev/mapper/${plex.name}";
+ fsType = "exfat";
+
+ options = [
+ "rw"
+ "nofail"
+ "uid=1000"
+ "gid=1000"
+ "dmask=027"
+ "fmask=137"
+ ] ++ plex.extraOptions;
+ };
+ }
+ else
+ { }
+ );
+
+ environment.etc.crypttab.text =
+ if plex.enable then
+ ''
+ ${plex.name} /dev/disk/by-partlabel/WD_BLACK ${config.sops.secrets.plex_drive_bitlocker_recovery_key.path} bitlk
+ ''
else
- {
- device = "/dev/disk/by-uuid/67BF-FE53";
- fsType = "exfat";
- options = sharedOptions;
- };
+ "";
}