{ inputs = { nix.url = "git+ssh://git@git.c3c.cz/C3C/nix"; }; outputs = { self, nix }: { formatter = nix.formatter; packages = nix.lib.forAllSystems ( pkgs: let version = "rev-${self.shortRev or self.dirtyShortRev}"; package = builtins.fromJSON (builtins.readFile ./app/frontend/package.json); in rec { devenv-up = self.devShells.${pkgs.system}.default.config.procfileScript; devenv-test = self.devShells.${pkgs.system}.default.config.test; ui = pkgs.buildNpmPackage { inherit version; pname = "cv"; src = ./app/frontend; preBuild = '' cp ${nix.lib.eslint-config-file} ./eslint.shared.mjs npm run check ''; npmInstallFlags = "--no-audit --no-progress --no-fund"; npmDepsHash = "sha256-yINvhHFYT00khqo9D3rIDNSvJMdhQ1M5xa9SJEDZito="; npmPackFlags = [ "--ignore-scripts" ]; }; server = pkgs.buildGoModule { inherit version; pname = "cv"; CGO_ENABLED = 0; src = ./.; subPackages = [ "app/server" ]; postPatch = '' rm -rf app/server/internal/files/data/public mkdir -p app/server/internal/files/data/public touch app/server/internal/files/data/public/.gitkeep cp -Tr ${ui}/lib/node_modules/${package.name}/dist app/server/internal/files/data/public/ chmod +w -R app/server/internal/files/data/public sed -i 's# /dev/null) [[ ''$HASH = sha256* ]] && echo "Hash is ''$HASH" [[ ''$HASH != sha256* ]] && echo "Failed" && exit 137 # Replace the first occurence of npmDepsHash with the new calculated hash in this file sed -i "0,/npmDepsHash =/{s@npmDepsHash = .*@npmDepsHash = \"''$HASH\";@}" ./flake.nix ''; }; dev = { exec = '' ${nix.lib.cd_root} npm --prefix ./app/frontend run dev ''; }; }; } ]; }; }); }; }