52 lines
761 B
Nix
52 lines
761 B
Nix
{
|
|
pkgs ? import <nixpkgs> { },
|
|
}:
|
|
with pkgs;
|
|
let
|
|
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
|
|
stdenv.mkDerivation rec {
|
|
name = "mart-w.de-${version}";
|
|
version = "1.1";
|
|
|
|
src = ./.;
|
|
|
|
nativeBuildInputs = [
|
|
go
|
|
hugo
|
|
];
|
|
|
|
buildPhase = ''
|
|
ln -s ${vendoredDeps} _vendor
|
|
hugo
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -r ./public/* $out
|
|
'';
|
|
}
|