nix: format with alejandra

This commit is contained in:
Primrose 2025-02-08 12:05:12 +01:00
parent d5cad148da
commit 95eb4b71e0
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
118 changed files with 1291 additions and 1703 deletions

View file

@ -1,17 +1,17 @@
{ iosevka }:
let
{iosevka}: let
pname = "altiosevka";
in
(iosevka.overrideAttrs (_: {
inherit pname;
})).override
(iosevka.overrideAttrs (_: {
inherit pname;
}))
.override
{
set = pname;
/*
Guide: https://github.com/be5invis/Iosevka/blob/main/doc/custom-build.md
Guide: https://github.com/be5invis/Iosevka/blob/main/doc/custom-build.md
Use `term` spacing to avoid dashed arrow issue
https://github.com/ryanoasis/nerd-fonts/issues/1018
Use `term` spacing to avoid dashed arrow issue
https://github.com/ryanoasis/nerd-fonts/issues/1018
*/
privateBuildPlan = builtins.readFile ./buildplan.toml;
}

View file

@ -2,45 +2,34 @@
self,
systems,
...
}@inputs:
let
} @ inputs: let
inherit (inputs.nixpkgs) lib;
in
{
in {
packageOverlays = {
packages =
final: _:
let
stable = import inputs.nixpkgs-stable { inherit (final) system; };
in
packages = final: _: let
stable = import inputs.nixpkgs-stable {inherit (final) system;};
in
self.overlays.packages' stable stable;
packages' =
final: _:
let
mkNerdFont = final.callPackage self.lib.mkNerdFont { };
packages' = final: _: let
mkNerdFont = final.callPackage self.lib.mkNerdFont {};
mkHaskellPackage =
{
src,
name,
apply ? lib.id,
}:
let
drv = final.haskellPackages.callCabal2nix name src { };
in
lib.pipe drv [
apply
final.haskell.lib.dontHaddock
final.haskell.lib.justStaticExecutables
];
mkHaskellPackage = {
src,
name,
apply ? lib.id,
}: let
drv = final.haskellPackages.callCabal2nix name src {};
in
lib.pipe drv [
apply
final.haskell.lib.dontHaddock
final.haskell.lib.justStaticExecutables
];
in
lib.fix (ps: {
# fonts
hiosevka = final.callPackage ./hiosevka { };
hiosevka = final.callPackage ./hiosevka {};
hiosevka-nerd-font-mono = mkNerdFont {
font = ps.hiosevka;
extraArgs = [
@ -56,7 +45,7 @@ in
];
};
altiosevka = final.callPackage ./altiosevka { };
altiosevka = final.callPackage ./altiosevka {};
altiosevka-nerd-font-mono = mkNerdFont {
font = ps.altiosevka;
extraArgs = [
@ -72,44 +61,43 @@ in
];
};
# static version of noto-fonts cjk serif
noto-fonts-cjk-serif' = final.callPackage ./noto-fonts-cjk-serif.nix { };
noto-fonts-cjk-serif' = final.callPackage ./noto-fonts-cjk-serif.nix {};
logisim-evolution = final.callPackage ./logisim-evolution.nix { };
necrolib = final.callPackage ./necrolib.nix { };
why3-wrapped =
let
why3-pinned = import (final.fetchFromGitHub {
logisim-evolution = final.callPackage ./logisim-evolution.nix {};
necrolib = final.callPackage ./necrolib.nix {};
why3-wrapped = let
why3-pinned = import (final.fetchFromGitHub {
owner = "nixos";
repo = "nixpkgs";
rev = "805a384895c696f802a9bf5bf4720f37385df547";
hash = "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=";
}) {inherit (final) system;};
alt-ergo-pinned =
import
(final.fetchFromGitHub {
owner = "nixos";
repo = "nixpkgs";
rev = "805a384895c696f802a9bf5bf4720f37385df547";
hash = "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=";
}) { inherit (final) system; };
alt-ergo-pinned =
import
(final.fetchFromGitHub {
owner = "nixos";
repo = "nixpkgs";
rev = "1b95daa381fa4a0963217a5d386433c20008208a";
hash = "sha256-vwEtkxIEQjymeTk89Ty1MGfRVSWL1/3j1wt5xB5ua88=";
})
{
inherit (final) system;
config.allowUnfree = true;
};
in
why3-pinned.callPackage ./why3.nix { inherit (alt-ergo-pinned) alt-ergo; };
rev = "1b95daa381fa4a0963217a5d386433c20008208a";
hash = "sha256-vwEtkxIEQjymeTk89Ty1MGfRVSWL1/3j1wt5xB5ua88=";
})
{
inherit (final) system;
config.allowUnfree = true;
};
in
why3-pinned.callPackage ./why3.nix {inherit (alt-ergo-pinned) alt-ergo;};
maeel = final.callPackage ./maeel.nix { };
tokei = final.callPackage ./tokei { }; # alpha tokei with typst, skel, hledger
typst-mutilate = final.callPackage ./typst-mutilate.nix { };
typst-bot = final.callPackage ./typst-bot.nix { };
webtoon_downloader = final.callPackage ./webtoon_downloader.nix { };
maeel = final.callPackage ./maeel.nix {};
tokei = final.callPackage ./tokei {}; # alpha tokei with typst, skel, hledger
typst-mutilate = final.callPackage ./typst-mutilate.nix {};
typst-bot = final.callPackage ./typst-bot.nix {};
webtoon_downloader = final.callPackage ./webtoon_downloader.nix {};
posy-cursor = final.callPackage ./posy-cursor.nix { };
nd = final.callPackage ./nd { };
xbrightness = final.callPackage ./xbrightness.nix { };
ffgun = final.callPackage ./ffgun.nix { };
easyscan = final.callPackage ./easyscan.nix { };
posy-cursor = final.callPackage ./posy-cursor.nix {};
nd = final.callPackage ./nd {};
xbrightness = final.callPackage ./xbrightness.nix {};
ffgun = final.callPackage ./ffgun.nix {};
easyscan = final.callPackage ./easyscan.nix {};
# my repositories
hbf = mkHaskellPackage {
@ -121,10 +109,9 @@ in
rev = "81c1d0d7ef1595bda1f8e4d86592d06e33bfd422";
hash = "sha256-NSCqJwcM5UgsAMpIpDSTy534hEK0wMicqwoE3DC8CGk=";
};
apply =
p:
apply = p:
p.overrideAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ final.installShellFiles ];
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [final.installShellFiles];
postInstall =
(old.postInstall or "")
+ ''
@ -145,10 +132,9 @@ in
rev = "814082ed223f77f15484fcd62ab130c7c7ba1b17";
hash = "sha256-YNl9n3T0NfPQxbkLo4WVbg9huwAxKy96jQJxzt77z2w=";
};
apply =
p:
apply = p:
p.overrideAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ final.installShellFiles ];
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [final.installShellFiles];
postInstall =
(old.postInstall or "")
+ ''
@ -171,10 +157,9 @@ in
};
};
audio-lint =
let
rev = "3ea38c85c5f6135958e51ad4ff13a96ccd68a21c";
in
audio-lint = let
rev = "3ea38c85c5f6135958e51ad4ff13a96ccd68a21c";
in
final.rustPlatform.buildRustPackage rec {
pname = "audio-lint";
version = lib.substring 0 8 rev;
@ -189,21 +174,18 @@ in
cargoLock.lockFile = "${src}/Cargo.lock";
};
});
};
packages =
let
packageOf =
system:
let
pkgs = import inputs.nixpkgs { inherit system; };
in
lib.composeManyExtensions [
self.overlays.packages
self.overlays.reexports
] pkgs pkgs;
packages = let
packageOf = system: let
pkgs = import inputs.nixpkgs {inherit system;};
in
lib.composeManyExtensions [
self.overlays.packages
self.overlays.reexports
]
pkgs
pkgs;
in
lib.genAttrs systems packageOf;
}

View file

@ -1,12 +1,10 @@
{
writeShellApplication,
sane-backends,
poppler_utils,
fzf,
ghostscript,
}:
writeShellApplication {
name = "easyscan";
@ -62,5 +60,4 @@ writeShellApplication {
# Copy scan to current directory
cp "$final_filename" "./scan_$(date).pdf"
'';
}

View file

@ -1,11 +1,9 @@
# adapted from https://github.com/neXromancers/hacksaw
{
writeShellApplication,
shotgun,
ffmpeg_5-full,
}:
writeShellApplication {
name = "ffgun";
runtimeInputs = [

View file

@ -1,17 +1,17 @@
{ iosevka }:
let
{iosevka}: let
pname = "hiosevka";
in
(iosevka.overrideAttrs (_: {
inherit pname;
})).override
(iosevka.overrideAttrs (_: {
inherit pname;
}))
.override
{
set = pname;
/*
Guide: https://github.com/be5invis/Iosevka/blob/main/doc/custom-build.md
Guide: https://github.com/be5invis/Iosevka/blob/main/doc/custom-build.md
Use `term` spacing to avoid dashed arrow issue
https://github.com/ryanoasis/nerd-fonts/issues/1018
Use `term` spacing to avoid dashed arrow issue
https://github.com/ryanoasis/nerd-fonts/issues/1018
*/
privateBuildPlan = builtins.readFile ./buildplan.toml;
}

View file

@ -15,7 +15,7 @@ stdenv.mkDerivation {
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [makeWrapper];
installPhase = ''
runHook preInstall

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

@ -1,10 +1,8 @@
{
writeShellApplication,
nix-output-monitor,
nvd,
}:
writeShellApplication {
name = "nd";
runtimeInputs = [

View file

@ -3,30 +3,27 @@
fetchFromGitLab,
ocaml-ng,
ocamlPackages ? ocaml-ng.ocamlPackages_4_14,
}:
let
}: let
rev = "4690dd27717e687b8eba449e44127a53fabe7a2d";
in
ocamlPackages.buildDunePackage {
pname = "necrolib";
version = lib.substring 0 7 rev;
ocamlPackages.buildDunePackage {
pname = "necrolib";
version = lib.substring 0 7 rev;
minimalOCamlVersion = "4.14.1";
minimalOCamlVersion = "4.14.1";
src = fetchFromGitLab {
domain = "gitlab.inria.fr";
owner = "skeletons";
repo = "necro";
inherit rev;
hash = "sha256-FYeVuSUmA6as0oI80uC3wW8l1/AazOPAtiNsnZyUahU=";
};
src = fetchFromGitLab {
domain = "gitlab.inria.fr";
owner = "skeletons";
repo = "necro";
inherit rev;
hash = "sha256-FYeVuSUmA6as0oI80uC3wW8l1/AazOPAtiNsnZyUahU=";
};
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

@ -1,5 +1,7 @@
{ stdenvNoCC, fetchFromGitHub }:
{
stdenvNoCC,
fetchFromGitHub,
}:
stdenvNoCC.mkDerivation rec {
pname = "noto-fonts-cjk-serif";
version = "2.003";
@ -9,7 +11,7 @@ stdenvNoCC.mkDerivation rec {
repo = "noto-cjk";
rev = "Serif${version}";
hash = "sha256-mfbBSdJrUCZiUUmsmndtEW6H3z6KfBn+dEftBySf2j4=";
sparseCheckout = [ "Serif/OTC" ];
sparseCheckout = ["Serif/OTC"];
};
installPhase = ''

View file

@ -2,25 +2,22 @@
lib,
stdenv,
fetchFromGitHub,
}:
let
}: let
rev = "bd2bac08bf01e25846a6643dd30e2acffa9517d4";
in
stdenv.mkDerivation {
pname = "posy-cursor";
version = lib.substring 0 7 rev;
stdenv.mkDerivation {
pname = "posy-cursor";
version = lib.substring 0 7 rev;
src = fetchFromGitHub {
owner = "leana8959";
repo = "posy-improved-cursor-linux";
inherit rev;
hash = "sha256-ndxz0KEU18ZKbPK2vTtEWUkOB/KqA362ipJMjVEgzYQ=";
};
src = fetchFromGitHub {
owner = "leana8959";
repo = "posy-improved-cursor-linux";
inherit rev;
hash = "sha256-ndxz0KEU18ZKbPK2vTtEWUkOB/KqA362ipJMjVEgzYQ=";
};
installPhase = ''
install -dm 0755 $out/share/icons
cp -r Posy_Cursor* $out/share/icons
'';
}
installPhase = ''
install -dm 0755 $out/share/icons
cp -r Posy_Cursor* $out/share/icons
'';
}

View file

@ -6,38 +6,35 @@
libiconv,
darwin,
zlib,
}:
let
}: let
rev = "6392516c47d4573d16886b9fe5f79592b1c70d49";
in
rustPlatform.buildRustPackage {
pname = "tokei";
version = lib.substring 0 7 rev;
rustPlatform.buildRustPackage {
pname = "tokei";
version = lib.substring 0 7 rev;
src = fetchFromGitHub {
owner = "XAMPPRocky";
repo = "tokei";
inherit rev;
hash = "sha256-EYr4K1Bt+74jb85UQ3So0efrOcYAq71/4++kMCSPi1E=";
};
src = fetchFromGitHub {
owner = "XAMPPRocky";
repo = "tokei";
inherit rev;
hash = "sha256-EYr4K1Bt+74jb85UQ3So0efrOcYAq71/4++kMCSPi1E=";
};
cargoHash = "sha256-fdAJwQNJczRqy0KQqse8QRx5+1gZTCBw+kkwgn6UGKU=";
cargoHash = "sha256-fdAJwQNJczRqy0KQqse8QRx5+1gZTCBw+kkwgn6UGKU=";
patches = [
./hledger.patch
./skel.patch
./why3.patch
];
patches = [
./hledger.patch
./skel.patch
./why3.patch
];
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

@ -1,43 +1,39 @@
{
rustPlatform,
fetchFromGitHub,
lib,
}:
let
}: let
rev = "6be5470fcb19e857f76ede9a7f0c96cac63e3abc";
in
rustPlatform.buildRustPackage rec {
pname = "typst-bot";
version = lib.substring 0 8 rev;
rustPlatform.buildRustPackage rec {
pname = "typst-bot";
version = lib.substring 0 8 rev;
src = fetchFromGitHub {
owner = "mattfbacon";
repo = "typst-bot";
inherit rev;
hash = "sha256-G3tcyFiHeVH77YT2NeIXS/U1GvqGJBw8o26AlBUc4ok=";
};
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 fonts with src
# FIXME: is this the right way to patch
substituteInPlace crates/worker/src/sandbox.rs --replace-fail 'read_dir("fonts")' 'read_dir("${src}/fonts")'
# Patch the command calling the worker by name.
substituteInPlace crates/bot/src/worker.rs --replace-fail 'Command::new("./worker")' 'Command::new("worker")'
'';
cargoBuildFlags = [ "--workspace" ];
cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes = {
"poise-0.6.1" = "sha256-AZtF5P7E5xzHJcNdc1k61P2Rr8vIt+oun9vFYSr0nSc=";
src = fetchFromGitHub {
owner = "mattfbacon";
repo = "typst-bot";
inherit rev;
hash = "sha256-G3tcyFiHeVH77YT2NeIXS/U1GvqGJBw8o26AlBUc4ok=";
};
};
}
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 fonts with src
# FIXME: is this the right way to patch
substituteInPlace crates/worker/src/sandbox.rs --replace-fail 'read_dir("fonts")' 'read_dir("${src}/fonts")'
# Patch the command calling the worker by name.
substituteInPlace crates/bot/src/worker.rs --replace-fail 'Command::new("./worker")' 'Command::new("worker")'
'';
cargoBuildFlags = ["--workspace"];
cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes = {
"poise-0.6.1" = "sha256-AZtF5P7E5xzHJcNdc1k61P2Rr8vIt+oun9vFYSr0nSc=";
};
};
}

View file

@ -3,7 +3,6 @@
fetchFromGitHub,
fetchpatch,
}:
rustPlatform.buildRustPackage {
pname = "typst-mutilate";
version = "0.0";

View file

@ -1,66 +1,63 @@
{
fetchPypi,
python3Packages,
}:
let
}: let
pname = "webtoon_downloader";
version = "1.0.1";
in
python3Packages.buildPythonPackage {
inherit pname version;
pyproject = true;
src = fetchPypi {
python3Packages.buildPythonPackage {
inherit pname version;
hash = "sha256-rqgETmNeHycL4Ic5hQ0E3N/b+rMRK/Bx9VwSkbyosIo=";
};
build-system = with python3Packages; [
setuptools
poetry-core
];
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-rqgETmNeHycL4Ic5hQ0E3N/b+rMRK/Bx9VwSkbyosIo=";
};
dependencies = with python3Packages; [
(aiofiles.overridePythonAttrs rec {
version = "23.2.1";
src = fetchPypi {
pname = "aiofiles";
inherit version;
hash = "sha256-hOwiGNhBlASry58MAt8/NMbgpo7UEHKs+xzvXLwpBRo=";
};
})
beautifulsoup4
furl
(httpx.overridePythonAttrs rec {
version = "0.26.0";
src = fetchPypi {
pname = "httpx";
inherit version;
hash = "sha256-RRtVww1RheprI8LHk6v5uyN9Kn37kBztb/aa037B368=";
};
})
h2
(lxml.overridePythonAttrs rec {
version = "4.9.4";
src = fetchPypi {
pname = "lxml";
inherit version;
hash = "sha256-sVQeULeOFfoGomcBV6GWLvBlkdTJmLmYBH//XjI2iA4=";
};
})
(pillow.overridePythonAttrs rec {
version = "10.4.0";
src = fetchPypi {
pname = "pillow";
inherit version;
hash = "sha256-Fmwc1NJDCbMNYfefSpEUt7IxPXRQkSJ3hV/139fNSgY=";
};
})
pymupdf
rich
rich-click
typing-extensions
];
}
build-system = with python3Packages; [
setuptools
poetry-core
];
dependencies = with python3Packages; [
(aiofiles.overridePythonAttrs rec {
version = "23.2.1";
src = fetchPypi {
pname = "aiofiles";
inherit version;
hash = "sha256-hOwiGNhBlASry58MAt8/NMbgpo7UEHKs+xzvXLwpBRo=";
};
})
beautifulsoup4
furl
(httpx.overridePythonAttrs rec {
version = "0.26.0";
src = fetchPypi {
pname = "httpx";
inherit version;
hash = "sha256-RRtVww1RheprI8LHk6v5uyN9Kn37kBztb/aa037B368=";
};
})
h2
(lxml.overridePythonAttrs rec {
version = "4.9.4";
src = fetchPypi {
pname = "lxml";
inherit version;
hash = "sha256-sVQeULeOFfoGomcBV6GWLvBlkdTJmLmYBH//XjI2iA4=";
};
})
(pillow.overridePythonAttrs rec {
version = "10.4.0";
src = fetchPypi {
pname = "pillow";
inherit version;
hash = "sha256-Fmwc1NJDCbMNYfefSpEUt7IxPXRQkSJ3hV/139fNSgY=";
};
})
pymupdf
rich
rich-click
typing-extensions
];
}

View file

@ -5,24 +5,21 @@
cvc4,
z3_4_12,
alt-ergo,
}:
let
}: let
provers = [
alt-ergo
cvc4
z3_4_12
];
in
symlinkJoin {
name = "why3";
# Generate configuration in the store, and wrap why3 with the corresponding option
paths = [ (why3.override { version = "1.6.0"; }) ];
buildInputs = provers;
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
$out/bin/why3 config detect --config=$out/why3.conf
wrapProgram $out/bin/why3 --add-flags "--config=$out/why3.conf"
'';
}
symlinkJoin {
name = "why3";
# Generate configuration in the store, and wrap why3 with the corresponding option
paths = [(why3.override {version = "1.6.0";})];
buildInputs = provers;
nativeBuildInputs = [makeWrapper];
postBuild = ''
$out/bin/why3 config detect --config=$out/why3.conf
wrapProgram $out/bin/why3 --add-flags "--config=$out/why3.conf"
'';
}

View file

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