aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorRadu <radu@pml4t.net>2023-11-24 16:52:57 -0500
committerRadu <radu@pml4t.net>2023-11-24 22:17:59 -0500
commit290f849c64c9f198f09b592daa48ecdae957375f (patch)
treefab417d5837cde3cd9b4db54dd61d59ca098a69d /flake.nix
parentef17d1d29212f5dc0218bfca1c30709e5a35f7b2 (diff)
Support GFM using `remarked` and fix some bugs
- This avoids edge cases in the primitive parser I wrote. - Add KaTeX stylesheet (cause of rendering issues, not Pronto). - Bundle with Webpack.
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/flake.nix b/flake.nix
index 8f0757a..71ea084 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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
'';
};
});