From 4796b6afabeb2ea993bae1472970f30859c2461c Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Sun, 14 Jul 2024 15:21:35 +0200 Subject: [PATCH] tomcat: format with nixfmt-rfc-style, remove `with lib;` --- pkgs/servers/http/tomcat/default.nix | 79 ++++++++++++++++------------ 1 file changed, 46 insertions(+), 33 deletions(-) diff --git a/pkgs/servers/http/tomcat/default.nix b/pkgs/servers/http/tomcat/default.nix index 9e9966643ce0..8dc11535d1ae 100644 --- a/pkgs/servers/http/tomcat/default.nix +++ b/pkgs/servers/http/tomcat/default.nix @@ -1,50 +1,63 @@ -{ stdenvNoCC, lib, fetchurl, nixosTests, testers, jre, gitUpdater }: +{ + fetchurl, + gitUpdater, + jre, + lib, + nixosTests, + stdenvNoCC, + testers, +}: let - common = { version, hash }: stdenvNoCC.mkDerivation (finalAttrs: { - pname = "apache-tomcat"; - inherit version; + common = + { version, hash }: + stdenvNoCC.mkDerivation (finalAttrs: { + pname = "apache-tomcat"; + inherit version; - src = fetchurl { - url = "mirror://apache/tomcat/tomcat-${lib.versions.major version}/v${version}/bin/apache-tomcat-${version}.tar.gz"; - inherit hash; - }; + src = fetchurl { + url = "mirror://apache/tomcat/tomcat-${lib.versions.major version}/v${version}/bin/apache-tomcat-${version}.tar.gz"; + inherit hash; + }; - outputs = [ "out" "webapps" ]; - installPhase = - '' + outputs = [ + "out" + "webapps" + ]; + installPhase = '' mkdir $out mv * $out mkdir -p $webapps/webapps mv $out/webapps $webapps/ ''; - passthru = { - updateScript = gitUpdater { - url = "https://github.com/apache/tomcat.git"; - allowedVersions = "^${lib.versions.major version}\\."; - ignoredVersions = "-M.*"; - }; - tests = { - inherit (nixosTests) tomcat; - version = testers.testVersion { - package = finalAttrs.finalPackage; - command = "JAVA_HOME=${jre} ${finalAttrs.finalPackage}/bin/version.sh"; + passthru = { + updateScript = gitUpdater { + url = "https://github.com/apache/tomcat.git"; + allowedVersions = "^${lib.versions.major version}\\."; + ignoredVersions = "-M.*"; + }; + tests = { + inherit (nixosTests) tomcat; + version = testers.testVersion { + package = finalAttrs.finalPackage; + command = "JAVA_HOME=${jre} ${finalAttrs.finalPackage}/bin/version.sh"; + }; }; }; - }; - meta = with lib; { - homepage = "https://tomcat.apache.org/"; - description = "Implementation of the Java Servlet and JavaServer Pages technologies"; - platforms = jre.meta.platforms; - maintainers = with maintainers; [ anthonyroussel ]; - license = [ licenses.asl20 ]; - sourceProvenance = with sourceTypes; [ binaryBytecode ]; - }; - }); + meta = { + homepage = "https://tomcat.apache.org/"; + description = "Implementation of the Java Servlet and JavaServer Pages technologies"; + platforms = jre.meta.platforms; + maintainers = with lib.maintainers; [ anthonyroussel ]; + license = lib.licenses.asl20; + sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; + }; + }); -in { +in +{ tomcat9 = common { version = "9.0.91"; hash = "sha256-DFspyh06Mbu4+ratH+7Yo3Au0yXRSDlVCmd0x2yQuFY=";