Daniel Siepmann
de06dbcd13
The flake is very basic and encapsulates frontend compilation via node for customer projects. The flake is intended to be used by other flake.nix within the projects, which will use the defined packages to build apps outputs. They should use the packages like `writeShellApplication` itself, call it with necessary argument set in order to receive a out of the box working solution. A template is also provided which can be used like: nix flake init -t <path to this flake> `defaultTemplate` is defined in output and will be used.
38 lines
969 B
Nix
38 lines
969 B
Nix
{
|
|
description = "Flake for TYPO3 Projects specific to customer wm.";
|
|
|
|
outputs = {
|
|
self
|
|
}: {
|
|
lib = {
|
|
compileAssets = { packageJsonPath, nodePkg, pkgs }: pkgs.writeShellApplication {
|
|
name = "compileAssets";
|
|
runtimeInputs = [
|
|
nodePkg
|
|
pkgs.nodePackages.npm
|
|
];
|
|
text = ''
|
|
npm ci --prefix=${packageJsonPath}
|
|
npm run style --prefix=${packageJsonPath}
|
|
npm run js --prefix=${packageJsonPath}
|
|
'';
|
|
};
|
|
watchAssets = { packageJsonPath, compileAssets, nodePkg, pkgs }: pkgs.writeShellApplication {
|
|
name = "watchAssets";
|
|
runtimeInputs = [
|
|
nodePkg
|
|
pkgs.nodePackages.npm
|
|
];
|
|
text = ''
|
|
${compileAssets}/bin/compileAssets
|
|
npm run watch --prefix=${packageJsonPath}
|
|
'';
|
|
};
|
|
};
|
|
|
|
defaultTemplate = {
|
|
path = ./template;
|
|
};
|
|
};
|
|
}
|