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

68 lines
1.8 KiB
Nix

{
stdenv,
fetchurl,
lib,
unzip,
# To select only certain themes, pass `selected_themes` as a list of strings.
# reference ./shas.nix for available themes
selected_themes ? [ ],
}:
let
version = "1.0";
# this file is generated via ./update.sh
# borrowed from pkgs/data/fonts/nerdfonts
themeShas = import ./shas.nix;
knownThemes = builtins.attrNames themeShas;
selectedThemes =
if (selected_themes == [ ]) then
knownThemes
else
let
unknown = lib.subtractLists knownThemes selected_themes;
in
if (unknown != [ ]) then
throw "Unknown theme(s): ${lib.concatStringsSep " " unknown}"
else
selected_themes;
srcs = lib.lists.forEach selectedThemes (
name:
(fetchurl {
url = themeShas.${name}.url;
sha256 = themeShas.${name}.sha;
})
);
in
stdenv.mkDerivation {
pname = "adi1090x-plymouth-themes";
inherit version srcs;
nativeBuildInputs = [
unzip
];
sourceRoot = ".";
unpackCmd = "tar xzf $curSrc";
installPhase = ''
mkdir -p $out/share/plymouth/themes
for theme in ${toString selectedThemes}; do
mv $theme $out/share/plymouth/themes/$theme
done
find $out/share/plymouth/themes/ -name \*.plymouth -exec sed -i "s@\/usr\/@$out\/@" {} \;
'';
meta = with lib; {
description = "Plymouth boot themes from adi1090x";
longDescription = ''
A variety of plymouth boot screens by adi1090x. Using the default value
of `selected_themes` will install all themes (~524M). Consider overriding
this with a list of the string names of each theme to install. Check
./shas.nix for available themes.
'';
homepage = "https://github.com/adi1090x/plymouth-themes";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ slwst ];
};
}