diff --git a/pkgs/by-name/cu/cup-docker/package.nix b/pkgs/by-name/cu/cup-docker/package.nix new file mode 100644 index 0000000000000..db44b6a699864 --- /dev/null +++ b/pkgs/by-name/cu/cup-docker/package.nix @@ -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 + ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3d483fc5f0a18..d9b19714e711c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -377,6 +377,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; };