tilt: fix missing assets

+100 -28
+53
pkgs/applications/networking/cluster/tilt/assets.nix
··· 1 + { lib 2 + , stdenvNoCC 3 + , version, src 4 + , fetchYarnDeps 5 + , fixup_yarn_lock, yarn, nodejs 6 + }: 7 + 8 + stdenvNoCC.mkDerivation rec { 9 + pname = "tilt-assets"; 10 + 11 + inherit src version; 12 + 13 + nativeBuildInputs = [ fixup_yarn_lock yarn nodejs ]; 14 + 15 + yarnOfflineCache = fetchYarnDeps { 16 + yarnLock = "${src}/web/yarn.lock"; 17 + hash = "sha256-UTxglGn3eIgahZg4kxolg2f2MTReCL4r/GyWNg4105E="; 18 + }; 19 + 20 + configurePhase = '' 21 + export HOME=$(mktemp -d)/yarn_home 22 + ''; 23 + 24 + buildPhase = '' 25 + runHook preBuild 26 + 27 + yarn config --offline set yarn-offline-mirror $yarnOfflineCache 28 + 29 + cd web 30 + fixup_yarn_lock yarn.lock 31 + yarn install --offline --frozen-lockfile --ignore-engines 32 + patchShebangs node_modules 33 + export PATH=$PWD/node_modules/.bin:$PATH 34 + ./node_modules/.bin/react-scripts build 35 + 36 + mkdir -p $out 37 + cd .. 38 + 39 + runHook postBuild 40 + ''; 41 + 42 + installPhase = '' 43 + cp -r web/build/* $out 44 + ''; 45 + 46 + meta = with lib; { 47 + description = "Assets needed for Tilt"; 48 + homepage = "https://tilt.dev/"; 49 + license = lib.licenses.asl20; 50 + maintainers = with lib.maintainers; [ anton-dessiatov ]; 51 + platforms = platforms.all; 52 + }; 53 + }
+31
pkgs/applications/networking/cluster/tilt/binary.nix
··· 1 + { lib 2 + , buildGoModule 3 + , src, version 4 + , tilt-assets 5 + }: 6 + 7 + buildGoModule rec { 8 + pname = "tilt"; 9 + /* Do not use "dev" as a version. If you do, Tilt will consider itself 10 + running in development environment and try to serve assets from the 11 + source tree, which is not there once build completes. */ 12 + inherit src version; 13 + 14 + vendorHash = null; 15 + 16 + subPackages = [ "cmd/tilt" ]; 17 + 18 + ldflags = [ "-X main.version=${version}" ]; 19 + 20 + preBuild = '' 21 + mkdir -p pkg/assets/build 22 + cp -r ${tilt-assets}/* pkg/assets/build/ 23 + ''; 24 + 25 + meta = { 26 + description = "Local development tool to manage your developer instance when your team deploys to Kubernetes in production"; 27 + homepage = "https://tilt.dev/"; 28 + license = lib.licenses.asl20; 29 + maintainers = with lib.maintainers; [ anton-dessiatov ]; 30 + }; 31 + }
+16 -28
pkgs/applications/networking/cluster/tilt/default.nix
··· 1 - { lib 2 - , buildGoModule 3 - , fetchFromGitHub 1 + { fetchFromGitHub 2 + , callPackage 4 3 }: 5 - 6 - buildGoModule rec { 7 - pname = "tilt"; 8 - /* Do not use "dev" as a version. If you do, Tilt will consider itself 9 - running in development environment and try to serve assets from the 10 - source tree, which is not there once build completes. */ 11 - version = "0.33.6"; 12 - 13 - src = fetchFromGitHub { 14 - owner = "tilt-dev"; 15 - repo = "tilt"; 16 - rev = "v${version}"; 17 - hash = "sha256-WtE8ExUKFRtdYeg0+My/DB+L/qT+J1EaKHKChNjC5oI="; 18 - }; 19 - 20 - vendorHash = null; 4 + let args = rec { 5 + /* Do not use "dev" as a version. If you do, Tilt will consider itself 6 + running in development environment and try to serve assets from the 7 + source tree, which is not there once build completes. */ 8 + version = "0.33.6"; 21 9 22 - subPackages = [ "cmd/tilt" ]; 10 + src = fetchFromGitHub { 11 + owner = "tilt-dev"; 12 + repo = "tilt"; 13 + rev = "v${version}"; 14 + hash = "sha256-WtE8ExUKFRtdYeg0+My/DB+L/qT+J1EaKHKChNjC5oI="; 15 + }; 16 + }; 23 17 24 - ldflags = [ "-X main.version=${version}" ]; 18 + tilt-assets = callPackage ./assets.nix args; 19 + in callPackage ./binary.nix (args // { inherit tilt-assets; }) 25 20 26 - meta = { 27 - description = "Local development tool to manage your developer instance when your team deploys to Kubernetes in production"; 28 - homepage = "https://tilt.dev/"; 29 - license = lib.licenses.asl20; 30 - maintainers = with lib.maintainers; [ anton-dessiatov ]; 31 - }; 32 - }