diff options
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -11,15 +11,22 @@ manifest = builtins.fromJSON (builtins.readFile ./manifest.json); pkgs = import nixpkgs { localSystem = { inherit system; }; }; in { - packages.default = pkgs.stdenvNoCC.mkDerivation { + packages.default = pkgs.buildNpmPackage rec { inherit (manifest) version; pname = "asap"; src = ./.; nativeBuildInputs = [ pkgs.zip ]; - buildPhase = '' + npmDepsHash = "sha256-gPFeEXDwAqIamXoAK6/Y6fmDHyIHXucdYHj6YoItDK4="; + npmBuildScript = "build:prod"; + installPhase = '' + runHook preInstall + mkdir $out - zip --recurse-paths $out/asap.zip \ - manifest.json page.js styles.css hljs/ katex/ STIXTwoMath-Regular.otf + cd dist/ + cp main.licenses.txt $out/licenses.txt + zip --recurse-paths $out/asap.zip ./ + + runHook postInstall ''; }; }); |