Files
ianitor/deploy/nixos/web.nix
T

48 lines
1.4 KiB
Nix

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# The web UI (apps/web with packages/ui), built with pnpm from the lockfile. No outside
# requests at runtime: the fonts are bundled.
{ lib, stdenv, nodejs_22, pnpm_11, fetchPnpmDeps, pnpmConfigHook }:
stdenv.mkDerivation (finalAttrs: {
pname = "ianitor-web";
version = (lib.importJSON ../../apps/web/package.json).version;
src = lib.fileset.toSource {
root = ../..;
fileset = lib.fileset.unions [
../../package.json
../../pnpm-workspace.yaml
../../pnpm-lock.yaml
../../apps/web
../../packages/ui
# @domi/ui, vendored from domi-design at a tag (docs/domi-ui.md): nothing is fetched from Gitea.
../../packages/domi-ui
];
};
nativeBuildInputs = [ nodejs_22 pnpm_11 pnpmConfigHook ];
pnpmDeps = fetchPnpmDeps {
inherit (finalAttrs) pname version src;
pnpm = pnpm_11;
fetcherVersion = 4;
# lib.fakeHash until a machine with Nix reports the hash for this lockfile (docs/domi-ui.md).
hash = lib.fakeHash;
};
buildPhase = ''
runHook preBuild
pnpm --filter web build
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -r apps/web/dist $out
runHook postInstall
'';
})