Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

74 lines
1.7 KiB
Nix

{
lib,
stdenvNoCC,
fetchurl,
p7zip,
}:
let
version = "1.021";
source =
with lib.attrsets;
mapAttrs'
(
name: hash:
nameValuePair (lib.strings.toLower name) (fetchurl {
url = "https://github.com/GuiWonder/Shanggu/releases/download/${version}/Shanggu${name}TTCs.7z";
inherit hash;
})
)
{
Mono = "sha256-3WwknXSMH12Lu/HA/f647AyhDg2O9Eg5ZGDBrFp4SbE=";
Round = "sha256-vRL2YQkcp5vDSbLaMDEYd7HJVohZFYKlBfxAdY2l3mA=";
Sans = "sha256-x5z6GYsfQ+8a8W0djJTY8iutuLNYvaemIpdYh94krk0=";
Serif = "sha256-3WK7vty3zZFNKkwViEsozU3qa+5hymYwXk6ta9AxmNM=";
};
extraOutputs = builtins.attrNames source;
in
stdenvNoCC.mkDerivation {
pname = "shanggu-fonts";
inherit version;
outputs = [ "out" ] ++ extraOutputs;
nativeBuildInputs = [ p7zip ];
unpackPhase =
''
runHook preUnpack
''
+ lib.strings.concatLines (
lib.attrsets.mapAttrsToList (name: value: ''
7z x ${value} -o${name}
'') source
)
+ ''
runHook postUnpack
'';
installPhase =
''
runHook preInstall
mkdir -p $out/share/fonts/truetype
''
+ lib.strings.concatLines (
lib.lists.forEach extraOutputs (name: ''
install -Dm444 ${name}/*.ttc -t ${placeholder name}/share/fonts/truetype
ln -s "${placeholder name}" /share/fonts/truetype/*.ttc $out/share/fonts/truetype
'')
)
+ ''
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/GuiWonder/Shanggu";
description = "Heritage glyph (old glyph) font based on Siyuan";
license = licenses.ofl;
platforms = platforms.all;
maintainers = with maintainers; [ Cryolitia ];
};
}