mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
cup-docker{,-noserver}: init at 3.4.0 (#412710)
This commit is contained in:
98
pkgs/by-name/cu/cup-docker/package.nix
Normal file
98
pkgs/by-name/cu/cup-docker/package.nix
Normal file
@@ -0,0 +1,98 @@
|
||||
{
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
bun,
|
||||
nodejs-slim_latest,
|
||||
nix-update-script,
|
||||
withServer ? true,
|
||||
}:
|
||||
let
|
||||
pname = "cup-docker";
|
||||
version = "3.4.0";
|
||||
src = fetchFromGitHub {
|
||||
owner = "sergi0g";
|
||||
repo = "cup";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-ciH3t2L2eJhk1+JXTqEJSuHve8OuVod7AuQ3iFWmKRE=";
|
||||
};
|
||||
web = stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "${pname}-web";
|
||||
inherit version src;
|
||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [
|
||||
"GIT_PROXY_COMMAND"
|
||||
"SOCKS_SERVER"
|
||||
];
|
||||
sourceRoot = "${finalAttrs.src.name}/web";
|
||||
nativeBuildInputs = [
|
||||
bun
|
||||
nodejs-slim_latest
|
||||
];
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
bun install --no-progress --frozen-lockfile
|
||||
substituteInPlace node_modules/.bin/{vite,tsc} \
|
||||
--replace-fail "/usr/bin/env node" "${nodejs-slim_latest}/bin/node"
|
||||
runHook postConfigure
|
||||
'';
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
bun run build
|
||||
runHook postBuild
|
||||
'';
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/dist
|
||||
cp -R ./dist $out
|
||||
runHook postInstall
|
||||
'';
|
||||
outputHash = "sha256-Ac1PJYmTQv9XrmhmF1p77vdXh8252hz0CUKxJA+VQR4=";
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
});
|
||||
in
|
||||
rustPlatform.buildRustPackage {
|
||||
inherit
|
||||
src
|
||||
version
|
||||
pname
|
||||
;
|
||||
|
||||
cargoHash = "sha256-L9zugOwlPwpdtjV87dT1PH7FAMJYHYFuvfyOfPe5b2k=";
|
||||
|
||||
buildNoDefaultFeatures = true;
|
||||
buildFeatures =
|
||||
[
|
||||
"cli"
|
||||
]
|
||||
++ lib.optional withServer [
|
||||
"server"
|
||||
];
|
||||
|
||||
preConfigure = lib.optionalString withServer ''
|
||||
cp -r ${web}/dist src/static
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit web;
|
||||
updateScript = nix-update-script {
|
||||
extraArgs = [
|
||||
"--subpackage"
|
||||
"web"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "a lightweight way to check for container image updates. written in Rust";
|
||||
homepage = "https://cup.sergi0g.dev";
|
||||
license = lib.licenses.agpl3Only;
|
||||
platforms = lib.platforms.all;
|
||||
changelog = "https://github.com/sergi0g/cup/releases";
|
||||
mainProgram = "cup";
|
||||
maintainers = with lib.maintainers; [
|
||||
kuflierl
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -369,6 +369,8 @@ with pkgs;
|
||||
|
||||
copilot-language-server-fhs = copilot-language-server.fhs;
|
||||
|
||||
cup-docker-noserver = cup-docker.override { withServer = false; };
|
||||
|
||||
deck = callPackage ../by-name/de/deck/package.nix {
|
||||
buildGoModule = buildGo123Module;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user