Closed LoPoHa closed 4 years ago
@johnchandlerburnham can you take a look?
Yes, I will take a look tomorrow when I'm home from Christmas. In the meantime @LoPoHa, you should be able to install directly from npm on NixOS with
$ npm set prefix ~/.npm-global
$ export PATH="$HOME/.npm-global:$PATH"
$ npm i -g formality-lang
as described here.
That should fix the immediate problem of getting fm
working, but it's a global install, which isn't ideal. Will investigate.
Ok, removing supplement.json and using the packaged gulp allows the package to be build.
new override.nix
{ pkgs ? import <nixpkgs> {}
, system ? builtins.currentSystem
}:
let
nodePackages = import ./default.nix {
inherit pkgs system;
};
in
nodePackages // {
package = nodePackages.package.override (oldAttrs: {
buildInputs = oldAttrs.buildInputs or [] ++ [ pkgs.nodePackages.gulp ];
postInstall = ''
mkdir $out/dist
gulp build
cp -R $out/lib/node_modules/formality-lang/dist/* $out/dist
'';
});
}
Now i only have to make it available to the path. I'll make a pull request later (maybe tomorrow) when i got it running.
And maybe we should copy lib/bin/
to bin/
and remove lib/
.
Just for cleanup reasons.
I'm dumb.
You can use the override above and nix-env -i -f override.nix
to install it.
I'll make a pull request in a few hours with this.
Because of the removal of
dist
in https://github.com/moonad/Formality/commit/59ef91e387de7707085fb1994efbb80cf6c575ca, installing with the provided nix instructions doesn't work anymore. Installing works, but when executingfm
, it cant find../dist/cli
.The creator of node2nix has a blog post explaining how to run task runners here. (At the bottom, with grunt instead of gulp)
the command
node2nix -d -i package.json --supplement-input supplement.json
works correctly. butnix-build override.nix -A package
wields the following error:I have to investigate why this error occurs. Maybe we should/could use the gulp that is already packaged for nix. After Christmas I should have a bit more time to investigate further...
supplement.json
override.nix