From 826c32e8956466e88f808565d3a5c9f8af009a2c Mon Sep 17 00:00:00 2001 From: thiloho <123883702+thiloho@users.noreply.github.com> Date: Fri, 24 Oct 2025 13:49:02 +0200 Subject: [PATCH] Add remote deployment script --- flake.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/flake.nix b/flake.nix index 2c3938c..db82d91 100644 --- a/flake.nix +++ b/flake.nix @@ -36,6 +36,35 @@ } ); + apps = forAllSystems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + deployServerScript = pkgs.writeShellApplication { + name = "deploy-server"; + runtimeInputs = [ + pkgs.nix + pkgs.openssh + ]; + text = '' + nix run nixpkgs#nixos-rebuild-ng -- \ + --flake .#server \ + --target-host thohlt@91.98.171.83 \ + --sudo \ + --ask-sudo-password \ + switch + ''; + }; + in + { + deploy-server = { + type = "app"; + program = "${deployServerScript}/bin/deploy-server"; + }; + } + ); + nixosConfigurations = let mkSystem =