{ description = "Kucinako - Wordbook of Arzhanai languages"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; node-modules = pkgs.mkYarnPackage { name = "node-modules"; src = ./.; }; frontend = pkgs.stdenv.mkDerivation { name = "frontend"; src = ./.; buildInputs = [pkgs.yarn node-modules pkgs.lmdb]; buildPhase = '' ln -s ${node-modules}/libexec/kucinako/node_modules node_modules ${pkgs.yarn}/bin/yarn build ''; installPhase = '' mkdir $out mv dist $out/dist ''; }; in { packages = { node-modules = node-modules; default = frontend; }; } ); }