mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-23 14:31:55 +03:00
42838c5909
- name example more consistently, eg. `{language}-packaging-{feature}` or `{language}-local-development-{feature}` - move some examples to the modules integration tests directory instead as their purpose was mainly testing and they weren't good example - module owned checks: import via flake if available
42 lines
738 B
Nix
42 lines
738 B
Nix
{
|
|
lib,
|
|
config,
|
|
dream2nix,
|
|
...
|
|
}: {
|
|
imports = [
|
|
dream2nix.modules.dream2nix.nodejs-package-json-v3
|
|
dream2nix.modules.dream2nix.nodejs-granular-v3
|
|
];
|
|
|
|
deps = {nixpkgs, ...}: {
|
|
inherit
|
|
(nixpkgs)
|
|
gnugrep
|
|
stdenv
|
|
;
|
|
};
|
|
|
|
nodejs-granular-v3 = {
|
|
buildScript = ''
|
|
tsc ./app.ts
|
|
mv app.js app.js.tmp
|
|
echo "#!${config.deps.nodejs}/bin/node" > app.js
|
|
cat app.js.tmp >> app.js
|
|
chmod +x ./app.js
|
|
patchShebangs .
|
|
'';
|
|
};
|
|
|
|
name = lib.mkForce "app";
|
|
version = lib.mkForce "1.0.0";
|
|
|
|
mkDerivation = {
|
|
src = lib.cleanSource ./.;
|
|
checkPhase = ''
|
|
./app.js | ${config.deps.gnugrep}/bin/grep -q "Hello, World!"
|
|
'';
|
|
doCheck = true;
|
|
};
|
|
}
|