From abe1adba4942e8d7e622496385ea35af87b1d554 Mon Sep 17 00:00:00 2001 From: dadada Date: Sun, 27 Jun 2021 23:11:16 +0200 Subject: [PATCH] update readme --- README.md | 8 +++----- outputs.nix | 5 ++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 05bcdf1..3d1be2f 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ Use at your own risk. ## Deploying -The `./deploy` script generates a NixOS configuration that pins the current git `HEAD` of this project and copies the resulting `configuration.nix` to the destionation host. Then it tests the new confiurations and rolls back if it fails. - -## TODO - -- Use `nix-copy-closure`? +``` +nix run .#deploy $TARGET_HOST +``` diff --git a/outputs.nix b/outputs.nix index 69967b7..3e6ecab 100644 --- a/outputs.nix +++ b/outputs.nix @@ -17,7 +17,10 @@ { apps.deploy = { type = "app"; - program = "${selfPkgs.deploy}/bin/deploy"; + program = toString (pkgs.writeScript "deploy" '' + #!${pkgs.runtimeShell} + nixos-rebuild switch --upgrade --flake ".#$1" --target-host "$1.dadada.li" --build-host localhost --use-remote-sudo + ''); }; apps.hm-switch = { type = "app";