parent
77f3e29a30
commit
789d6e7916
26
flake.nix
26
flake.nix
|
@ -13,6 +13,32 @@
|
|||
system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
packages.default = pkgs.stdenv.mkDerivation rec {
|
||||
pname = "jolheiser.com";
|
||||
version = "site";
|
||||
src = ./.;
|
||||
offlineCache = pkgs.fetchYarnDeps {
|
||||
yarnLock = "${src}/yarn.lock";
|
||||
sha256 = "sha256-IF30H3ZXlKoyap7xJOD6tnZjCZ/U/VgWrCjj4fh6zyM=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = with pkgs; [yarn fixup_yarn_lock nodejs-slim];
|
||||
postPatch = ''
|
||||
export HOME=$NIX_BUILD_TOP/fake_home
|
||||
yarn config --offline set yarn-offline-mirror $offlineCache
|
||||
fixup_yarn_lock yarn.lock
|
||||
yarn install --offline --frozen-lockfile --ignore-scripts --no-progress --non-interactive
|
||||
patchShebangs node_modules/
|
||||
'';
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
yarn --offline build
|
||||
mv dist $out
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
};
|
||||
devShells.default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
yarn
|
||||
|
|
Loading…
Reference in New Issue