Commit 54c7fdce authored by dish's avatar dish
Browse files

draupnir: modernize

parent 31727108
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -20,14 +20,14 @@ let
  nodeSources = srcOnly nodejs;
in

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "draupnir";
  version = "2.8.0";

  src = fetchFromGitHub {
    owner = "the-draupnir-project";
    repo = "Draupnir";
    tag = "v${version}";
    tag = "v${finalAttrs.version}";
    hash = "sha256-I9DYiNxD95pzHVsgZ/hJwHfrsVqE/eBALNiePVNDpy0=";
  };

@@ -42,13 +42,13 @@ stdenv.mkDerivation rec {
  ++ lib.optional stdenv.hostPlatform.isDarwin cctools.libtool;

  offlineCache = fetchYarnDeps {
    inherit src;
    inherit (finalAttrs) src;
    hash = "sha256-kTdJ6zKNjH5CxcM9EvXzbz2Phrp5xI0+pvNwMLRmLgQ=";
  };

  preBuild = ''
    # install proper version info
    echo "${version}-nix" > version.txt
    echo "${finalAttrs.version}-nix" > version.txt

    # makes network requests
    sed -i 's/corepack //g' package.json
@@ -97,7 +97,7 @@ stdenv.mkDerivation rec {
    updateScript = nix-update-script { };
  };

  meta = with lib; {
  meta = {
    description = "Moderation tool for Matrix";
    homepage = "https://github.com/the-draupnir-project/Draupnir";
    longDescription = ''
@@ -114,8 +114,8 @@ stdenv.mkDerivation rec {
      A Synapse module is also available to apply the same rulesets the bot
      uses across an entire homeserver.
    '';
    license = licenses.afl3;
    maintainers = with maintainers; [ RorySys ];
    license = lib.licenses.afl3;
    maintainers = with lib.maintainers; [ RorySys ];
    mainProgram = "draupnir";
  };
}
})