From 2ab659f08c513c20fa7929fb3edfc401c2b89569 Mon Sep 17 00:00:00 2001 From: Petr Portnov Date: Tue, 31 Mar 2026 13:53:34 +0300 Subject: [PATCH] static-web-server: 2.39.0 -> 2.42.0 --- pkgs/by-name/st/static-web-server/package.nix | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/st/static-web-server/package.nix b/pkgs/by-name/st/static-web-server/package.nix index e640c6ab427a..0b834e9f52c3 100644 --- a/pkgs/by-name/st/static-web-server/package.nix +++ b/pkgs/by-name/st/static-web-server/package.nix @@ -3,29 +3,31 @@ rustPlatform, fetchFromGitHub, nixosTests, + versionCheckHook, + nix-update-script, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "static-web-server"; - version = "2.39.0"; + version = "2.42.0"; src = fetchFromGitHub { owner = "static-web-server"; repo = "static-web-server"; - rev = "v${finalAttrs.version}"; - hash = "sha256-iprQlSHO+ac7v1odVoS/9IU+Zov8/xh1l9pm1PJE8fs="; + tag = "v${finalAttrs.version}"; + hash = "sha256-EWCkad2v937GPL7qeHxPp24wf3EWk+M5iQkZBhErv/Y="; }; - cargoHash = "sha256-rNrGlgUvPezX7RnKhprRjl9DiJ/Crt4phmxnfY9tNXA="; + cargoHash = "sha256-RYTG54c4Q4uP4lAZpjfulP/BV4jDp5xxsa6vtSn+vOs="; # static-web-server already has special handling for files with modification - # time = unix epoch, but the nix store is unix epoch + 1 second. + # time = Unix epoch, but the nix store is Unix epoch + 1 second. patches = [ ./include-unix-time-plus-one.diff ]; - # Some tests which implicitly relied on the above behavior now break. Force - # an mtime update to fix. + # Some tests which implicitly relied on the above behavior now break. + # Force an mtime update to everything except symbolic inks to fix. postUnpack = '' - find . -exec touch -m {} + + find . -not -type l -exec touch -m {} + ''; # Need to copy in the systemd units for systemd.packages to discover them @@ -33,12 +35,18 @@ rustPlatform.buildRustPackage (finalAttrs: { install -Dm444 -t $out/lib/systemd/system/ systemd/static-web-server.{service,socket} ''; - passthru.tests = { - inherit (nixosTests) static-web-server; + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + + passthru = { + updateScript = nix-update-script { }; + tests = { + inherit (nixosTests) static-web-server; + }; }; meta = { - description = "Asynchronous web server for static files-serving"; + description = "A cross-platform, high-performance and asynchronous web server for static files-serving"; homepage = "https://static-web-server.net/"; changelog = "https://github.com/static-web-server/static-web-server/blob/v${finalAttrs.version}/CHANGELOG.md"; license = with lib.licenses; [