From 05dbebd651abf96b9785d43c75b32ca3b3ccfe13 Mon Sep 17 00:00:00 2001 From: Stanisław Zagórowski Date: Tue, 2 Jan 2024 01:04:54 +0100 Subject: nix: add flake and front derivation --- front.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 front.nix (limited to 'front.nix') diff --git a/front.nix b/front.nix new file mode 100644 index 0000000..f3cb562 --- /dev/null +++ b/front.nix @@ -0,0 +1,22 @@ +{ pkgs ? import {} }: + let + nodeDependencies = (pkgs.callPackage ./front/default.nix {}).nodeDependencies; + stdenv = pkgs.stdenv; + nodejs = pkgs.nodejs; + tsc = pkgs.typescript; + in + + stdenv.mkDerivation { + name = "duckonaut.dev-front"; + src = ./front; + buildInputs = [nodejs tsc]; + buildPhase = '' + ln -s ${nodeDependencies}/lib/node_modules ./node_modules + export PATH="${nodeDependencies}/bin:$PATH" + echo "PATH: $PATH" + + # Build the distribution bundle in "dist" + npm run build + cp -r dist $out/ + ''; + } -- cgit v1.3.1