From b97588ebb20a82bfb752f2473c260b61c038e01f Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Sun, 29 Sep 2024 20:43:44 +0800 Subject: [PATCH] matrix-hebbot: move to by-name; nixfmt --- .../ma}/matrix-hebbot/Cargo.lock | 0 .../ma/matrix-hebbot/package.nix} | 44 ++++++++++++------- pkgs/top-level/all-packages.nix | 4 -- 3 files changed, 27 insertions(+), 21 deletions(-) rename pkgs/{servers => by-name/ma}/matrix-hebbot/Cargo.lock (100%) rename pkgs/{servers/matrix-hebbot/default.nix => by-name/ma/matrix-hebbot/package.nix} (54%) diff --git a/pkgs/servers/matrix-hebbot/Cargo.lock b/pkgs/by-name/ma/matrix-hebbot/Cargo.lock similarity index 100% rename from pkgs/servers/matrix-hebbot/Cargo.lock rename to pkgs/by-name/ma/matrix-hebbot/Cargo.lock diff --git a/pkgs/servers/matrix-hebbot/default.nix b/pkgs/by-name/ma/matrix-hebbot/package.nix similarity index 54% rename from pkgs/servers/matrix-hebbot/default.nix rename to pkgs/by-name/ma/matrix-hebbot/package.nix index a2f222e6d489..0639d350db40 100644 --- a/pkgs/servers/matrix-hebbot/default.nix +++ b/pkgs/by-name/ma/matrix-hebbot/package.nix @@ -1,13 +1,14 @@ -{ lib -, fetchFromGitHub -, stdenv -, rustPlatform -, pkg-config -, cmake -, openssl -, autoconf -, automake -, Security +{ + lib, + fetchFromGitHub, + stdenv, + rustPlatform, + pkg-config, + cmake, + openssl, + autoconf, + automake, + darwin, }: rustPlatform.buildRustPackage rec { @@ -17,7 +18,7 @@ rustPlatform.buildRustPackage rec { src = fetchFromGitHub { owner = "haecker-felix"; repo = "hebbot"; - rev = "v${version}"; + rev = "refs/tags/v${version}"; sha256 = "sha256-zcsoTWpNonkgJLTC8S9Nubnzdhj5ROL/UGNWUsLxLgs="; }; @@ -28,17 +29,26 @@ rustPlatform.buildRustPackage rec { }; }; - nativeBuildInputs = [ pkg-config cmake ] ++ - lib.optionals stdenv.hostPlatform.isDarwin [ autoconf automake ]; + nativeBuildInputs = + [ + pkg-config + cmake + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + autoconf + automake + ]; - buildInputs = [ openssl ] ++ lib.optional stdenv.hostPlatform.isDarwin Security; + buildInputs = [ + openssl + ] ++ lib.optional stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Security ]; - meta = with lib; { + meta = { description = "Matrix bot which can generate \"This Week in X\" like blog posts "; homepage = "https://github.com/haecker-felix/hebbot"; changelog = "https://github.com/haecker-felix/hebbot/releases/tag/v${version}"; - license = with licenses; [ agpl3Only ]; + license = with lib.licenses; [ agpl3Only ]; mainProgram = "hebbot"; - maintainers = with maintainers; [ a-kenji ]; + maintainers = with lib.maintainers; [ a-kenji ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1b8abbdc9443..bc3b811b1a65 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5219,10 +5219,6 @@ with pkgs; hebcal = callPackage ../tools/misc/hebcal { }; - hebbot = callPackage ../servers/matrix-hebbot { - inherit (darwin.apple_sdk.frameworks) Security; - }; - hexio = callPackage ../development/tools/hexio { }; hexyl = callPackage ../tools/misc/hexyl { };