Skip to content

Commit

Permalink
chore: Update gh-md-toc
Browse files Browse the repository at this point in the history
Also fix the package with resholve.
  • Loading branch information
jtojnar committed May 19, 2024
1 parent 564bbca commit e808a8a
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 15 deletions.
2 changes: 1 addition & 1 deletion nix/pkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ let
};
in
{
inherit pkgs hp;
inherit pkgs hp sources;
}
56 changes: 42 additions & 14 deletions nix/toc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,54 @@

let
packages = import ./pkgs.nix { inherit compiler; };
inherit (packages) pkgs;
inherit (packages) pkgs sources;

toc = pkgs.stdenv.mkDerivation {
name = "gh-md-toc-24-05-2020";
toc = pkgs.resholve.mkDerivation {
pname = "gh-md-toc";
version = sources.github-markdown-toc.version;

src = builtins.fetchurl {
url = "https://raw.githubusercontent.com/ekalinin/github-markdown-toc/488f310064b16c1eb9c17862cc5844189ee65955/gh-md-toc";
sha256 = "1253n0qw3xgikl7gcdicg3vmc3wzz6122bmhmffj1irrachq89fi";
};
src = sources.github-markdown-toc;

phases = [
"installPhase"
"patchPhase"
];
dontConfigure = true;
dontBuild = true;

installPhase = ''
mkdir -p $out/bin
cp $src $out/bin/gh-md-toc
chmod +x $out/bin/gh-md-toc
runHook preInstall
mkdir -p "$out/bin"
cp gh-md-toc "$out/bin/gh-md-toc"
chmod +x "$out/bin/gh-md-toc"
runHook postInstall
'';

solutions = {
default = {
scripts = [ "bin/gh-md-toc" ];
interpreter = "${pkgs.bash}/bin/bash";
inputs = [
pkgs.bash
pkgs.coreutils
pkgs.curl
pkgs.gawk
pkgs.gnugrep
pkgs.gnused
# which
];
fix = {
"$grepcmd" = [ "grep" "-Eo" ];
"$SHELL" = [ "bash" ];
};
keep = {
"$tool" = true;
};
fake = {
external = [
"wget"
];
};
};
};
};
in
pkgs.writeShellScriptBin "update-toc" ''
Expand Down
15 changes: 15 additions & 0 deletions npins/sources.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
{
"pins": {
"github-markdown-toc": {
"type": "GitRelease",
"repository": {
"type": "GitHub",
"owner": "ekalinin",
"repo": "github-markdown-toc"
},
"pre_releases": false,
"version_upper_bound": null,
"release_prefix": null,
"version": "0.10.0",
"revision": "7d0a86b3be2e8e959cd9747fcf2c4a1f0e6a24eb",
"url": "https://api.github.com/repos/ekalinin/github-markdown-toc/tarball/0.10.0",
"hash": "14gnj1pwbscs0bj1wkzc342r0v1d5ib4c8bizyqg5djkl4j3rlzh"
},
"nixpkgs": {
"type": "Channel",
"name": "nixos-unstable",
Expand Down

0 comments on commit e808a8a

Please sign in to comment.