srx.astro.nix/nix/package.nix

55 lines
1.3 KiB
Nix
Raw Normal View History

2024-05-17 13:56:34 +02:00
{ inputs, ... }:
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 {
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
];
};
packageJSON = ../package.json;
yarnLock = ../yarn.lock;
2024-05-17 13:56:34 +02:00
yarnNix = ../nix/yarn.nix;
yarnFlags = [
"--offline"
"--production=true"
2024-03-03 13:45:20 +01:00
];
CI = "true";
2024-03-03 13:45:20 +01:00
pkgConfig.sharp = {
nativeBuildInputs = builtins.attrValues {
inherit (pkgs.nodePackages) node-gyp;
inherit (pkgs) python3 pkg-config;
};
2024-03-03 13:45:20 +01:00
buildInputs = with pkgs; [ vips.dev ];
postInstall = "node-gyp --node-dir=${pkgs.nodePackages.nodejs} rebuild";
};
2024-03-03 13:45:20 +01:00
postConfigure = "export HOME=$(mktemp -d)";
buildPhase = "yarn build";
2024-05-17 13:56:34 +02:00
installPhase = "mv -v deps/${name}/dist \${out}";
distPhase = "true";
};
2024-03-03 13:45:20 +01:00
};
}