From df238ebe1d4579c645bca99543eeccbfa8c5d630 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Fri, 27 Sep 2024 13:49:56 +0200 Subject: [PATCH] valeStyles: cleanup, format, refactor Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- pkgs/tools/text/vale/styles.nix | 57 ++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/pkgs/tools/text/vale/styles.nix b/pkgs/tools/text/vale/styles.nix index 6022d38497a9..6d2cd33577bd 100644 --- a/pkgs/tools/text/vale/styles.nix +++ b/pkgs/tools/text/vale/styles.nix @@ -1,34 +1,47 @@ -{ lib, stdenvNoCC, fetchFromGitHub, fetchzip, nix-update-script }: +{ + lib, + stdenvNoCC, + fetchFromGitHub, + nix-update-script, +}: let buildStyle = - { name - , stylePath ? name - , ... + { + name, + stylePath ? name, + ... }@args: - stdenvNoCC.mkDerivation ({ - pname = "vale-style-${lib.toLower name}"; + stdenvNoCC.mkDerivation ( + { + pname = "vale-style-${lib.toLower name}"; - dontConfigure = true; - dontBuild = true; - doCheck = false; - dontFixup = true; + dontConfigure = true; + dontBuild = true; + doCheck = false; + dontFixup = true; - installPhase = '' - runHook preInstall - mkdir -p $out/share/vale/styles - cp -R ${stylePath} "$out/share/vale/styles/${name}" - runHook postInstall - ''; + installPhase = '' + runHook preInstall + mkdir -p $out/share/vale/styles + cp -R ${stylePath} "$out/share/vale/styles/${name}" + runHook postInstall + ''; - passthru.updateScript = nix-update-script { }; + passthru.updateScript = nix-update-script { }; - meta = { - platforms = lib.platforms.all; - maintainers = with lib.maintainers; [ katexochen ]; - } // (args.meta or { }); - } // removeAttrs args [ "meta" "name" ]); + meta = { + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ katexochen ]; + } // (args.meta or { }); + } + // removeAttrs args [ + "meta" + "name" + ] + ); in + { alex = buildStyle rec { name = "alex";