Add lots of packages

This commit is contained in:
Oystein Kristoffer Tveit 2022-11-12 19:31:11 +01:00
parent 119dec9f1b
commit 33cc05e0c1
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
18 changed files with 756 additions and 3 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
result
result-man
result-doc

34
README.md Normal file
View File

@ -0,0 +1,34 @@
# WIP Nix packages
This is a repo where I temporarily put all the nix packages I am working on.
Note that:
- This is my personal repo where I put WIP stuff. It is not indended for use by anyone else.
- The git commits of this repo has no good structure. I will rather copy the files directly and make new commits in nixpkgs. Most commits are temprorary commits.
- Many of the packages does not build.
You are free to copy any build instructions you like.
## Overview of package status:
| Name | Building | Added to Nixpkgs | TODO |
|---|---|---|---|
| `ani-cli` | V | V | Already added to nixpkgs by another person |
| `ankiTab` | X | X | Need start the package config. |
| `ark-pixel-font` | X | X | This library depends on a html-minifying library that has bindings for several langauges. I am a little unsure of how to package this properly. |
| `bdfr` | X | X | Needs to finish package config. |
| `boomer` | X | X | Research nixpkgs nim infrastructure |
| `ddh` | X | X | Missing Cargo.lock |
| `epy` | X | X | Need start the package config. |
| `fcitx5-material-color` | V | X | Cannot get fcitx5 to work, in order to test the package. |
| `git-mirror` | X: | X | https://github.com/alexcrichton/openssl-src-rs/pull/162 |
| `koneko` | V | X | Open a PR |
| `nuber` | X | X | Cannot build project. https://github.com/mtshrmn/nuber/issues/7 |
| `rofi-lpass` | X | X | Need start the package config. |
| `rsnake` | X | X | Some opengl trouble? |
| `scdl` | V | V | Already added to nixpkgs by another person |
| `simplicity studio` | V | X | Needs more testing. This probably needs to go into an FHS env, to support plugins properly |
| `super-tiny-icons` | V | X | PR is open, waiting for approval |
| `xiu` | X | X | Missing Cargo.lock |

View File

@ -8,12 +8,31 @@
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) lib; inherit (pkgs) lib;
in { in {
overlays.default = new: old: old // self.packages.${system}; overlays.default = final: prev: prev // self.packages.${system};
packages.${system} = {}; packages.${system} = let
inherit (pkgs) callPackage;
in rec {
ani-cli = callPackage ./pkgs/ani-cli {};
ark-pixel-font = callPackage ./pkgs/ark-pixel-font {};
ddh = callPackage ./pkgs/ddh {};
fcitx5-material-color = callPackage ./pkgs/fcitx5-material-color {};
git-mirror = callPackage ./pkgs/git-mirror {};
koneko = callPackage ./pkgs/koneko {};
nuber = callPackage ./pkgs/nuber {};
rsnake = callPackage ./pkgs/rsnake {};
scdl = callPackage ./pkgs/scdl (pkgs.python310Packages // { inherit soundcloud-v2; });
simplicity-studio-5 = pkgs.libsForQt5.callPackage ./pkgs/simplicity-studio-5 {};
soundcloud-v2 = callPackage ./pkgs/soundcloud-v2 pkgs.python310Packages;
super-tiny-icons = callPackage ./pkgs/super-tiny-icons {};
xiu = callPackage ./pkgs/xiu {};
};
hydraJobs = {}; hydraJobs = lib.mapAttrs'
(name: value: lib.nameValuePair name { ${system} = value; })
self.packages.${system};
}; };
} }

57
pkgs/ani-cli/default.nix Normal file
View File

@ -0,0 +1,57 @@
{ pkgs, lib, stdenvNoCC, fetchFromGitHub, ffmpeg, mpv }:
stdenvNoCC.mkDerivation rec {
pname = "ani-cli";
version = "3.4";
src = fetchFromGitHub {
owner = "pystardust";
repo = "ani-cli";
rev = "v${version}";
sha256 = "Xb7MNL7YKbvyRR5ZppUfCYeYpjNAiJWNOjIFk5fUvpY=";
};
outputs = ["out" "man" "doc"];
buildInputs = [
mpv
ffmpeg
];
buildPhase = ''
runHook preBuild
cp $src/ani-cli .
sed -i -e "s|ffmpeg|${ffmpeg}/bin/ffmpeg|" \
-e "s|mpv|${mpv}/bin/mpv|" \
ani-cli
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm755 -t $out/bin ani-cli
install -Dm644 ani-cli.1.gz $man/share/man/man1/ani-cli.1.gz
install -Dm644 -t $doc/share/doc/ani-cli/ \
CONTRIBUTING.md \
disclaimer.md \
LICENSE \
README.md
runHook postInstall
'';
meta = with lib; {
description = "A cli tool to browse and play anime";
longDescription = ''
A cli to browse and watch anime (alone AND with friends).
This tool scrapes the site animixplay.
'';
homepage = "https://github.com/pystardust/ani-cli";
license = licenses.gpl3;
maintainers = [ maintainers.h7x4 ];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,40 @@
{ lib, stdenvNoCC, python3Packages, fetchFromGitHub }:
stdenvNoCC.mkDerivation rec {
pname = "ark-pixel-font";
version = "2022.11.11";
src = fetchFromGitHub {
owner = "TakWolf";
repo = pname;
rev = version;
sha256 = "KCYXKPu0DoEQ+QCPUn9yODiBqW3H7YtiHHhct8bT0JA=";
};
nativeBuildInputs = with python3Packages; [
python
beautifulsoup4
brotli
fonttools
gitdb
GitPython
jinja2
markupsafe
# minify_html
pillow
pypng
smmap
soupsieve
];
buildPhase = ''
python build.py
'';
meta = with lib; {
homepage = "https://github.com/TakWolf/ark-pixel-font";
description = "Open source Pan-CJK pixel font";
license = with licenses; [ mit ofl ];
maintainers = with maintainers; [ h7x4 ];
};
}

48
pkgs/bdfr/default.nix Normal file
View File

@ -0,0 +1,48 @@
{ pkgs ? import <nixpkgs> }: let
p = pkgs.python39Packages;
in p.buildPythonApplication rec {
pname = "bulk-downloader-for-reddit";
version = "2.5.2";
src = p.fetchPypi {
pname = "bdfr";
inherit version;
sha256 = "3+5bShEytO/M7tX0RMUYrQdTjrolP1+vDM9JifrZ+hk="; # TODO
};
# src = pkgs.fetchFromGitHub {
# owner = "aliparlakci";
# repo = "bulk-downloader-for-reddit";
# rev = "v2.5.2";
# sha256 = "Q5kWlWzAm7a3DhsRNyGdtyELnVH8LMNNLPEOrYog4W0=";
# };
patchPhase = ''
sed -i "s/bs4>=0.0.1/beautifulsoup4>=4.11/g" requirements.txt
'';
buildInputs = with p; [
pytest
];
propagatedBuildInputs = with p; [
appdirs
beautifulsoup4
dict2xml
pbr
praw
pyyaml
yt-dlp
ffmpeg-python
click
requests
];
postInstall = ''
mkdir -p $out/bin
echo "python -m bdfr" > $out/bin/bdfr
chmod +x $out/bin/bdfr
'';
# shellHook = ''
# ls
# '';
}

25
pkgs/ddh/default.nix Normal file
View File

@ -0,0 +1,25 @@
{ lib, fetchFromGitHub, rustPlatform, ... }:
rustPlatform.buildRustPackage rec {
pname = "ddh";
version = "0.12.0";
src = fetchFromGitHub {
owner = "darakian";
repo = pname;
rev = version;
sha256 = "BttBEbGzN2z/Dasr7DZUucXCn3tsIDugdFRmqssL4PE=";
};
cargoSha256 = "";
meta = with lib; {
description = "A fast duplicate file finder";
longDescription = ''
DDH traverses input directories and their subdirectories.
It also hashes files as needed and reports findings.
'';
homepage = "https://github.com/darakian/ddh";
license = licenses.unlicense;
maintainers = [ maintainers.tailhook ];
};
}

View File

@ -0,0 +1,49 @@
{
lib,
stdenvNoCC,
fetchFromGitHub
}:
stdenvNoCC.mkDerivation rec {
pname = "fcitx5-material-color";
version = "0.2.1";
src = fetchFromGitHub {
owner = "hosxy";
repo = "Fcitx5-Material-Color";
rev = "${version}";
sha256 = "i9JHIJ+cHLTBZUNzj9Ujl3LIdkCllTWpO1Ta4OT1LTc=";
};
outputs = [ "out" "doc" ];
installPhase = ''
runHook preInstall
install -Dm644 -t $out/usr/share/fcitx5/themes/fcitx5-material-color radio.png arrow.png
find $src -type f -name 'theme*.conf' \
-exec install -Dm644 -t $out/usr/share/fcitx5/themes/fcitx5-material-color {} +
find $src/screenshot -type f \
-exec install -Dm644 -t $doc/usr/share/doc/fcitx5/themes/fcitx5-material-color {} +
install -Dm644 -t $doc/usr/share/doc/fcitx5/themes/fcitx5-material-color \
LICENSE \
README.md
runHook postInstall
'';
meta = with lib; {
description = "";
longDescription = ''
A fcitx5 skin with colors from Material Design.
Designed to mimick the interface of the Windows 10 IME.
'';
homepage = "https://github.com/hosxy/Fcitx5-Material-Color";
license = licenses.asl20;
maintainers = [ maintainers.h7x4 ];
platforms = platforms.all;
};
}

View File

@ -0,0 +1,37 @@
{
pkg-config,
cmake,
rustPlatform,
fetchFromGitHub,
lib,
openssl
}:
rustPlatform.buildRustPackage rec {
pname = "git-mirror";
version = "0.14.6";
src = fetchFromGitHub {
owner = "bachp";
repo = "git-mirror";
rev = "v${version}";
sha256 = "sha256-jF4KvMrC2+SIt45HgcHKy1jNOYmSb0vBC6iMQ5x8M78=";
};
cargoSha256 = "sha256-lHIOZBUq5wH/J4f/CZwzbXdEGkWUPoz323czAaJes6Q=";
nativeBuildDependencies = [ cmake pkg-config ];
buildDependencies = [ openssl ];
OPENSSL_DIR = "${openssl}/";
RUST_BACKTRACE="1";
meta = with lib; {
description = "A small utility that allows to mirror external repositories to GitLab, GitHub and possible more";
homepage = "https://github.com/${owner}/${repo}";
license = licenses.mit;
# maintainers = with maintainers; [ h7x4 ];
platforms = platforms.unix;
changelog = "https://github.com/${owner}/${repo}/blob/v${version}/CHANGELOG.md";
};
}

27
pkgs/koneko/default.nix Normal file
View File

@ -0,0 +1,27 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "koneko";
version = "1.0";
src = fetchFromGitHub {
owner = "irevenko";
repo = "koneko";
rev = "e6c3f62";
sha256 = "5QMqlZrGEzGwmIr3cB3N12A/bYwoRs94bmPnkIUWOZ8=";
};
vendorSha256 = "m3k/f2W+aLUf67c0WmTIN2Ym+K+/DoYe4shau8ccOE4=";
# runVend = true;
outputs = [ "out" ];
meta = with lib; {
description = "nyaa.si terminal BitTorrent tracker";
longDescription = "Download Anime, Literature, Audio, Live Action, Pictures, Software and more!";
homepage = "https://github.com/irevenko/koneko";
license = licenses.mit;
maintainers = [ maintainers.h7x4 ];
platforms = platforms.linux;
};
}

45
pkgs/nuber/default.nix Normal file
View File

@ -0,0 +1,45 @@
{ rustPlatform, lib, fetchFromGitHub, pythonPackages, ... }:
pythonPackages.buildPythonPackage rec {
pname = "nuber";
version = "1.1.0";
src = fetchFromGitHub {
owner = "mtshrmn";
repo = pname;
rev = "v${version}";
sha256 = "yjVu3GwdyiGKVRlETeLT0ww8ftvPRobJYzvesoPxrRo=";
fetchSubmodules = true;
};
cargoDeps = rustPlatform.importCargoLock {
lockFile = "${src}/Cargo.lock";
};
nativeBuildInputs = with rustPlatform; [
cargoSetupHook
maturinBuildHook
];
# preBuild = ''
# # cp ${src}/
# # # avoid ENOENT in maturinBuildHook
# # touch wheel/Cargo.lock
# '';
propagatedBuildInputs = with pythonPackages; [
ueberzug
appdirs
click
# toml
];
# no tests implemented
doCheck = false;
meta = with lib; {
description = "Epub terminal reader with inline images";
longDescription = ''
'';
maintainers = [];
};
}

24
pkgs/rsnake/default.nix Normal file
View File

@ -0,0 +1,24 @@
{ lib, fetchFromGitHub, rustPlatform, xorg, ... }:
rustPlatform.buildRustPackage rec {
pname = "rsnake";
version = "1.0";
src = fetchFromGitHub {
owner = "mara214";
repo = pname;
rev = "v${version}";
sha256 = "ZRr253pp7HElwArxqNlAIYg0ksIvSRWVE2YDwC9/6y8=";
};
cargoSha256 = "HsAW1Az6R30xgRtM+lkIW81HdQUQa/X2my4VetwqxOc=";
buildInputs = [ xorg.libX11 ];
meta = with lib; {
description = "Snake implemented in rust";
homepage = "https://github.com/BurntSushi/ripgrep";
license = licenses.mit;
platforms = platforms.linux;
maintainers = [ maintainers.h7x4 ];
};
}

55
pkgs/scdl/default.nix Normal file
View File

@ -0,0 +1,55 @@
{
lib,
buildPythonPackage,
fetchPypi,
docopt,
mutagen,
termcolor,
requests,
clint,
pathvalidate,
soundcloud-v2,
...
}:
buildPythonPackage rec {
pname = "scdl";
version = "2.7.3";
src = fetchPypi {
inherit pname version;
sha256 = "YChLewWAQNSEfy5LCrkGsQ6VnVH5dqAYhkHo4QaFR08=";
};
propagatedBuildInputs = [
docopt
mutagen
termcolor
requests
clint
pathvalidate
soundcloud-v2
];
outputs = [ "out" "doc" ];
postInstall = ''
install -Dm644 -t $doc/share/doc/scdl/ \
AUTHORS \
LICENSE \
README.md \
scdl/scdl.cfg
'';
meta = with lib; {
description = "Soundcloud Music Downloader";
longDescription = ''
This script is able to download music from SoundCloud and set id3tag to the downloaded music.
Compatible with Windows, OS X, Linux.
'';
homepage = "https://github.com/flyingrub/scdl";
license = licenses.gpl2;
maintainers = [ maintainers.h7x4 ];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,166 @@
{ alsa-lib
, atk
, autoPatchelfHook
, bzip2
, cairo
, fontconfig
, freetype
, gcc
, gdk-pixbuf
, glib
, glibc
, gtk3
, jdk
, lib
, libX11
, libXrender
, libXtst
, libglvnd
, libsecret
, libsoup
, libusb-compat-0_1
, makeDesktopItem
, ncurses5
, openssl
, pango
, patchelf
, pkg-config
, qtbase
, readline
, stdenv
, swt
, webkitgtk
, wine
, wrapQtAppsHook
, zlib
}:
let
installationDir = "$out/opt";
desktopItem = makeDesktopItem {
name = "Simplicity Studio";
desktopName = "Simplicity Studio";
# exec = "${installationDir}/studio";
# icon = "${installationDir}/icon.xpm";
type = "Application";
terminal = false;
categories = [ "Development" "IDE" ];
};
in
stdenv.mkDerivation rec {
pname = "simplicity-studio-5";
version = "5.0.0";
# rev = "cbe903e7f8839794fbe572ea4c811e2c802a4038";
src = builtins.fetchTarball {
url = "https://www.silabs.com/documents/login/software/SimplicityStudio-5.tgz";
sha256 = "0b23w7fnnipn78kvi921588sa1ckl9v2jbgnn3ywhcx3nnbsxlg4";
};
buildInputs = [
alsa-lib
bzip2.out
gcc
gdk-pixbuf
glib
gtk3
libXtst
libusb-compat-0_1
ncurses5
openssl
qtbase
readline
webkitgtk
wine
swt
];
nativeBuildInputs = [
wrapQtAppsHook
autoPatchelfHook
pkg-config
];
# configurePhase = ''
# cmake .
# '';
# buildPhase = ''
# make
# '';
dontWrapQtApps = true;
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r $src/ ${installationDir}
mkdir -p $out/bin
# patchelf --set-interpreter ${glibc.out}/lib/ld-linux*.so.2 $out/opt/studio
makeWrapper $out/opt/studio $out/bin/studio \
"''${qtWrapperArgs[@]}" \
--prefix PATH : ${jdk}/bin \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
--prefix CLASSPATH : "$out/opt/plugins/" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ gtk3 libXtst webkitgtk swt freetype fontconfig libX11 libXrender zlib glib cairo libsoup atk gdk-pixbuf pango libglvnd libsecret ]}"
find $src/StudioLinux/ -type f -name '*.rules' -exec install -Dm644 -t $out/lib/udev/rules.d/ {} +
find ${desktopItem}/share/applications/ -type f -name '*.desktop' -exec install -Dm644 -t $out/usr/share/applications {} +
mkdir -p $out/lib
ln -s ${openssl.out}/lib/libcrypto.so $out/lib/libcrypto.so.1.0.0
ln -s ${openssl.out}/lib/libssl.so $out/lib/libssl.so.1.0.0
ln -s ${bzip2.out}/lib/libbz2.so.1 $out/lib/libbz2.so.1.0
runHook postInstall
'';
}
# pkgname=simplicitystudio5-bin
# pkgver=5
# pkgrel=1
# pkgdesc='Design tools, documentation, software and support resources for EFM32™, EFM8™, 8051, Wireless MCUs and Wireless SoCs.'
# arch=(x86_64)
# url=https://www.silabs.com/products/development-tools/software/simplicity-studio
# license=(unknown)
# backup=("opt/$installdir/studio.ini")
# depends=(qt5-base libxtst webkit2gtk)
# optdepends=('wine: for IAR support'
# 'lib32-qt4: for old tools like battery estimator'
# 'qt4: for Segger tools like systemview')
# options=('!strip')
# install=simplicitystudio5.install
# source=(https://www.silabs.com/documents/login/software/SimplicityStudio-5.tgz
# simplicitystudio5.desktop)
# sha256sums=('SKIP'
# 'd0c7b8d6f8b9bcb8d900dfdb047d5a833aae2d131bc4c675e67aec7e3ac3f0e7')
# installdir=simplicitystudio5
# prepare() {
# cd "$srcdir/SimplicityStudio_v5"
# }
# package() {
# install -dm755 "$pkgdir/opt/"
# cp -a "$srcdir/SimplicityStudio_v5" "$pkgdir/opt/$installdir"
# install -dm755 "$pkgdir/etc/udev/rules.d/"
# find "$srcdir/SimplicityStudio_v5/StudioLinux" -name '*.rules' \
# -exec install -m644 {} "$pkgdir/etc/udev/rules.d/" \;
# mkdir -p $pkgdir/usr/bin
# ln -sf /opt/$installdir/studio $pkgdir/usr/bin/$installdir
# install -Dm644 "simplicitystudio5.desktop" \
# "$pkgdir/usr/share/applications/simplicitystudio5.desktop"
# # installation directory has to be writable
# find "$pkgdir/opt/$installdir" -type d -exec chmod a+w {} +
# find "$pkgdir/opt/$installdir" -type f -exec chmod a+w {} +
# }

View File

@ -0,0 +1,8 @@
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=${installDir}/studio
Name=Simplicity Studio
Path=${installDir}
Icon=${installDir}/icon.xpm

View File

@ -0,0 +1,41 @@
{
lib,
buildPythonPackage,
fetchPypi,
dacite,
python-dateutil,
requests,
...
}:
buildPythonPackage rec {
pname = "soundcloud-v2";
version = "1.3.1";
src = fetchPypi {
inherit pname version;
sha256 = "mpwSqiLnFWbiymAVJnyrwYVq/Xn6RY8PxDxEhywYR0E=";
};
propagatedBuildInputs = [
dacite
python-dateutil
requests
];
outputs = [ "out" "doc" ];
postInstall = ''
install -Dm644 -t $doc/share/doc/soundcloud-v2/ \
LICENSE \
README.md
'';
meta = with lib; {
description = "Python wrapper for some of the v2 SoundCloud API";
homepage = "https://github.com/7x11x13/soundcloud.py";
license = licenses.mit;
maintainers = [ maintainers.h7x4 ];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,47 @@
{ pkgs, lib, stdenvNoCC, fetchFromGitHub, }:
stdenvNoCC.mkDerivation rec {
pname = "super-tiny-icons";
version = "20221107-${lib.strings.substring 0 7 rev}";
rev = "b4d5a3be04c99ec0a309ac9e0d0b21207c237c7d";
src = fetchFromGitHub {
owner = "edent";
repo = "SuperTinyIcons";
inherit rev;
sha256 = "670ndAuBrZBr7YOTQm2zHJfpiBC56aPk+ZKMneREEoI=";
};
outputs = ["out" "doc"];
phases = [ "installPhase" ];
installPhase = ''
runHook preInstall
mkdir -p $out/share/icons/SuperTinyIcons
for icondir in $(find $src/images -type d); do
cp -r $icondir $out/share/icons/SuperTinyIcons/
done
install -Dm644 -t $doc/share/doc/SuperTinyIcons/ \
$src/CODE_OF_CONDUCT.md \
$src/CONTRIBUTING.md \
$src/ISSUE_TEMPLATE.md \
$src/LICENSE \
$src/README.md
runHook postInstall
'';
meta = with lib; {
description = "Miniscule SVG versions of common logos";
longDescription = ''
Super Tiny Web Icons are minuscule SVG versions of your favourite logos.
The average size is under 568 bytes!
'';
homepage = "https://github.com/edent/SuperTinyIcons";
license = licenses.mit;
maintainers = [ maintainers.h7x4 ];
platforms = platforms.all;
};
}

28
pkgs/xiu/default.nix Normal file
View File

@ -0,0 +1,28 @@
{ lib, fetchFromGitHub, rustPlatform, ... }:
rustPlatform.buildRustPackage rec {
pname = "xiu";
version = "0.0.11";
src = fetchFromGitHub {
owner = "harlanc";
repo = pname;
rev = "v${version}";
sha256 = "N3Y5AMKfK5KGCxygYGxqrBdcGs/VjCEYMMrWEbxnavE=";
};
cargoSha256 = "";
meta = with lib; {
description = "A simple and secure live media server in pure Rust";
longDescription = ''
Xiu is a simple and secure live media server written by pure Rust.
It now supports popular live protocols like RTMP/HLS/HTTP-FLV (and maybe other protocols in the future).
You can deploy it as a stand-alone server or a cluster using the relay feature.
'';
homepage = "https://github.com/harlanc/xiu";
license = licenses.mit;
platforms = platforms.linux;
maintainers = [ maintainers.h7x4 ];
};
}