feat: drv

Signed-off-by: jolheiser <john.olheiser@gmail.com>
main
jolheiser 2023-09-24 01:15:12 -05:00
parent 77f3e29a30
commit 789d6e7916
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
2 changed files with 29 additions and 0 deletions

View File

@ -13,6 +13,32 @@
system: let system: let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in { 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 { devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
yarn yarn

3
justfile 100644
View File

@ -0,0 +1,3 @@
build:
@git add .
@nix build