about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-05-10 19:28:33 -0700
committerFranck Cuny <franck@fcuny.net>2022-05-10 19:28:33 -0700
commitd2e2cc7fcad35cbb3189d1f51bf01bed57e7beaa (patch)
tree383b4cd51f57a014dc05af5891f40ebbd400a010
parentanother try (diff)
downloadworld-d2e2cc7fcad35cbb3189d1f51bf01bed57e7beaa.tar.gz
i don't think it will work
-rw-r--r--users/fcuny/blog/.drone.yml2
-rw-r--r--users/fcuny/blog/flake.nix18
2 files changed, 11 insertions, 9 deletions
diff --git a/users/fcuny/blog/.drone.yml b/users/fcuny/blog/.drone.yml
index 67bf620..0031ad9 100644
--- a/users/fcuny/blog/.drone.yml
+++ b/users/fcuny/blog/.drone.yml
@@ -14,4 +14,4 @@ steps:
       FLY_API_TOKEN:
         from_secret: FLY_API_TOKEN
     commands:
-      - nix shell --command bash ./scripts/deploy.sh
+      - nix run .#deploy
diff --git a/users/fcuny/blog/flake.nix b/users/fcuny/blog/flake.nix
index 7d5a4b2..1c9b9dd 100644
--- a/users/fcuny/blog/flake.nix
+++ b/users/fcuny/blog/flake.nix
@@ -22,6 +22,7 @@
             '';
             dontInstall = true;
           };
+
         defaultApp = pkgs.writers.writeBashBin "run-hugo" ''
           set -e
           set -o pipefail
@@ -29,14 +30,15 @@
           hugo server -D
         '';
 
-        deploy = pkgs.writers.writeBashBin "run-deploy" ''
-          set -e
-          set -o pipefile
-          export PATH=${
-            pkgs.lib.makeBinPath [ pkgs.hugo pkgs.git pkgs.jq pkgs.flyctl ]
-          }
-          ./scripts/deploy.sh
-        '';
+        apps = {
+          deploy = pkgs.pkgs.writeShellScriptBin "run-deploy" ''
+            set -euxo pipefail
+            export PATH=${
+              pkgs.lib.makeBinPath [ pkgs.hugo pkgs.git pkgs.jq pkgs.flyctl ]
+            }:$PATH
+            ./scripts/deploy.sh
+          '';
+        };
 
         devShell =
           pkgs.mkShell { buildInputs = with pkgs; [ hugo flyctl git jq ]; };