From 0625eb1bf84f36d39617cfd557b92102cd708ce0 Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 2 Mar 2023 07:49:29 +0000 Subject: [PATCH] flake: add "applications" to deploy to moby --- flake.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/flake.nix b/flake.nix index 86b439463..8c15656e3 100644 --- a/flake.nix +++ b/flake.nix @@ -198,6 +198,11 @@ apps."x86_64-linux" = let pkgs = self.legacyPackages."x86_64-linux"; + deployScript = action: pkgs.writeShellScript "deploy-moby" '' + nixos-rebuild --flake '.#cross-moby' build + sudo nix sign-paths -r -k /run/secrets/nix_serve_privkey $(readlink ./result) + nixos-rebuild --flake '.#cross-moby' ${action} --target-host colin@moby --use-remote-sudo + ''; in { update-feeds = { type = "app"; @@ -209,6 +214,17 @@ type = "app"; program = "${pkgs.feeds.passthru.initFeedScript}"; }; + + deploy-moby-test = { + # `nix run '.#deploy-moby-test'` + type = "app"; + program = ''${deployScript "test"}''; + }; + deploy-moby-switch = { + # `nix run '.#deploy-moby-switch'` + type = "app"; + program = ''${deployScript "switch"}''; + }; }; templates = {