about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-05-10 19:18:21 -0700
committerFranck Cuny <franck@fcuny.net>2022-05-10 19:18:21 -0700
commitf0ca9c420698df2fccf4dca156c5c6837fe61b40 (patch)
treea58b01bc86e06843adfc0a80419b2a3e60e3e7e2
parentone more time (diff)
downloadfcuny.net-f0ca9c420698df2fccf4dca156c5c6837fe61b40.tar.gz
another try
-rw-r--r--flake.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index 35ada07..7d5a4b2 100644
--- a/flake.nix
+++ b/flake.nix
@@ -10,6 +10,18 @@
     flake-utils.lib.eachDefaultSystem (system:
       let pkgs = nixpkgs.legacyPackages.${system};
       in {
+        defaultPackage = with pkgs;
+          stdenv.mkDerivation {
+            pname = "fcuny.net";
+            version = self.lastModifiedDate;
+            src = ./.;
+            buildInputs = [ hugo git ];
+            buildPhase = ''
+              mkdir -p $out
+              hugo --minify --destination $out
+            '';
+            dontInstall = true;
+          };
         defaultApp = pkgs.writers.writeBashBin "run-hugo" ''
           set -e
           set -o pipefail
@@ -17,6 +29,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
+        '';
+
         devShell =
           pkgs.mkShell { buildInputs = with pkgs; [ hugo flyctl git jq ]; };
       });