Use drone env var
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
32e3cb8913
commit
36214b9ba6
24
flake.nix
24
flake.nix
|
@ -18,31 +18,29 @@
|
||||||
inherit (gitignore.lib) gitignoreSource;
|
inherit (gitignore.lib) gitignoreSource;
|
||||||
inherit (pkgs.callPackage ./nix { }) fonts optimize-images;
|
inherit (pkgs.callPackage ./nix { }) fonts optimize-images;
|
||||||
inherit (fonts) copyFonts linkFonts;
|
inherit (fonts) copyFonts linkFonts;
|
||||||
|
buildSite = { prod }:
|
||||||
|
let inherit (pkgs.lib) optionalString; in ''
|
||||||
|
optimize-images
|
||||||
|
${optionalString (!prod) "BASE_URL=https://$DRONE_COMMIT_SHA--mat-services.netlify.app"}
|
||||||
|
zola build --drafts ${optionalString (!prod) "--base-url $BASE_URL"}
|
||||||
|
# zola's ignored_content setting doesn't work in static/
|
||||||
|
rm -rf public/image/_favicon.svg
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages.default = with pkgs; stdenv.mkDerivation {
|
packages.default = with pkgs; stdenv.mkDerivation {
|
||||||
pname = "personal-site";
|
pname = "personal-site";
|
||||||
version = "2022-10-10";
|
version = "2022-10-10";
|
||||||
src = gitignoreSource ./.;
|
src = gitignoreSource ./.;
|
||||||
nativeBuildInputs = [ optimize-images zola ];
|
nativeBuildInputs = [ git optimize-images zola ];
|
||||||
configurePhase = copyFonts;
|
configurePhase = copyFonts;
|
||||||
buildPhase = ''
|
buildPhase = buildSite { prod = true; };
|
||||||
optimize-images
|
|
||||||
zola build --drafts
|
|
||||||
# zola's ignored_content setting doesn't work in static/
|
|
||||||
rm -rf public/image/_favicon.svg
|
|
||||||
'';
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
cp -r public $out
|
cp -r public $out
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
packages.staging-site = config.packages.default.overrideAttrs (_: {
|
packages.staging-site = config.packages.default.overrideAttrs (_: {
|
||||||
buildPhase = ''
|
buildPhase = buildSite { prod = false; };
|
||||||
optimize-images
|
|
||||||
zola build --drafts --base_url $DEPLOY_PRIME_URL
|
|
||||||
# zola's ignored_content setting doesn't work in static/
|
|
||||||
rm -rf public/image/_favicon.svg
|
|
||||||
'';
|
|
||||||
});
|
});
|
||||||
devShells.default = with pkgs; mkShell {
|
devShells.default = with pkgs; mkShell {
|
||||||
packages = [ optimize-images zola ];
|
packages = [ optimize-images zola ];
|
||||||
|
|
Loading…
Reference in New Issue