mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-01 09:44:18 +00:00
Merge pull request #260712 from anton-dessiatov/tilt-assets
tilt: fix missing assets
This commit is contained in:
commit
507ced649b
53
pkgs/applications/networking/cluster/tilt/assets.nix
Normal file
53
pkgs/applications/networking/cluster/tilt/assets.nix
Normal file
@ -0,0 +1,53 @@
|
||||
{ lib
|
||||
, stdenvNoCC
|
||||
, version, src
|
||||
, fetchYarnDeps
|
||||
, fixup_yarn_lock, yarn, nodejs
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "tilt-assets";
|
||||
|
||||
inherit src version;
|
||||
|
||||
nativeBuildInputs = [ fixup_yarn_lock yarn nodejs ];
|
||||
|
||||
yarnOfflineCache = fetchYarnDeps {
|
||||
yarnLock = "${src}/web/yarn.lock";
|
||||
hash = "sha256-UTxglGn3eIgahZg4kxolg2f2MTReCL4r/GyWNg4105E=";
|
||||
};
|
||||
|
||||
configurePhase = ''
|
||||
export HOME=$(mktemp -d)/yarn_home
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
yarn config --offline set yarn-offline-mirror $yarnOfflineCache
|
||||
|
||||
cd web
|
||||
fixup_yarn_lock yarn.lock
|
||||
yarn install --offline --frozen-lockfile --ignore-engines
|
||||
patchShebangs node_modules
|
||||
export PATH=$PWD/node_modules/.bin:$PATH
|
||||
./node_modules/.bin/react-scripts build
|
||||
|
||||
mkdir -p $out
|
||||
cd ..
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cp -r web/build/* $out
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Assets needed for Tilt";
|
||||
homepage = "https://tilt.dev/";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [ anton-dessiatov ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
31
pkgs/applications/networking/cluster/tilt/binary.nix
Normal file
31
pkgs/applications/networking/cluster/tilt/binary.nix
Normal file
@ -0,0 +1,31 @@
|
||||
{ lib
|
||||
, buildGoModule
|
||||
, src, version
|
||||
, tilt-assets
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "tilt";
|
||||
/* Do not use "dev" as a version. If you do, Tilt will consider itself
|
||||
running in development environment and try to serve assets from the
|
||||
source tree, which is not there once build completes. */
|
||||
inherit src version;
|
||||
|
||||
vendorHash = null;
|
||||
|
||||
subPackages = [ "cmd/tilt" ];
|
||||
|
||||
ldflags = [ "-X main.version=${version}" ];
|
||||
|
||||
preBuild = ''
|
||||
mkdir -p pkg/assets/build
|
||||
cp -r ${tilt-assets}/* pkg/assets/build/
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Local development tool to manage your developer instance when your team deploys to Kubernetes in production";
|
||||
homepage = "https://tilt.dev/";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [ anton-dessiatov ];
|
||||
};
|
||||
}
|
@ -1,32 +1,20 @@
|
||||
{ lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
{ fetchFromGitHub
|
||||
, callPackage
|
||||
}:
|
||||
let args = rec {
|
||||
/* Do not use "dev" as a version. If you do, Tilt will consider itself
|
||||
running in development environment and try to serve assets from the
|
||||
source tree, which is not there once build completes. */
|
||||
version = "0.33.6";
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "tilt";
|
||||
/* Do not use "dev" as a version. If you do, Tilt will consider itself
|
||||
running in development environment and try to serve assets from the
|
||||
source tree, which is not there once build completes. */
|
||||
version = "0.33.6";
|
||||
src = fetchFromGitHub {
|
||||
owner = "tilt-dev";
|
||||
repo = "tilt";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-WtE8ExUKFRtdYeg0+My/DB+L/qT+J1EaKHKChNjC5oI=";
|
||||
};
|
||||
};
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "tilt-dev";
|
||||
repo = "tilt";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-WtE8ExUKFRtdYeg0+My/DB+L/qT+J1EaKHKChNjC5oI=";
|
||||
};
|
||||
tilt-assets = callPackage ./assets.nix args;
|
||||
in callPackage ./binary.nix (args // { inherit tilt-assets; })
|
||||
|
||||
vendorHash = null;
|
||||
|
||||
subPackages = [ "cmd/tilt" ];
|
||||
|
||||
ldflags = [ "-X main.version=${version}" ];
|
||||
|
||||
meta = {
|
||||
description = "Local development tool to manage your developer instance when your team deploys to Kubernetes in production";
|
||||
homepage = "https://tilt.dev/";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [ anton-dessiatov ];
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user