From 3f98841adfb8b553678025219caa45625b396ddf Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 10 May 2022 19:18:21 -0700 Subject: another try --- users/fcuny/blog/flake.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'users') diff --git a/users/fcuny/blog/flake.nix b/users/fcuny/blog/flake.nix index 35ada07..7d5a4b2 100644 --- a/users/fcuny/blog/flake.nix +++ b/users/fcuny/blog/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 ]; }; }); -- cgit 1.4.1