mart-w.de/default.nix

52 lines
763 B
Nix
Raw Permalink Normal View History

2024-10-22 22:21:24 +02:00
{
pkgs ? import <nixpkgs> { },
}:
with pkgs;
let
2024-02-14 13:58:08 +01:00
vendoredDeps = stdenv.mkDerivation rec {
name = "hugoVendoredDeps";
src = ./.;
nativeBuildInputs = [
git
go
hugo
];
buildPhase = ''
hugo mod vendor
'';
installPhase = ''
mkdir -p $out
cp -r ./_vendor/* $out
'';
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = "sha256-8dsJlVvCHUE/rI9YkuJVF+Nk2DeUIAiNLR4Fu/YZg50=";
};
in
2024-10-22 22:21:24 +02:00
stdenv.mkDerivation rec {
name = "mart-w.de-${version}";
2024-10-22 22:22:05 +02:00
version = "1.1.0";
2024-10-22 22:21:24 +02:00
src = ./.;
nativeBuildInputs = [
go
hugo
];
buildPhase = ''
ln -s ${vendoredDeps} _vendor
hugo
'';
installPhase = ''
mkdir -p $out
cp -r ./public/* $out
'';
}