citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

commit f636211fc4b64ff9ac40b30c074a579de16edb82
parent e039627bed2c3f3b656ca4331ebf2b3accf4a3f1
Author: William Casarin <jb55@jb55.com>
Date:   Thu,  5 Nov 2020 12:08:57 -0800

add jb55pkgs

Diffstat:
Ajb55pkgs/default.nix | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ajb55pkgs/pkgs/csv-delim/default.nix | 16++++++++++++++++
Ajb55pkgs/pkgs/csv-scripts/default.nix | 27+++++++++++++++++++++++++++
Ajb55pkgs/pkgs/curlc/default.nix | 7+++++++
Ajb55pkgs/pkgs/dbopen/default.nix | 19+++++++++++++++++++
Ajb55pkgs/pkgs/extname/default.nix | 21+++++++++++++++++++++
Ajb55pkgs/pkgs/mandown/default.nix | 33+++++++++++++++++++++++++++++++++
Ajb55pkgs/pkgs/ratio/default.nix | 6++++++
Ajb55pkgs/pkgs/samp/default.nix | 16++++++++++++++++
Ajb55pkgs/pkgs/sharefile/default.nix | 40++++++++++++++++++++++++++++++++++++++++
Ajb55pkgs/readme.md | 14++++++++++++++
11 files changed, 264 insertions(+), 0 deletions(-)

diff --git a/jb55pkgs/default.nix b/jb55pkgs/default.nix @@ -0,0 +1,65 @@ +{ pkgs ? import <nixpkgs> {} }: +let callPackage = pkgs.callPackage; + callHsPackage = pkgs.haskellPackages.callPackage; + fetch = rest: args: callPackage (pkgs.fetchFromGitHub ({ + owner = "jb55"; + } // rest)) args; +in rec { + curlc = callPackage ./pkgs/curlc {}; + csv-delim = callPackage ./pkgs/csv-delim { }; + csv-scripts = callPackage ./pkgs/csv-scripts { inherit csv-delim; }; + dbopen = callPackage ./pkgs/dbopen { }; + extname = callPackage ./pkgs/extname { }; + mandown = callPackage ./pkgs/mandown { }; + sharefile = callPackage ./pkgs/sharefile { }; + samp = callPackage ./pkgs/samp { }; + ratio = callPackage ./pkgs/ratio { }; + + cmdtree = fetch { + repo = "cmdtree"; + rev = "854d8d624fa55f1d86acddcfc81b30214a5fc727"; # use my config + sha256 = "06a9zgnysv1bdfng2mzk02ifxs7q5i8gh04z950v48xnm26da1pa"; + } {}; + + zoom-link-opener = fetch { + repo = "zoom-link-opener"; + rev = "0.1.1"; + sha256 = "013q814i7wcbl2ba5jpqkz00kpa1jaly53np30i4x01cfdfzywi3"; + } {}; + + zebra = fetch { + repo = "zebra"; + rev = "0.1"; + sha256 = "1l7rfjwnjc28zszbrzjqsgyp47hkl355is8zshfgv3wacb7n6424"; + } {}; + + viscal = fetch { + repo = "viscal"; + rev = "0.0.1"; + sha256 = "0kisxf6m1xvll8xj54rl3lr07aq3l0gizix5axp9hkawss0b55sa"; + } {}; + + datefmt = fetch { + repo = "datefmt"; + rev = "0.1.1"; + sha256 = "1xjfr1lbkiy277firlb8zkg1pmj7pmiijhxx1z4bg41970dr446x"; + } {}; + + btcs = fetch { + repo = "btcs"; + rev = "0.1"; + sha256 = "1ls4wr7ii6icr43z3n49pm1z11sdxv06g799ww8pvxv1ax7aysl6"; + } {}; + + snap = fetch { + repo = "sharefile-snap"; + rev = "1.3"; + sha256 = "0j8j2588z09v7zz1f9d11zw2n0wq70sxy9lvwrw4l5yz75n3cral"; + } {}; + + bcalc = fetch { + repo = "bcalc"; + rev = "5a51083ec33883d3fec3c74cb0891b317f4d1f35"; + sha256 = "1mdkpd8rc5y4a4j0mwv7mkfd58a43mpxkxhrjlkkmcf2nngvqi0j"; + } {}; +} diff --git a/jb55pkgs/pkgs/csv-delim/default.nix b/jb55pkgs/pkgs/csv-delim/default.nix @@ -0,0 +1,16 @@ +{ stdenv +, fetchFromGitHub +}: +stdenv.mkDerivation rec { + name = "csv-delim-${version}"; + version = "0.1.3"; + + src = fetchFromGitHub { + owner = "jb55"; + repo = "csv-delim"; + rev = "fe87ed0a81576fd31610a29437d66518625b04b7"; + sha256 = "1pmdbp3lprcy9xf55h8mgy5pwh7ryf9fc2gnjiqjs5mn8acmri5q"; + }; + + makeFlags = "PREFIX=$(out)"; +} diff --git a/jb55pkgs/pkgs/csv-scripts/default.nix b/jb55pkgs/pkgs/csv-scripts/default.nix @@ -0,0 +1,27 @@ +{ stdenv +, fetchFromGitHub +, csv-delim +, bc +}: +stdenv.mkDerivation rec { + name = "csv-scripts-${version}"; + version = "0.2.6"; + + buildInputs = [ csv-delim bc ]; + + src = fetchFromGitHub { + owner = "jb55"; + repo = "csv-scripts"; + rev = version; + sha256 = "1w5jf0w376kmaqpy59lw32z1lawh5ak7b0lf79bbslg8ccwb8y7r"; + }; + + patchPhase = '' + for file in "bin/"*; do + sed -i 's,csv-delim,${csv-delim}/bin/csv-delim,g' "$file" + done; + sed -i 's,bc,${bc}/bin/bc,' bin/csv-sum + ''; + + makeFlags = "PREFIX=$(out)"; +} diff --git a/jb55pkgs/pkgs/curlc/default.nix b/jb55pkgs/pkgs/curlc/default.nix @@ -0,0 +1,7 @@ +{ callPackage, fetchFromGitHub }: +callPackage (fetchFromGitHub { + owner = "jb55"; + repo = "curlc"; + rev = "c8251c0c712fcb373ab4d7b9c990d2f815f48ede"; + sha256 = "18mxxpxdnlcmingn8qi4ynnn7f19ismhxh5ns208pfgxj742rv5w"; +}) {} diff --git a/jb55pkgs/pkgs/dbopen/default.nix b/jb55pkgs/pkgs/dbopen/default.nix @@ -0,0 +1,19 @@ +{ stdenv +, python +, fetchFromGitHub +}: +stdenv.mkDerivation rec { + name = "dbopen-${version}"; + version = "1.3"; + buildInputs = [ python ]; + + src = fetchFromGitHub { + rev = version; + owner = "jb55"; + repo = "dbopen"; + sha256 = "0w613z08pzkw2216f2zniqrp1zcc8r9wis6f1bhd1xbzlh0q5mkj"; + }; + + configurePhase = "mkdir -p $out/bin"; + makeFlags = "PREFIX=$(out)"; +} diff --git a/jb55pkgs/pkgs/extname/default.nix b/jb55pkgs/pkgs/extname/default.nix @@ -0,0 +1,21 @@ +{ stdenv, fetchFromGitHub }: +stdenv.mkDerivation rec { + name = "extname-${version}"; + version = "1.1.1"; + + src = fetchFromGitHub { + rev = version; + owner = "jb55"; + repo = "extname"; + sha256 = "10l0p6q1qlx8ihmpycf6p26kx2rcb1l7rp92smv05gmxb7fznw1q"; + }; + + makeFlags = "PREFIX=$(out)"; + + meta = with stdenv.lib; { + description = "Utility to get file extensions from its arguments"; + homepage = "https://github.com/jb55/extname"; + maintainers = with maintainers; [ jb55 ]; + license = licenses.mit; + }; +} diff --git a/jb55pkgs/pkgs/mandown/default.nix b/jb55pkgs/pkgs/mandown/default.nix @@ -0,0 +1,33 @@ +{ stdenv +, makeWrapper +, pandoc +, fetchFromGitHub +, man +}: +stdenv.mkDerivation rec { + name = "mandown-${version}"; + version = "0.9.0"; + + src = fetchFromGitHub { + rev = "5a26782ad935e4316f1d99e185d385750c5bc5cb"; + owner = "jb55"; + repo = "mandown"; + sha256 = "0mb06gbbi3ah026sffh3jcjny7b6g4acx2bp4b4kdjp4kq0ihy66"; + }; + + makeFlags = "PREFIX=$(out)"; + + buildInputs = [ pandoc man makeWrapper ]; + + meta = with stdenv.lib; { + description = "Render markdown as a manpage"; + homepage = "https://github.com/jb55/mandown"; + maintainers = with maintainers; [ jb55 ]; + license = licenses.gpl2; + }; + + installPhase = '' + wrapProgram "$out/bin/mandown" \ + --prefix PATH : "${man}/bin:${pandoc}/bin" + ''; +} diff --git a/jb55pkgs/pkgs/ratio/default.nix b/jb55pkgs/pkgs/ratio/default.nix @@ -0,0 +1,6 @@ +{ callPackage, fetchgit }: +callPackage (fetchgit { + url = git://git.jb55.com/ratio; + rev = "c6e99cf4336785ee4f3ef6b97a9562aa6944a2c8"; + sha256 = "12r80ad9r4l4vsmc6dczcjn93wp7awfs4y1r0yagvmwdqnk96lpv"; +}) {} diff --git a/jb55pkgs/pkgs/samp/default.nix b/jb55pkgs/pkgs/samp/default.nix @@ -0,0 +1,16 @@ +{ stdenv +, fetchFromGitHub +}: +stdenv.mkDerivation rec { + name = "samp-${version}"; + version = "0.0.3"; + + src = fetchFromGitHub { + owner = "jb55"; + repo = "samp"; + rev = version; + sha256 = "1xdbjmz611f5x9slcavb27axivww8l6r0p06vf9i9i9sikwsc5p5"; + }; + + makeFlags = "PREFIX=$(out)"; +} diff --git a/jb55pkgs/pkgs/sharefile/default.nix b/jb55pkgs/pkgs/sharefile/default.nix @@ -0,0 +1,40 @@ +{ stdenv +, perlPackages +, makeWrapper +, perl +, rsync +, coreutils +, openssh +, fetchFromGitHub +}: +let + inputs = [ perl perlPackages.URI rsync openssh coreutils ]; + buildPaths = sep: fmt: "${stdenv.lib.concatStringsSep sep (map fmt inputs)}"; +in stdenv.mkDerivation rec { + name = "sharefile-${version}"; + version = "1.2"; + buildInputs = [ makeWrapper ] ++ inputs; + + src = fetchFromGitHub { + rev = version; + owner = "jb55"; + repo = "sharefile"; + sha256 = "0cvw2hakxsjmpn5frfxp38jpc94knq0lfrzqhpv1xah6l83cb4vy"; + }; + + installPhase = '' + mkdir -p $out/bin + + cp sharefile $out/bin + cp share_last_ss $out/bin + cp hashname $out/bin + cp hashshare $out/bin + + for prog in $(echo "$out/bin/"*) + do + wrapProgram "$prog" \ + --prefix PERL5LIB : "$PERL5LIB" \ + --prefix PATH : "${buildPaths ":" (f: "${f}/bin")}" + done + ''; +} diff --git a/jb55pkgs/readme.md b/jb55pkgs/readme.md @@ -0,0 +1,14 @@ + +# jb55pkgs + + A nix repository for some of my utilities, libraries, etc + +## Querying + + Query the repo + + $ nix-env -f https://jb55.com/pkgs -qaP + +## Installing packages + + $ nix-env -f https://jb55.com/pkgs -iA mandown