2024-05-17 13:56:34 +02:00
|
|
|
{ inputs, ... }:
|
2024-05-17 13:00:00 +02:00
|
|
|
let
|
|
|
|
inherit (inputs.nix-filter.lib) filter inDirectory matchExt;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
perSystem =
|
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
2024-05-17 13:56:34 +02:00
|
|
|
packages.srx-digital = pkgs.mkYarnPackage rec {
|
2024-05-17 13:00:00 +02:00
|
|
|
name = "srx-digital";
|
|
|
|
|
|
|
|
src = filter {
|
|
|
|
root = ../.;
|
|
|
|
include = [
|
|
|
|
(inDirectory "public")
|
|
|
|
(inDirectory "src")
|
|
|
|
(matchExt "js")
|
|
|
|
(matchExt "cjs")
|
|
|
|
(matchExt "mjs")
|
|
|
|
(matchExt "json")
|
|
|
|
(matchExt "ts")
|
|
|
|
../package.json
|
|
|
|
../yarn.lock
|
2024-05-17 13:56:34 +02:00
|
|
|
../nix/yarn.nix
|
2024-05-17 13:00:00 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
packageJSON = ../package.json;
|
|
|
|
yarnLock = ../yarn.lock;
|
2024-05-17 13:56:34 +02:00
|
|
|
yarnNix = ../nix/yarn.nix;
|
2024-05-17 13:00:00 +02:00
|
|
|
yarnFlags = [
|
|
|
|
"--offline"
|
|
|
|
"--production=true"
|
2024-03-03 13:45:20 +01:00
|
|
|
];
|
|
|
|
|
2024-05-17 13:00:00 +02:00
|
|
|
CI = "true";
|
2024-03-03 13:45:20 +01:00
|
|
|
|
2024-05-17 13:00:00 +02:00
|
|
|
pkgConfig.sharp = {
|
|
|
|
nativeBuildInputs = builtins.attrValues {
|
|
|
|
inherit (pkgs.nodePackages) node-gyp;
|
|
|
|
inherit (pkgs) python3 pkg-config;
|
|
|
|
};
|
2024-03-03 13:45:20 +01:00
|
|
|
|
2024-05-17 13:00:00 +02:00
|
|
|
buildInputs = with pkgs; [ vips.dev ];
|
|
|
|
postInstall = "node-gyp --node-dir=${pkgs.nodePackages.nodejs} rebuild";
|
|
|
|
};
|
2024-03-03 13:45:20 +01:00
|
|
|
|
2024-05-17 13:00:00 +02:00
|
|
|
postConfigure = "export HOME=$(mktemp -d)";
|
|
|
|
buildPhase = "yarn build";
|
2024-05-17 13:56:34 +02:00
|
|
|
installPhase = "mv -v deps/${name}/dist \${out}";
|
2024-05-17 13:00:00 +02:00
|
|
|
distPhase = "true";
|
2023-10-31 16:35:30 +01:00
|
|
|
};
|
2024-03-03 13:45:20 +01:00
|
|
|
};
|
2023-10-31 16:35:30 +01:00
|
|
|
}
|