Make the package work, building Elm and NodeJS dependencies.

This commit is contained in:
Danila Fedorin 2023-11-30 04:54:40 +00:00
parent 8410a2abb1
commit aae85e7628
3 changed files with 150 additions and 21 deletions

View File

@ -1,27 +1,26 @@
{ mkYarnModules, bergamot-elm }: { stdenv, mkYarnModules, bergamot-elm }:
let let
# Generate a Nix expression from the yarn.lock file # Generate a Nix expression from the yarn.lock file
yarnModules = pkgs.mkYarnModules { yarnModules = mkYarnModules {
src = ./.; version = "1.0.0";
packageJson = ./package.json; pname = "web-files";
packageJSON = ./package.json;
yarnLock = ./yarn.lock; yarnLock = ./yarn.lock;
}; };
in in
pkgs.stdenv.mkDerivation { stdenv.mkDerivation {
name = "web-files"; name = "web-files";
src = ./.;
# Use the generated yarnModules # Use the generated yarnModules
buildInputs = [ yarnModules bergamot-elm ]; buildInputs = [ yarnModules bergamot-elm ];
buildPhase = ''
'';
installPhase = '' installPhase = ''
mkdir -p $out $out/katex $out/katex-expression $out/bergamot mkdir -p $out $out/katex $out/katex-expression $out/bergamot
cp ${yarnModules}/node_modules/katex/dist/katex.min.css $out/katex cp ${yarnModules}/node_modules/katex/dist/katex.min.css $out/katex
cp ${yarnModules}/node_modules/@navsnpm/katex-expression/dist/katex-expression/katex-expression.esm.js $out/katex-expression cp ${yarnModules}/node_modules/@navsnpm/katex-expression/dist/katex-expression/katex-expression.esm.js $out/katex-expression
cp ${bergamot-elm}/Main.min.js $out/bergamot/bergamot.js cp ${bergamot-elm}/Main.min.js $out/bergamot/bergamot.js
''; '';
} }

130
flake.lock Normal file
View File

@ -0,0 +1,130 @@
{
"nodes": {
"bergamot-elm": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1701318122,
"narHash": "sha256-wOik1hcZ6xwTUQZmDo8cPB7tE0VoyQM99zUTjqB4xUI=",
"ref": "main",
"rev": "524796d74fbec2828bf3f8f3b7abd4c843d529b3",
"revCount": 33,
"type": "git",
"url": "https://dev.danilafe.com/Everything-I-Know-About-Types/bergamot-elm.git"
},
"original": {
"ref": "main",
"type": "git",
"url": "https://dev.danilafe.com/Everything-I-Know-About-Types/bergamot-elm.git"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1701068326,
"narHash": "sha256-vmMceA+q6hG1yrjb+MP8T0YFDQIrW3bl45e7z24IEts=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8cfef6986adfb599ba379ae53c9f5631ecd2fd9c",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1701319520,
"narHash": "sha256-xVghb4ELbEtJUdEmB4PR+sq/aoNP0VEcM6GczDh+Zss=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "db77de49336382a33b9490a88ba3fe483e2b605f",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"bergamot-elm": "bergamot-elm",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@ -11,7 +11,7 @@
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
web-files = import ./default.nix { web-files = import ./default.nix {
inherit (pkgs) mkYarnModules; inherit (pkgs) stdenv mkYarnModules;
bergamot-elm = bergamot-elm.defaultPackage.${system}; bergamot-elm = bergamot-elm.defaultPackage.${system};
}; };
in in