diff --git a/content/posts/gitea-on-fly-io/fly-io-memory-dashboard.png b/content/posts/gitea-on-fly-io/fly-io-memory-dashboard.png new file mode 100644 index 0000000..bfe0ff9 Binary files /dev/null and b/content/posts/gitea-on-fly-io/fly-io-memory-dashboard.png differ diff --git a/content/posts/gitea-on-fly-io/fly-io-scale-vm.png b/content/posts/gitea-on-fly-io/fly-io-scale-vm.png new file mode 100644 index 0000000..ed38e2c Binary files /dev/null and b/content/posts/gitea-on-fly-io/fly-io-scale-vm.png differ diff --git a/flake.nix b/flake.nix index 1e8a149..c2e456a 100644 --- a/flake.nix +++ b/flake.nix @@ -18,30 +18,37 @@ flake-parts.lib.mkFlake { inherit self; } { imports = [ ]; systems = inputs.nixpkgs.lib.systems.flakeExposed; - perSystem = { config, self', inputs', pkgs, system, ... }: { + perSystem = { config, self', inputs', pkgs, system, ... }: + let + optimize-images = pkgs.writeShellScriptBin "optimize-images" '' + shopt -s globstar nullglob + ${pkgs.scour}/bin/scour -i static/image/_favicon.svg -o static/image/favicon.svg + for image in content/**/_*.png static/image/**/_*.png; do + path=$(dirname $image) + file=$(basename $image) + ${pkgs.pngquant}/bin/pngquant --quality 90-99 -f -o "$path/''${file:1}" $image + done + ''; + in + { packages.default = pkgs.stdenv.mkDerivation { pname = "personal-site"; version = "2022-08-13"; src = ./.; - nativeBuildInputs = with pkgs; [ pngquant scour zola ]; + nativeBuildInputs = with pkgs; [ optimize-images zola ]; configurePhase = '' mkdir -p "themes/${themeName}" cp -r ${theme}/* "themes/${themeName}" - scour -i static/image/_favicon.svg -o static/image/favicon.svg - for image in content/**/_*.png static/image/**.png; do - path=$(dirname $image) - file=$(basename $image) - pngquant --quality 90-99 -f -o "$path/''${file:1}" - done + optimize-images ''; buildPhase = "zola build"; installPhase = "cp -r public $out"; }; - devShells.default = pkgs.mkShell { - packages = with pkgs; [ zola ]; + devShells.default = with pkgs; mkShell { + packages = [ optimize-images flyctl zola ]; shellHook = '' mkdir -p themes - ln -sn "${theme}" "themes/${themeName}" + ln -snf "${theme}" "themes/${themeName}" ''; }; };