ctucx.git: nixfiles

ctucx' nixfiles

commit 732d7dbd52047db0a3d13674821188f8c10a3a58
parent 29a474a277eaf7257906a2f614f66e9d76e9e109
Author: Leah (ctucx) <leah@ctu.cx>
Date: Tue, 15 Mar 2022 00:02:12 +0100

syncthing: support macos homes
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/configurations/services/syncthing.nix b/configurations/services/syncthing.nix
@@ -1,7 +1,7 @@
 { config, pkgs, lib, ... }:
 
 let
-  syncthingConfig = import ../syncthing.nix { inherit config; inherit lib; };
+  syncthingConfig = import ../syncthing.nix { inherit pkgs; inherit config; inherit lib; };
 
 in {
 
diff --git a/configurations/syncthing.nix b/configurations/syncthing.nix
@@ -1,7 +1,8 @@
-{ config, lib, ... }:
+{ pkgs, config, lib, ... }:
 
 let
   secrets = import ../secrets;
+
   devices = {
     #laptops/desktops
     coladose.id       = secrets.syncthing.ids.coladose;

@@ -76,7 +77,8 @@ let
       false;
 
   appendDataDirHosts = [ "desastro" "lollo" "taurus" "osterei" ];
-  dataDir            = "/home/leah" + (if builtins.elem config.networking.hostName appendDataDirHosts then "/syncthing" else "");
+  homeDir            = if pkgs.stdenv.isLinux then "/home" else "/Users";
+  dataDir            = "${homeDir}/leah" + (if builtins.elem config.networking.hostName appendDataDirHosts then "/syncthing" else "");
 
 in {