tree-wide: format with nixfmt

Another saturday another useless formatter change.
It's my dotfiles, after all

alejandra doesn't handle c-style inline comments well.
This commit is contained in:
Primrose 2025-11-08 10:15:58 +08:00
parent ec704b5272
commit ebf8468807
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
116 changed files with 1895 additions and 1689 deletions

View file

@ -2,26 +2,27 @@
fetchFromGitHub,
stdenvNoCC,
lib,
}: let
}:
let
rev = "9bb188e2701138e03f73bacebd6b19b181ca0012";
in
stdenvNoCC.mkDerivation {
pname = "ai_blocklist";
version = "unstable-" + lib.substring 0 8 rev;
stdenvNoCC.mkDerivation {
pname = "ai_blocklist";
version = "unstable-" + lib.substring 0 8 rev;
src = fetchFromGitHub {
owner = "laylavish";
repo = "uBlockOrigin-HUGE-AI-Blocklist";
inherit rev;
hash = "sha256-p3wfR28DH6V8BHn9DT10d09Yq3mdbBecWwlR1CdDYUA=";
};
src = fetchFromGitHub {
owner = "laylavish";
repo = "uBlockOrigin-HUGE-AI-Blocklist";
inherit rev;
hash = "sha256-p3wfR28DH6V8BHn9DT10d09Yq3mdbBecWwlR1CdDYUA=";
};
installPhase = ''
mkdir -p $out/share
cp noai_hosts.txt $out/share/hosts.txt
installPhase = ''
mkdir -p $out/share
cp noai_hosts.txt $out/share/hosts.txt
# drop domain names
cat $out/share/hosts.txt |
sed 's/^0.0.0.0 //' > $out/share/domains.txt
'';
}
# drop domain names
cat $out/share/hosts.txt |
sed 's/^0.0.0.0 //' > $out/share/domains.txt
'';
}

View file

@ -2,20 +2,24 @@
rustPlatform,
fetchFromGitea,
}:
rustPlatform.buildRustPackage (finalAttrs: let
cargoToml = fromTOML (builtins.readFile (finalAttrs.src + "/Cargo.toml"));
cargoLock = finalAttrs.src + "/Cargo.lock";
in {
pname = "audio-lint";
version = cargoToml.package.version;
rustPlatform.buildRustPackage (
finalAttrs:
let
cargoToml = fromTOML (builtins.readFile (finalAttrs.src + "/Cargo.toml"));
cargoLock = finalAttrs.src + "/Cargo.lock";
in
{
pname = "audio-lint";
version = cargoToml.package.version;
src = fetchFromGitea {
domain = "git.confusedcompiler.org";
owner = "leana8959";
repo = "audio-lint";
rev = "3ea38c85c5f6135958e51ad4ff13a96ccd68a21c";
hash = "sha256-h1SnWAh3FPL5GweOXVXXtp+swZApgecYaWjy7rM/J+w=";
};
src = fetchFromGitea {
domain = "git.confusedcompiler.org";
owner = "leana8959";
repo = "audio-lint";
rev = "3ea38c85c5f6135958e51ad4ff13a96ccd68a21c";
hash = "sha256-h1SnWAh3FPL5GweOXVXXtp+swZApgecYaWjy7rM/J+w=";
};
cargoLock.lockFile = cargoLock;
})
cargoLock.lockFile = cargoLock;
}
)

View file

@ -6,29 +6,33 @@
libxcb,
fetchFromGitHub,
}:
rustPlatform.buildRustPackage (finalAttrs: let
cargoToml = fromTOML (builtins.readFile (finalAttrs.src + "/Cargo.toml"));
cargoLock = finalAttrs.src + "/Cargo.lock";
in {
pname = "emoji-picker";
version = cargoToml.package.version;
rustPlatform.buildRustPackage (
finalAttrs:
let
cargoToml = fromTOML (builtins.readFile (finalAttrs.src + "/Cargo.toml"));
cargoLock = finalAttrs.src + "/Cargo.lock";
in
{
pname = "emoji-picker";
version = cargoToml.package.version;
src = fetchFromGitHub {
owner = "leana8959";
repo = "emoji-picker";
rev = "d77c086bb3ed1ba55560c5027cc58e2c033c9ca7";
hash = "sha256-gLsBhtSnrOdU/qH9WR3UnsclfptRAP0Wv+MJjY+wYGc=";
};
src = fetchFromGitHub {
owner = "leana8959";
repo = "emoji-picker";
rev = "d77c086bb3ed1ba55560c5027cc58e2c033c9ca7";
hash = "sha256-gLsBhtSnrOdU/qH9WR3UnsclfptRAP0Wv+MJjY+wYGc=";
};
cargoLock.lockFile = cargoLock;
cargoLock.lockFile = cargoLock;
nativeBuildInputs = [
python3
pkg-config
];
nativeBuildInputs = [
python3
pkg-config
];
buildInputs = [
openssl.dev
libxcb
];
})
buildInputs = [
openssl.dev
libxcb
];
}
)

View file

@ -2,25 +2,26 @@
fetchFromGitHub,
stdenvNoCC,
lib,
}: let
}:
let
rev = "cc19c050997d5f54014bb20c764b131e003dfb17";
in
stdenvNoCC.mkDerivation {
pname = "hategroup_blocklist";
version = "unstable-" + lib.substring 0 8 rev;
stdenvNoCC.mkDerivation {
pname = "hategroup_blocklist";
version = "unstable-" + lib.substring 0 8 rev;
src = fetchFromGitHub {
owner = "chigh";
repo = "hategroup-dnsbl";
inherit rev;
hash = "sha256-SZBrjIBUw687MdrbOV7WrP5IhAAtKvPL2GqdcICHNvQ=";
};
src = fetchFromGitHub {
owner = "chigh";
repo = "hategroup-dnsbl";
inherit rev;
hash = "sha256-SZBrjIBUw687MdrbOV7WrP5IhAAtKvPL2GqdcICHNvQ=";
};
installPhase = ''
mkdir -p $out/share
cp blocklist.txt $out/share/domains.txt
installPhase = ''
mkdir -p $out/share
cp blocklist.txt $out/share/domains.txt
cat $out/share/domains.txt |
sed 's/^\([^#].*\)$/0.0.0.0 \1/' > $out/share/hosts.txt
'';
}
cat $out/share/domains.txt |
sed 's/^\([^#].*\)$/0.0.0.0 \1/' > $out/share/hosts.txt
'';
}

View file

@ -3,31 +3,26 @@
haskell,
fetchFromGitea,
installShellFiles,
}: let
}:
let
inherit (haskell.lib.compose) justStaticExecutables overrideCabal;
drv =
haskellPackages.callCabal2nix "hbrainfuck"
(fetchFromGitea {
domain = "git.confusedcompiler.org";
owner = "leana8959";
repo = "hbrainfuck";
rev = "5eea5ff0d7efc0bd866a2273686032ba9cab5baa";
hash = "sha256-/htXOULUJN8+PsAYaG281Ge/9ULZoWip63IUxuVbTSg=";
})
{};
drv = haskellPackages.callCabal2nix "hbrainfuck" (fetchFromGitea {
domain = "git.confusedcompiler.org";
owner = "leana8959";
repo = "hbrainfuck";
rev = "5eea5ff0d7efc0bd866a2273686032ba9cab5baa";
hash = "sha256-/htXOULUJN8+PsAYaG281Ge/9ULZoWip63IUxuVbTSg=";
}) { };
cabalOverrides = o: {
buildTools = o.buildTools or [] ++ [installShellFiles];
postInstall =
o.postInstall or ""
+ ''
installShellCompletion --cmd hbrainfuck \
--bash <("$out/bin/hbf" --bash-completion-script "$out/bin/hbf") \
--fish <("$out/bin/hbf" --fish-completion-script "$out/bin/hbf") \
--zsh <("$out/bin/hbf" --zsh-completion-script "$out/bin/hbf")
'';
buildTools = o.buildTools or [ ] ++ [ installShellFiles ];
postInstall = o.postInstall or "" + ''
installShellCompletion --cmd hbrainfuck \
--bash <("$out/bin/hbf" --bash-completion-script "$out/bin/hbf") \
--fish <("$out/bin/hbf" --fish-completion-script "$out/bin/hbf") \
--zsh <("$out/bin/hbf" --zsh-completion-script "$out/bin/hbf")
'';
};
in
justStaticExecutables
(overrideCabal cabalOverrides drv)
justStaticExecutables (overrideCabal cabalOverrides drv)

View file

@ -2,18 +2,16 @@
haskellPackages,
haskell,
fetchFromGitea,
}: let
}:
let
inherit (haskell.lib.compose) justStaticExecutables;
drv =
haskellPackages.callCabal2nix "hutils"
(fetchFromGitea {
domain = "git.confusedcompiler.org";
owner = "leana8959";
repo = "hutils";
rev = "30b503bec011f8908e26c0e1e961936d56da74cc";
hash = "sha256-lPwqxsz7WXdDMonjdWvTziR5HuE5HY2GyU2rQkwn0VU=";
})
{};
drv = haskellPackages.callCabal2nix "hutils" (fetchFromGitea {
domain = "git.confusedcompiler.org";
owner = "leana8959";
repo = "hutils";
rev = "30b503bec011f8908e26c0e1e961936d56da74cc";
hash = "sha256-lPwqxsz7WXdDMonjdWvTziR5HuE5HY2GyU2rQkwn0VU=";
}) { };
in
justStaticExecutables drv
justStaticExecutables drv

View file

@ -14,7 +14,7 @@ stdenv.mkDerivation {
hash = "sha256-Ee4/N2Q90xsbyGVtpE/yUFWC/ELt8nBAICkR/FlZQOo=";
};
nativeBuildInputs = [rustc];
nativeBuildInputs = [ rustc ];
installPhase = ''
mkdir -p "$out/bin"
cp --reflink=auto ./maeel "$out/bin"

View file

@ -2,27 +2,28 @@
fetchFromGitLab,
ocaml-ng,
ocamlPackages ? ocaml-ng.ocamlPackages_5_1,
}: let
}:
let
version = "v0.16.2";
in
ocamlPackages.buildDunePackage {
pname = "necrolib";
inherit version;
ocamlPackages.buildDunePackage {
pname = "necrolib";
inherit version;
minimalOCamlVersion = "5.1.1";
minimalOCamlVersion = "5.1.1";
src = fetchFromGitLab {
domain = "gitlab.inria.fr";
owner = "skeletons";
repo = "necro";
rev = version;
hash = "sha256-KoSKJD5jy+GY5QKKMUTW5gc0V/5l/klHrJMdC8aPnj8=";
};
src = fetchFromGitLab {
domain = "gitlab.inria.fr";
owner = "skeletons";
repo = "necro";
rev = version;
hash = "sha256-KoSKJD5jy+GY5QKKMUTW5gc0V/5l/klHrJMdC8aPnj8=";
};
duneVersion = "3";
nativeBuildInputs = [ocamlPackages.menhir];
buildInputs = [
ocamlPackages.ocamlgraph
ocamlPackages.dune-build-info
];
}
duneVersion = "3";
nativeBuildInputs = [ ocamlPackages.menhir ];
buildInputs = [
ocamlPackages.ocamlgraph
ocamlPackages.dune-build-info
];
}

View file

@ -2,26 +2,27 @@
writeShellApplication,
which,
lib,
}: let
}:
let
# Use this to not pollute the PATH inside
# Otherwise nix-which which will be an edge case
whichExe = "${lib.getExe which}";
in
writeShellApplication {
name = "nix-which";
text = ''
if [ "$#" -ne 1 ]; then
echo "Must provide exactly one argument, the package to be dereferenced"
exit 1
fi
target="$1"
writeShellApplication {
name = "nix-which";
text = ''
if [ "$#" -ne 1 ]; then
echo "Must provide exactly one argument, the package to be dereferenced"
exit 1
fi
target="$1"
target="$(${whichExe} "$target")"
echo "==> $target"
target="$(${whichExe} "$target")"
echo "==> $target"
while [ -L "$target" ]; do
target="$(readlink "$target")"
echo "==> $target"
done
'';
}
while [ -L "$target" ]; do
target="$(readlink "$target")"
echo "==> $target"
done
'';
}

View file

@ -3,31 +3,26 @@
haskell,
fetchFromGitea,
installShellFiles,
}: let
}:
let
inherit (haskell.lib.compose) justStaticExecutables overrideCabal;
drv =
haskellPackages.callCabal2nix "prop-solveur"
(fetchFromGitea {
domain = "git.confusedcompiler.org";
owner = "leana8959";
repo = "prop_solveur";
rev = "cc2430dc5a396b01d02bd925070ce5d009d05bc4";
hash = "sha256-jwNfRBytf/w0d2CWczXp+rVRXYNzptkuFE3OKSdOhLc=";
})
{};
drv = haskellPackages.callCabal2nix "prop-solveur" (fetchFromGitea {
domain = "git.confusedcompiler.org";
owner = "leana8959";
repo = "prop_solveur";
rev = "cc2430dc5a396b01d02bd925070ce5d009d05bc4";
hash = "sha256-jwNfRBytf/w0d2CWczXp+rVRXYNzptkuFE3OKSdOhLc=";
}) { };
cabalOverrides = o: {
buildTools = o.buildTools or [] ++ [installShellFiles];
postInstall =
o.postInstall or ""
+ ''
installShellCompletion --cmd prop-solveur \
--bash <("$out/bin/prop-solveur" --bash-completion-script "$out/bin/prop-solveur") \
--fish <("$out/bin/prop-solveur" --fish-completion-script "$out/bin/prop-solveur") \
--zsh <("$out/bin/prop-solveur" --zsh-completion-script "$out/bin/prop-solveur")
'';
buildTools = o.buildTools or [ ] ++ [ installShellFiles ];
postInstall = o.postInstall or "" + ''
installShellCompletion --cmd prop-solveur \
--bash <("$out/bin/prop-solveur" --bash-completion-script "$out/bin/prop-solveur") \
--fish <("$out/bin/prop-solveur" --fish-completion-script "$out/bin/prop-solveur") \
--zsh <("$out/bin/prop-solveur" --zsh-completion-script "$out/bin/prop-solveur")
'';
};
in
justStaticExecutables
(overrideCabal cabalOverrides drv)
justStaticExecutables (overrideCabal cabalOverrides drv)

View file

@ -3,31 +3,26 @@
haskell,
fetchFromGitea,
installShellFiles,
}: let
}:
let
inherit (haskell.lib.compose) justStaticExecutables overrideCabal;
drv =
haskellPackages.callCabal2nix "ruler"
(fetchFromGitea {
domain = "git.confusedcompiler.org";
owner = "leana8959";
repo = "ruler";
rev = "f328620a52b25d4c9dea64425afe5995dfb8cb5a";
hash = "sha256-8nSVFckWXkf9dRTdzjbHRhf/qPdbXHEkVI4DyW3zfSo=";
})
{};
drv = haskellPackages.callCabal2nix "ruler" (fetchFromGitea {
domain = "git.confusedcompiler.org";
owner = "leana8959";
repo = "ruler";
rev = "f328620a52b25d4c9dea64425afe5995dfb8cb5a";
hash = "sha256-8nSVFckWXkf9dRTdzjbHRhf/qPdbXHEkVI4DyW3zfSo=";
}) { };
cabalOverrides = o: {
buildTools = o.buildTools or [] ++ [installShellFiles];
postInstall =
o.postInstall or ""
+ ''
installShellCompletion --cmd ruler \
--bash <("$out/bin/ruler" --bash-completion-script "$out/bin/ruler") \
--fish <("$out/bin/ruler" --fish-completion-script "$out/bin/ruler") \
--zsh <("$out/bin/ruler" --zsh-completion-script "$out/bin/ruler")
'';
buildTools = o.buildTools or [ ] ++ [ installShellFiles ];
postInstall = o.postInstall or "" + ''
installShellCompletion --cmd ruler \
--bash <("$out/bin/ruler" --bash-completion-script "$out/bin/ruler") \
--fish <("$out/bin/ruler" --fish-completion-script "$out/bin/ruler") \
--zsh <("$out/bin/ruler" --zsh-completion-script "$out/bin/ruler")
'';
};
in
justStaticExecutables
(overrideCabal cabalOverrides drv)
justStaticExecutables (overrideCabal cabalOverrides drv)

View file

@ -6,10 +6,11 @@
gnused,
lib,
symlinkJoin,
}: let
}:
let
tmux-register-session = writeShellApplication {
name = "__tmux-register-session";
runtimeInputs = [tmux];
runtimeInputs = [ tmux ];
text = ''
last=/tmp/TMUX_LAST
@ -27,7 +28,10 @@
tmux-maybe-create = writeShellApplication {
name = "__tmux-maybe-create";
runtimeInputs = [procps tmux];
runtimeInputs = [
procps
tmux
];
text = ''
session_name="$1"
session_dir="$2"
@ -40,7 +44,7 @@
tmux-attach-or-switch = writeShellApplication {
name = "__tmux-attach-or-switch";
runtimeInputs = [tmux];
runtimeInputs = [ tmux ];
text = ''
session_name="$1"
TMUX=''${TMUX:-}
@ -55,7 +59,10 @@
tmux-sessionizer = writeShellApplication {
name = "tmux-sessionizer";
runtimeInputs = [fzf gnused];
runtimeInputs = [
fzf
gnused
];
text = ''
selected=$(
{
@ -93,12 +100,12 @@
'';
};
in
symlinkJoin {
name = "tmux-sessionizer";
paths = [
tmux-register-session
tmux-maybe-create
tmux-attach-or-switch
tmux-sessionizer
];
}
symlinkJoin {
name = "tmux-sessionizer";
paths = [
tmux-register-session
tmux-maybe-create
tmux-attach-or-switch
tmux-sessionizer
];
}

View file

@ -7,29 +7,33 @@
darwin,
zlib,
}:
rustPlatform.buildRustPackage (finalAttrs: let
cargoToml = fromTOML (builtins.readFile (finalAttrs.src + "/Cargo.toml"));
cargoLock = finalAttrs.src + "/Cargo.lock";
in {
pname = "tokei";
version = cargoToml.package.version;
rustPlatform.buildRustPackage (
finalAttrs:
let
cargoToml = fromTOML (builtins.readFile (finalAttrs.src + "/Cargo.toml"));
cargoLock = finalAttrs.src + "/Cargo.lock";
in
{
pname = "tokei";
version = cargoToml.package.version;
src = fetchFromGitHub {
owner = "XAMPPRocky";
repo = "tokei";
rev = "v13.0.0-alpha.9";
hash = "sha256-OSIJYSUwc8SvszEOMgt+d/ljCW2jtBkPw6buof4JpUc=";
};
src = fetchFromGitHub {
owner = "XAMPPRocky";
repo = "tokei";
rev = "v13.0.0-alpha.9";
hash = "sha256-OSIJYSUwc8SvszEOMgt+d/ljCW2jtBkPw6buof4JpUc=";
};
cargoLock.lockFile = cargoLock;
cargoLock.lockFile = cargoLock;
buildInputs = lib.optionals stdenv.isDarwin [
libiconv
darwin.Security
];
buildInputs = lib.optionals stdenv.isDarwin [
libiconv
darwin.Security
];
checkInputs = lib.optionals stdenv.isDarwin [zlib];
checkInputs = lib.optionals stdenv.isDarwin [ zlib ];
# enable all output formats
buildFeatures = ["all"];
})
# enable all output formats
buildFeatures = [ "all" ];
}
)

View file

@ -2,36 +2,37 @@
lib,
rustPlatform,
fetchFromGitHub,
}: let
}:
let
rev = "c9d4b164ff5dc2567bb0de3876460e51da62ba94";
in
rustPlatform.buildRustPackage (finalAttrs: {
pname = "typst-bot";
version = lib.substring 0 8 rev;
rustPlatform.buildRustPackage (finalAttrs: {
pname = "typst-bot";
version = lib.substring 0 8 rev;
src = fetchFromGitHub {
owner = "mattfbacon";
repo = "typst-bot";
inherit rev;
hash = "sha256-tB+zrE5p7zOloOgoP2fmFsajd4IBf94ET1v/0W3aNcM=";
src = fetchFromGitHub {
owner = "mattfbacon";
repo = "typst-bot";
inherit rev;
hash = "sha256-tB+zrE5p7zOloOgoP2fmFsajd4IBf94ET1v/0W3aNcM=";
};
preBuild = ''
# Don't use the upstream way of embedding the git rev
echo 'fn main() { println!("cargo:rustc-env=BUILD_SHA=${rev}"); }' > crates/bot/build.rs
# Patch the command calling the worker by name.
substituteInPlace crates/bot/src/worker.rs --replace-fail \
'"./worker"' \
'"${placeholder "out"}/bin/worker"'
'';
cargoBuildFlags = [ "--workspace" ];
cargoLock = {
lockFile = "${finalAttrs.src}/Cargo.lock";
outputHashes = {
"poise-0.6.1" = "sha256-iXyp9sR/vzPsexGPdRjfuKyFcGqvDdqiBAXnuw/HFo8=";
};
preBuild = ''
# Don't use the upstream way of embedding the git rev
echo 'fn main() { println!("cargo:rustc-env=BUILD_SHA=${rev}"); }' > crates/bot/build.rs
# Patch the command calling the worker by name.
substituteInPlace crates/bot/src/worker.rs --replace-fail \
'"./worker"' \
'"${placeholder "out"}/bin/worker"'
'';
cargoBuildFlags = ["--workspace"];
cargoLock = {
lockFile = "${finalAttrs.src}/Cargo.lock";
outputHashes = {
"poise-0.6.1" = "sha256-iXyp9sR/vzPsexGPdRjfuKyFcGqvDdqiBAXnuw/HFo8=";
};
};
})
};
})

View file

@ -3,27 +3,31 @@
fetchFromGitHub,
fetchpatch,
}:
rustPlatform.buildRustPackage (finalAttrs: let
cargoToml = fromTOML (builtins.readFile (finalAttrs.src + "/Cargo.toml"));
cargoLock = finalAttrs.src + "/Cargo.lock";
in {
pname = "typst-mutilate";
version = cargoToml.package.version;
rustPlatform.buildRustPackage (
finalAttrs:
let
cargoToml = fromTOML (builtins.readFile (finalAttrs.src + "/Cargo.toml"));
cargoLock = finalAttrs.src + "/Cargo.lock";
in
{
pname = "typst-mutilate";
version = cargoToml.package.version;
src = fetchFromGitHub {
owner = "frozolotl";
repo = "typst-mutilate";
rev = "9bf5ed1f8a2f91055a91077f0a8545ff1f229933";
hash = "sha256-r4fkFv1np8xhff3m8yev1rU1vfKRz8zQMIKIc+fOjew=";
};
src = fetchFromGitHub {
owner = "frozolotl";
repo = "typst-mutilate";
rev = "9bf5ed1f8a2f91055a91077f0a8545ff1f229933";
hash = "sha256-r4fkFv1np8xhff3m8yev1rU1vfKRz8zQMIKIc+fOjew=";
};
cargoLock.lockFile = cargoLock;
cargoLock.lockFile = cargoLock;
patches = [
(fetchpatch {
name = "raw-block-fix";
url = "https://github.com/frozolotl/typst-mutilate/pull/2/commits/223bc31abb2d5fef4e743a1582bb126a2ef47a45.patch";
hash = "sha256-+6DMQo4cjVASgkX4gcYrEkwQ/uxttV/61fDnXBqbNcg=";
})
];
})
patches = [
(fetchpatch {
name = "raw-block-fix";
url = "https://github.com/frozolotl/typst-mutilate/pull/2/commits/223bc31abb2d5fef4e743a1582bb126a2ef47a45.patch";
hash = "sha256-+6DMQo4cjVASgkX4gcYrEkwQ/uxttV/61fDnXBqbNcg=";
})
];
}
)

View file

@ -44,7 +44,7 @@ python3.pkgs.buildPythonApplication {
"rich"
];
pythonImportsCheck = ["webtoon_downloader"];
pythonImportsCheck = [ "webtoon_downloader" ];
nativeCheckInputs = with python3.pkgs; [
pytestCheckHook

View file

@ -4,7 +4,7 @@
}:
writeShellApplication {
name = "xbrightness";
runtimeInputs = [bc];
runtimeInputs = [ bc ];
text = ''
device=$1
rel=$2