ref(nix): formatted with nixfmt-rfc-style

This commit is contained in:
Léana 江 2024-03-30 21:08:07 +01:00 committed by Léana 江
parent 36a2265325
commit 23404db605
40 changed files with 574 additions and 474 deletions

View file

@ -3,27 +3,33 @@
unstable,
opam-nix,
alt-ergo,
}: let
mkNerdFont = callPackage ./mkNerdFont.nix {inherit (unstable) nerd-font-patcher;};
}:
let
mkNerdFont = callPackage ./mkNerdFont.nix { inherit (unstable) nerd-font-patcher; };
logisim-evolution = callPackage ./logisim-evolution.nix {};
logisim-evolution = callPackage ./logisim-evolution.nix { };
necrolib = callPackage ./necrolib.nix {
inherit opam-nix;
};
necrolib = callPackage ./necrolib.nix { inherit opam-nix; };
hiosevka = callPackage ./hiosevka {};
hiosevka = callPackage ./hiosevka { };
hiosevka-nerd-font-mono = mkNerdFont {
font = hiosevka;
extraArgs = ["--name {/.}-NFM" "--use-single-width-glyphs"];
extraArgs = [
"--name {/.}-NFM"
"--use-single-width-glyphs"
];
};
hiosevka-nerd-font-propo = mkNerdFont {
font = hiosevka;
extraArgs = ["--name {/.}-NFP" "--variable-width-glyphs"];
extraArgs = [
"--name {/.}-NFP"
"--variable-width-glyphs"
];
};
why3 = callPackage ./why3.nix {inherit alt-ergo;};
in {
why3 = callPackage ./why3.nix { inherit alt-ergo; };
in
{
myPkgs = {
inherit
logisim-evolution
@ -36,8 +42,6 @@ in {
};
myLib = {
inherit
mkNerdFont
;
inherit mkNerdFont;
};
}

View file

@ -1,14 +1,13 @@
{iosevka}: let
{ iosevka }:
let
pname = "hiosevka";
in
(iosevka.overrideAttrs (_: {inherit pname;}))
.override {
set = pname;
/*
Guide: https://github.com/be5invis/Iosevka/blob/main/doc/custom-build.md
(iosevka.overrideAttrs (_: { inherit pname; })).override {
set = pname;
/* 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
*/
privateBuildPlan = builtins.readFile ./buildplan.toml;
}
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

@ -2,35 +2,46 @@
nerd-font-patcher,
parallel,
stdenvNoCC,
}: {
}:
{
font,
extraArgs ? [],
extraArgs ? [ ],
useDefaultsArgs ? true,
}:
stdenvNoCC.mkDerivation {
/*
Credits:
https://github.com/NixOS/nixpkgs/issues/44329#issuecomment-1231189572
https://github.com/NixOS/nixpkgs/issues/44329#issuecomment-1544597422
/* Credits:
https://github.com/NixOS/nixpkgs/issues/44329#issuecomment-1231189572
https://github.com/NixOS/nixpkgs/issues/44329#issuecomment-1544597422
long font names is not problematic:
https://github.com/ryanoasis/nerd-fonts/issues/1018#issuecomment-1953555781
long font names is not problematic:
https://github.com/ryanoasis/nerd-fonts/issues/1018#issuecomment-1953555781
*/
name = "${font.name}-NerdFont";
src = font;
nativeBuildInputs = [nerd-font-patcher parallel];
nativeBuildInputs = [
nerd-font-patcher
parallel
];
buildPhase = let
args = builtins.concatStringsSep " " extraArgs;
defArgs =
if useDefaultsArgs
then builtins.concatStringsSep " " ["--careful" "--complete" "--quiet" "--no-progressbars"]
else "";
in ''
mkdir -p nerd-font
find \( -name \*.ttf -o -name \*.otf \) | parallel nerd-font-patcher {} \
--outputdir nerd-font ${defArgs} ${args}
'';
buildPhase =
let
args = builtins.concatStringsSep " " extraArgs;
defArgs =
if useDefaultsArgs then
builtins.concatStringsSep " " [
"--careful"
"--complete"
"--quiet"
"--no-progressbars"
]
else
"";
in
''
mkdir -p nerd-font
find \( -name \*.ttf -o -name \*.otf \) | parallel nerd-font-patcher {} \
--outputdir nerd-font ${defArgs} ${args}
'';
installPhase = ''
exists() { [ -e "$1" ]; }

View file

@ -3,7 +3,8 @@
opam-nix,
system,
version ? "v0.14.7.1",
}: let
}:
let
pname = "necrolib";
hashes = {
@ -17,14 +18,16 @@
};
on = opam-nix.lib.${system};
query = {ocaml-base-compiler = "4.14.1";};
query = {
ocaml-base-compiler = "4.14.1";
};
scope = on.buildDuneProject {} pname src query;
scope = on.buildDuneProject { } pname src query;
overlay = self: super: {
# credits: balsoft
# https://github.com/tweag/opam-nix/discussions/71#discussioncomment-8344504
necrolib = super.necrolib.overrideAttrs (oa: {inherit src;});
necrolib = super.necrolib.overrideAttrs (oa: { inherit src; });
};
in
(scope.overrideScope' overlay).${pname}
(scope.overrideScope' overlay).${pname}

View file

@ -5,23 +5,22 @@
alt-ergo,
cvc4,
z3_4_12,
}: 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"
'';
}