nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 103 lines 2.3 kB view raw
1{ 2 lib, 3 fetchFromGitHub, 4 stdenvNoCC, 5 yarnConfigHook, 6 yarnBuildHook, 7 nodejs_24, 8 fetchYarnDeps, 9 buildGoModule, 10 go-bindata, 11 versionCheckHook, 12}: 13let 14 pname = "fleet"; 15 version = "4.79.1"; 16 src = fetchFromGitHub { 17 owner = "fleetdm"; 18 repo = "fleet"; 19 tag = "fleet-v${version}"; 20 hash = "sha256-o/exnUy5vXi+Ey8smd36588M8B7GQlG5ZqtGyYySkxQ="; 21 }; 22 23 frontend = stdenvNoCC.mkDerivation { 24 pname = "${pname}-frontend"; 25 inherit version src; 26 27 nativeBuildInputs = [ 28 yarnConfigHook 29 yarnBuildHook 30 nodejs_24 31 ]; 32 33 yarnOfflineCache = fetchYarnDeps { 34 yarnLock = src + "/yarn.lock"; 35 hash = "sha256-cCf0Q6g+VJaTCOZ12/7z8gcDf3+YT2LBTCJb39InJVw="; 36 }; 37 38 NODE_ENV = "production"; 39 yarnBuildScript = "webpack"; 40 41 installPhase = '' 42 runHook preInstall 43 44 mkdir -p $out/assets 45 cp -r assets/* $out/assets/ 46 47 mkdir -p $out/frontend/templates 48 cp frontend/templates/react.tmpl $out/frontend/templates/react.tmpl 49 50 runHook postInstall 51 ''; 52 }; 53in 54buildGoModule (finalAttrs: { 55 inherit pname version src; 56 57 vendorHash = "sha256-CYqg8kHGUu+wd9l5UYURqmoR8/13HX9t5xHwjzdgJhU="; 58 59 subPackages = [ 60 "cmd/fleet" 61 ]; 62 63 ldflags = [ 64 "-X github.com/fleetdm/fleet/v4/server/version.appName=fleet" 65 "-X github.com/fleetdm/fleet/v4/server/version.version=${finalAttrs.version}" 66 ]; 67 68 nativeBuildInputs = [ go-bindata ]; 69 70 preBuild = '' 71 cp -r ${frontend}/assets/* assets 72 cp -r ${frontend}/frontend/templates/react.tmpl frontend/templates/react.tmpl 73 74 go-bindata -pkg=bindata -tags full \ 75 -o=server/bindata/generated.go \ 76 frontend/templates/ assets/... server/mail/templates 77 ''; 78 79 tags = [ "full" ]; 80 81 doInstallCheck = true; 82 versionCheckProgramArg = "version"; 83 nativeInstallCheckInputs = [ 84 versionCheckHook 85 ]; 86 87 passthru = { 88 inherit frontend; 89 }; 90 91 meta = { 92 homepage = "https://github.com/fleetdm/fleet"; 93 changelog = "https://github.com/fleetdm/fleet/releases/tag/fleet-v${finalAttrs.version}"; 94 description = "CLI tool to launch Fleet server"; 95 license = lib.licenses.mit; 96 maintainers = with lib.maintainers; [ 97 asauzeau 98 lesuisse 99 bddvlpr 100 ]; 101 mainProgram = "fleet"; 102 }; 103})