diff --git a/config/jawz.nix b/config/jawz.nix index b0bc366..96a8b95 100644 --- a/config/jawz.nix +++ b/config/jawz.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, lib, ... }: let inherit (config.networking) hostName; in @@ -42,52 +42,55 @@ in galaxy.id = "UAZ5YDV-YUFBXOY-QMS6S6R-WPIIKZI-4OPPW5L-G4OVUPO-YW5KFYY-YASRAAV"; phone.id = "OSOX2VZ-AO2SA3C-BFB6NKF-K6CR6WX-64TDBKW-RRKEKJ4-FKZE5CV-J2RGJAJ"; }; - folders = { - cache = { - path = "~/Downloads/cache/"; - ignorePerms = false; - devices = [ - "galaxy" - "phone" - ]; + folders = + let + isMainHost = hostName == "workstation"; + mkMobile = + path: + lib.mkIf isMainHost { + inherit path; + ignorePerms = false; + devices = [ + "galaxy" + "phone" + ]; + }; + in + { + cache = mkMobile "~/Downloads/cache/"; + friends = mkMobile "~/Pictures/Art/Friends/"; + forme = mkMobile "~/Pictures/Art/4me/"; + gdl = { + path = "~/.config/jawz/"; + ignorePerms = false; + devices = [ + "server" + "miniserver" + "workstation" + ]; + }; + librewolf = { + path = "~/.librewolf/"; + ignorePerms = false; + copyOwnershipFromParent = true; + type = if isMainHost then "sendonly" else "receiveonly"; + devices = [ + "server" + "miniserver" + "workstation" + ]; + }; + notes = { + path = "~/Documents/Notes"; + ignorePerms = false; + devices = [ + "galaxy" + "phone" + "server" + "miniserver" + ]; + }; }; - commissions = { - path = "~/Pictures/Art/4me/"; - ignorePerms = false; - devices = [ - "galaxy" - "phone" - ]; - }; - gdl = { - path = "~/.config/jawz/"; - ignorePerms = false; - devices = [ - "server" - "miniserver" - "workstation" - ]; - }; - librewolf = { - path = "~/.librewolf/"; - ignorePerms = false; - copyOwnershipFromParent = true; - type = if config.networking.hostName == "workstation" then "sendonly" else "receiveonly"; - devices = [ - "server" - "miniserver" - "workstation" - ]; - }; - notes = { - path = "~/Documents/"; - ignorePerms = false; - devices = [ - "galaxy" - "phone" - ]; - }; - }; }; }; users.users.jawz = {