55 lines
1.3 KiB
Nix
55 lines
1.3 KiB
Nix
|
{ inputs, ... }:
|
||
|
let
|
||
|
inherit (inputs.nix-filter.lib) filter inDirectory matchExt;
|
||
|
in
|
||
|
{
|
||
|
perSystem =
|
||
|
{ pkgs, ... }:
|
||
|
{
|
||
|
packages.nix-hamburg = pkgs.mkYarnPackage rec {
|
||
|
name = "nix-hamburg";
|
||
|
|
||
|
src = filter {
|
||
|
root = ../.;
|
||
|
include = [
|
||
|
(inDirectory "public")
|
||
|
(inDirectory "src")
|
||
|
(matchExt "js")
|
||
|
(matchExt "cjs")
|
||
|
(matchExt "mjs")
|
||
|
(matchExt "json")
|
||
|
(matchExt "ts")
|
||
|
../package.json
|
||
|
../yarn.lock
|
||
|
../nix/yarn.nix
|
||
|
];
|
||
|
};
|
||
|
|
||
|
packageJSON = ../package.json;
|
||
|
yarnLock = ../yarn.lock;
|
||
|
yarnNix = ../nix/yarn.nix;
|
||
|
yarnFlags = [
|
||
|
"--offline"
|
||
|
"--production=true"
|
||
|
];
|
||
|
|
||
|
CI = "true";
|
||
|
|
||
|
pkgConfig.sharp = {
|
||
|
nativeBuildInputs = builtins.attrValues {
|
||
|
inherit (pkgs.nodePackages) node-gyp;
|
||
|
inherit (pkgs) python3 pkg-config;
|
||
|
};
|
||
|
|
||
|
buildInputs = with pkgs; [ vips.dev ];
|
||
|
postInstall = "node-gyp --node-dir=${pkgs.nodePackages.nodejs} rebuild";
|
||
|
};
|
||
|
|
||
|
postConfigure = "export HOME=$(mktemp -d)";
|
||
|
buildPhase = "yarn build";
|
||
|
installPhase = "mv -v deps/${name}/dist \${out}";
|
||
|
distPhase = "true";
|
||
|
};
|
||
|
};
|
||
|
}
|