From 2ca9e9a16e1c48b46ef713e5c2f5092bdfac9b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 4 Oct 2023 08:27:00 +0200 Subject: [PATCH] restore possibility to update all machines without having to specify them --- lib/build-clan/default.nix | 3 +++ nixosModules/clanCore/flake-module.nix | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/build-clan/default.nix b/lib/build-clan/default.nix index 48465b07d..3b2a5b679 100644 --- a/lib/build-clan/default.nix +++ b/lib/build-clan/default.nix @@ -52,5 +52,8 @@ in clanInternals = { machines = configsPerSystem; + all-machines-json = lib.mapAttrs + (system: configs: nixpkgs.legacyPackages.${system}.writers.writeJSON "machines.json" (lib.mapAttrs (_: m: m.config.system.clan.deployment.data) configs)) + configsPerSystem; }; } diff --git a/nixosModules/clanCore/flake-module.nix b/nixosModules/clanCore/flake-module.nix index d87db4598..96c0580ae 100644 --- a/nixosModules/clanCore/flake-module.nix +++ b/nixosModules/clanCore/flake-module.nix @@ -42,12 +42,12 @@ }; # optimization for faster secret generate/upload and machines update config = { - system.clan.deployment.text = builtins.toJSON { + system.clan.deployment.data = { inherit (config.system.clan) uploadSecrets generateSecrets; inherit (config.clan.networking) deploymentAddress; inherit (config.clanCore) secretsUploadDirectory; }; - system.clan.deployment.file = pkgs.writeText "deployment.json" config.system.clan.deployment.text; + system.clan.deployment.file = pkgs.writeText "deployment.json" (builtins.toJSON config.system.clan.deployment.data); }; }; }