From 253c5faa98b7f348e5e3fff6099ed82b44f51861 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Fri, 27 Oct 2023 21:47:36 +0200 Subject: [PATCH] pinwheel/sombrero: Use shared module for `syncthing` device ids --- hosts/pinwheel/configuration.nix | 1 + hosts/pinwheel/modules/syncthing/default.nix | 4 ++-- hosts/sombrero/configuration.nix | 1 + hosts/sombrero/modules/syncthing/default.nix | 4 ++-- shared-modules/syncthing.nix | 9 +++++++++ 5 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 shared-modules/syncthing.nix diff --git a/hosts/pinwheel/configuration.nix b/hosts/pinwheel/configuration.nix index 5f5ce57..f1e69ca 100644 --- a/hosts/pinwheel/configuration.nix +++ b/hosts/pinwheel/configuration.nix @@ -3,6 +3,7 @@ imports = [ ../../config-manager/default.nix + ../../shared-modules/syncthing.nix ./hardware-configuration.nix ./modules ]; diff --git a/hosts/pinwheel/modules/syncthing/default.nix b/hosts/pinwheel/modules/syncthing/default.nix index 235fe14..d8b6808 100644 --- a/hosts/pinwheel/modules/syncthing/default.nix +++ b/hosts/pinwheel/modules/syncthing/default.nix @@ -14,8 +14,8 @@ settings = { devices = { - sombrero.id = "DIKHOMV-QGZV3DR-FXQZH45-I5J5R4R-JJZS5BA-XNNW5C7-QSSU3XV-KVC4MAQ"; - phone.id = "NJIMX57-C2CGV76-GXMAQYV-ABWDA7Z-TS6UV2X-NVL5UPG-UFEQH4C-TKYA6QM"; + phone.id = config.lib.syncthing.phone; + sombrero.id = config.lib.syncthing.sombrero; }; folders = { diff --git a/hosts/sombrero/configuration.nix b/hosts/sombrero/configuration.nix index 4a0e6a3..e9b1d71 100644 --- a/hosts/sombrero/configuration.nix +++ b/hosts/sombrero/configuration.nix @@ -3,6 +3,7 @@ imports = [ ../../config-manager/default.nix + ../../shared-modules/syncthing.nix ./hardware-configuration.nix ./modules ]; diff --git a/hosts/sombrero/modules/syncthing/default.nix b/hosts/sombrero/modules/syncthing/default.nix index 90f2201..440ee3c 100644 --- a/hosts/sombrero/modules/syncthing/default.nix +++ b/hosts/sombrero/modules/syncthing/default.nix @@ -42,8 +42,8 @@ in }; devices = { - phone.id = "NJIMX57-C2CGV76-GXMAQYV-ABWDA7Z-TS6UV2X-NVL5UPG-UFEQH4C-TKYA6QM"; - pinwheel.id = "AKS5L2A-NFCG5GV-3U5SSSZ-PLOX6BQ-ZL5ALXI-D7OK4KE-R2JPWRJ-B6AQJQ7"; + phone.id = config.lib.syncthing.phone; + pinwheel.id = config.lib.syncthing.pinwheel; }; folders = { diff --git a/shared-modules/syncthing.nix b/shared-modules/syncthing.nix new file mode 100644 index 0000000..c229663 --- /dev/null +++ b/shared-modules/syncthing.nix @@ -0,0 +1,9 @@ +{ + lib = { + syncthing = { + phone = "NJIMX57-C2CGV76-GXMAQYV-ABWDA7Z-TS6UV2X-NVL5UPG-UFEQH4C-TKYA6QM"; + sombrero = "DIKHOMV-QGZV3DR-FXQZH45-I5J5R4R-JJZS5BA-XNNW5C7-QSSU3XV-KVC4MAQ"; + pinwheel = "AKS5L2A-NFCG5GV-3U5SSSZ-PLOX6BQ-ZL5ALXI-D7OK4KE-R2JPWRJ-B6AQJQ7"; + }; + }; +}