2020-06-18 22:41:01 +00:00
|
|
|
{ pkgs ? import <nixpkgs> { }
|
2022-04-24 21:48:01 +00:00
|
|
|
, nixosChannels
|
|
|
|
, version
|
2020-03-28 04:09:01 +00:00
|
|
|
}:
|
2023-03-27 07:01:04 +00:00
|
|
|
pkgs.npmlock2nix.v1.build {
|
2022-11-03 21:26:58 +00:00
|
|
|
src = ./.;
|
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
2022-11-03 22:44:19 +00:00
|
|
|
cp -R dist/* $out/
|
|
|
|
cp netlify.toml $out/
|
2022-11-03 21:26:58 +00:00
|
|
|
'';
|
|
|
|
postConfigure = pkgs.elmPackages.fetchElmDeps {
|
|
|
|
elmPackages = import ./elm-srcs.nix;
|
|
|
|
elmVersion = pkgs.elmPackages.elm.version;
|
|
|
|
registryDat = ./registry.dat;
|
2020-03-28 23:02:40 +00:00
|
|
|
};
|
2022-11-03 21:26:58 +00:00
|
|
|
ELASTICSEARCH_MAPPING_SCHEMA_VERSION = version;
|
|
|
|
NIXOS_CHANNELS = builtins.toJSON nixosChannels;
|
|
|
|
buildCommands = [
|
|
|
|
"HOME=$PWD npm run prod"
|
|
|
|
];
|
|
|
|
buildInputs =
|
2020-03-28 04:09:01 +00:00
|
|
|
(with pkgs; [
|
|
|
|
nodejs
|
2020-03-28 23:02:40 +00:00
|
|
|
elm2nix
|
2020-03-28 04:09:01 +00:00
|
|
|
]) ++
|
|
|
|
(with pkgs.elmPackages; [
|
|
|
|
elm
|
|
|
|
elm-format
|
2020-03-30 07:27:22 +00:00
|
|
|
elm-language-server
|
|
|
|
elm-test
|
2020-03-28 04:09:01 +00:00
|
|
|
]);
|
2022-11-03 21:26:58 +00:00
|
|
|
node_modules_attrs = {
|
|
|
|
sourceOverrides = {
|
|
|
|
elm = sourceIngo: drv: drv.overrideAttrs (old: {
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e "s|download(|//download(|" install.js
|
|
|
|
sed -i -e "s|request(|//request(|" download.js
|
|
|
|
sed -i -e "s|var version|return; var version|" download.js
|
|
|
|
cp ${pkgs.elmPackages.elm}/bin/elm bin/elm
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
};
|
2020-06-12 12:29:04 +00:00
|
|
|
};
|
2020-03-28 04:09:01 +00:00
|
|
|
}
|