From dacc41068ba332e7c72b0de9ce62f3cdfb8ae6a6 Mon Sep 17 00:00:00 2001 From: Tyler Beckman Date: Sun, 15 Dec 2024 23:45:19 -0700 Subject: [PATCH] Allow local deployment --- flake.nix | 12 ++++++++++-- utils/default.nix | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index ceb943b..ba201e5 100755 --- a/flake.nix +++ b/flake.nix @@ -72,8 +72,16 @@ # Setup colmena configurations colmena = utils.createColmenaHive { hostConfigs = [ - { name = "ty-nixos"; entrypoint = ./hosts/laptop; } - { name = "ty-laptop-server"; entrypoint = ./hosts/laptop-server; sshHost = "old-lenovo-laptop"; } + { + name = "ty-nixos"; + entrypoint = ./hosts/laptop; + allowLocal = true; + } + { + name = "ty-laptop-server"; + entrypoint = ./hosts/laptop-server; + sshHost = "old-lenovo-laptop"; + } ]; }; diff --git a/utils/default.nix b/utils/default.nix index 69f2597..417f6fc 100644 --- a/utils/default.nix +++ b/utils/default.nix @@ -63,10 +63,11 @@ acc // { ${cur.name} = { ... }: { deployment = { - replaceUnknownProfiles = false; + replaceUnknownProfiles = if (builtins.hasAttr "allowLocal" cur) then cur.allowLocal else false; targetUser = if (builtins.hasAttr "sshUser" cur) then cur.sshUser else "root"; targetHost = if (builtins.hasAttr "sshHost" cur) then cur.sshHost else cur.name; targetPort = if (builtins.hasAttr "sshPort" cur) then cur.sshPort else 22; + allowLocalDeployment = if (builtins.hasAttr "allowLocal" cur) then cur.allowLocal else false; }; imports = [ cur.entrypoint ];