push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,120 @@
{
stdenv,
lib,
fetchurl,
pkg-config,
meson,
ninja,
makeWrapper,
libbsd,
numactl,
libbpf,
zlib,
elfutils,
jansson,
openssl,
libpcap,
rdma-core,
doxygen,
python3,
pciutils,
fetchpatch,
withExamples ? [ ],
shared ? false,
machine ? (
if stdenv.hostPlatform.isx86_64 then
"nehalem"
else if stdenv.hostPlatform.isAarch64 then
"generic"
else
null
),
}:
stdenv.mkDerivation rec {
pname = "dpdk";
version = "25.07";
src = fetchurl {
url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
sha256 = "sha256-aIbL7cNQu4y+80fRA2fWJZ42Q1Yn+7J9V4rb3A07QQ0=";
};
nativeBuildInputs = [
makeWrapper
doxygen
meson
ninja
pkg-config
python3
python3.pkgs.sphinx
python3.pkgs.pyelftools
];
buildInputs = [
jansson
libbpf
elfutils
libpcap
numactl
openssl.dev
zlib
python3
];
propagatedBuildInputs = [
# Propagated to support current DPDK users in nixpkgs which statically link
# with the framework (e.g. odp-dpdk).
rdma-core
# Requested by pkg-config.
libbsd
];
postPatch = ''
patchShebangs config/arm buildtools
'';
mesonFlags = [
"-Dtests=false"
"-Denable_docs=true"
"-Ddeveloper_mode=disabled"
]
++ [ (if shared then "-Ddefault_library=shared" else "-Ddefault_library=static") ]
++ lib.optional (machine != null) "-Dmachine=${machine}"
++ lib.optional (withExamples != [ ]) "-Dexamples=${builtins.concatStringsSep "," withExamples}";
postInstall = ''
# Remove Sphinx cache files. Not only are they not useful, but they also
# contain store paths causing spurious dependencies.
rm -rf $out/share/doc/dpdk/html/.doctrees
wrapProgram $out/bin/dpdk-devbind.py \
--prefix PATH : "${lib.makeBinPath [ pciutils ]}"
''
+ lib.optionalString (withExamples != [ ]) ''
mkdir -p $examples/bin
find examples -type f -executable -exec install {} $examples/bin \;
'';
outputs = [
"out"
"doc"
]
++ lib.optional (withExamples != [ ]) "examples";
meta = with lib; {
description = "Set of libraries and drivers for fast packet processing";
homepage = "http://dpdk.org/";
license = with licenses; [
lgpl21
gpl2Only
bsd2
];
platforms = platforms.linux;
maintainers = with maintainers; [
magenbluten
orivej
mic92
zhaofengli
];
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation rec {
pname = "dpic";
version = "2025.08.01";
src = fetchurl {
url = "https://ece.uwaterloo.ca/~aplevich/dpic/${pname}-${version}.tar.gz";
sha256 = "sha256-Dzj1wekVGIJsssbpViSzkNGAjvrcBAL4ORFRLwznJsM=";
};
# The prefix passed to configure is not used.
makeFlags = [ "DESTDIR=$(out)" ];
meta = with lib; {
description = "Implementation of the pic little language for creating drawings";
homepage = "https://ece.uwaterloo.ca/~aplevich/dpic/";
license = licenses.bsd2;
maintainers = with maintainers; [ aespinosa ];
platforms = platforms.all;
mainProgram = "dpic";
};
}

View File

@@ -0,0 +1,140 @@
{
lib,
stdenv,
fetchgit,
perl,
gnutar,
zlib,
bzip2,
xz,
zstd,
libmd,
makeWrapper,
coreutils,
autoreconfHook,
pkg-config,
diffutils,
versionCheckHook,
glibc ? !stdenv.hostPlatform.isDarwin,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "dpkg";
version = "1.22.21";
src = fetchgit {
url = "https://git.launchpad.net/ubuntu/+source/dpkg";
tag = "applied/${finalAttrs.version}";
leaveDotGit = true;
# Fix filename conflict on case-insensitive filesystems
postFetch = ''
pushd $out
git checkout HEAD -- scripts/t/Dpkg_BuildTree.t
mv scripts/t/Dpkg_BuildTree.t scripts/t/Dpkg_BuildTreeC.t
substituteInPlace scripts/Makefile.am --replace-fail t/Dpkg_BuildTree.t t/Dpkg_BuildTreeC.t
substituteInPlace scripts/Makefile.in --replace-fail t/Dpkg_BuildTree.t t/Dpkg_BuildTreeC.t
git checkout HEAD -- scripts/t/dpkg_buildtree.t
rm -rf .git
popd
'';
hash = "sha256-LK6nOPewjRyKyHdwJgmLILoZ6sEfJzRtC7pIeWz01lA=";
};
configureFlags = [
"--disable-dselect"
"--disable-start-stop-daemon"
"--with-admindir=/var/lib/dpkg"
"PERL_LIBDIR=$(out)/${perl.libPrefix}"
"TAR=${gnutar}/bin/tar"
]
++ lib.optional stdenv.hostPlatform.isDarwin "--disable-linker-optimisations";
enableParallelBuilding = true;
preConfigure = ''
# Nice: dpkg has a circular dependency on itself. Its configure
# script calls scripts/dpkg-architecture, which calls "dpkg" in
# $PATH. It doesn't actually use its result, but fails if it
# isn't present, so make a dummy available.
touch $TMPDIR/dpkg
chmod +x $TMPDIR/dpkg
PATH=$TMPDIR:$PATH
for i in $(find . -name Makefile.in); do
substituteInPlace $i --replace-quiet "install-data-local:" "disabled:" ;
done
# Skip check broken when cross-compiling.
substituteInPlace configure \
--replace-fail 'as_fn_error $? "cannot find a GNU tar program"' "#"
'';
postPatch = ''
patchShebangs --host .
# Dpkg commands sometimes calls out to shell commands
substituteInPlace lib/dpkg/dpkg.h \
--replace-fail '"dpkg-deb"' \"$out/bin/dpkg-deb\" \
--replace-fail '"dpkg-split"' \"$out/bin/dpkg-split\" \
--replace-fail '"dpkg-query"' \"$out/bin/dpkg-query\" \
--replace-fail '"dpkg-divert"' \"$out/bin/dpkg-divert\" \
--replace-fail '"dpkg-statoverride"' \"$out/bin/dpkg-statoverride\" \
--replace-fail '"dpkg-trigger"' \"$out/bin/dpkg-trigger\" \
--replace-fail '"dpkg"' \"$out/bin/dpkg\" \
--replace-fail '"debsig-verify"' \"$out/bin/debsig-verify\" \
--replace-fail '"rm"' \"${coreutils}/bin/rm\" \
--replace-fail '"cat"' \"${coreutils}/bin/cat\" \
--replace-fail '"diff"' \"${diffutils}/bin/diff\"
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
# realpath("/var/lib/dpkg", NULL) gives EPERM on sandboxed darwin instead of the expected ENOENT,
# which makes some tests fail.
sed -i '/opts normalize/a AT_SKIP_IF([true])' src/at/chdir.at
''
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
substituteInPlace src/main/help.c \
--replace-fail '"ldconfig"' \"${glibc.bin}/bin/ldconfig\"
'';
buildInputs = [
perl
zlib
bzip2
xz
zstd
libmd
];
nativeBuildInputs = [
makeWrapper
perl
autoreconfHook
pkg-config
];
postInstall = ''
for i in $out/bin/*; do
if head -n 1 $i | grep -q perl; then
substituteInPlace $i --replace-fail \
"${perl}/bin/perl" "${perl}/bin/perl -I $out/${perl.libPrefix}"
fi
done
mkdir -p $out/etc/dpkg
cp -r scripts/t/origins $out/etc/dpkg
'';
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
setupHook = ./setup-hook.sh;
meta = with lib; {
description = "Debian package manager";
homepage = "https://wiki.debian.org/Teams/Dpkg";
license = licenses.gpl2Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ siriobalmelli ];
mainProgram = "dpkg";
};
})

View File

@@ -0,0 +1,12 @@
unpackCmdHooks+=(_tryDpkgDeb)
_tryDpkgDeb() {
if ! [[ "$curSrc" =~ \.deb$ ]]; then return 1; fi
# Don't use dpkg-deb -x as that will error if the archive contains a file
# or directory with a setuid bit in its permissions. This is because dpkg
# calls tar internally with the -p flag, preserving file permissions.
#
# We instead only use dpkg-deb to extract the tarfile containing the files
# we want from the .deb, then finish extracting with tar directly.
mkdir root
dpkg-deb --fsys-tarfile "$curSrc" | tar --extract --directory=root
}

View File

@@ -0,0 +1,27 @@
{
lib,
rustPlatform,
fetchFromGitHub,
}:
rustPlatform.buildRustPackage {
pname = "dpms-off";
version = "0.2.1";
src = fetchFromGitHub {
owner = "lilydjwg";
repo = "dpms-off";
rev = "17c5600fdfcf3f5aeb7c85b649dc53e18565b21f";
hash = "sha256-fADydBO4XISt2n7vrkCuca8db9jtMVsUUvqYAqeVy60=";
};
cargoHash = "sha256-wpX14e+J+n1it+1D6OD/AyDn+bOuSoJCEEWlmuZ7c0Y=";
meta = {
description = "Turn off monitors to save power (for Wayland)";
homepage = "https://github.com/lilydjwg/dpms-off";
license = lib.licenses.bsd3;
maintainers = [ lib.maintainers.philiptaron ];
mainProgram = "dpms-off";
};
}

View File

@@ -0,0 +1,49 @@
{
stdenv,
fetchFromGitHub,
cmake,
libopus,
openssl,
zlib,
libsodium,
pkg-config,
lib,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "dpp";
version = "10.1.3";
src = fetchFromGitHub {
owner = "brainboxdotcc";
repo = "DPP";
rev = "v${finalAttrs.version}";
hash = "sha256-G2v0xMYj89AK5PklQl7i0/YuVTtpBYSM3EaMJrmYdME=";
};
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
openssl
zlib
libsodium
libopus
];
meta = {
description = "Discord C++ Library";
longDescription = ''
D++ (DPP) is a lightweight and simple library for Discord written in modern C++.
It is designed to cover as much of the API specification as possible and to have
an incredibly small memory footprint, even when caching large amounts of data.
This package contains version ${finalAttrs.version} of the DPP library.
'';
homepage = "https://github.com/brainboxdotcc/DPP";
changelog = "https://github.com/brainboxdotcc/DPP/releases/tag/${finalAttrs.src.rev}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ xbz ];
platforms = lib.platforms.unix;
};
})

View File

@@ -0,0 +1,102 @@
{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
buildPackages,
installShellFiles,
writableTmpDirAsHomeHook,
versionCheckHook,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "dprint";
version = "0.50.2";
# Prefer repository rather than crate here
# - They have Cargo.lock in the repository
# - They have WASM files in the repository which will be used in checkPhase
src = fetchFromGitHub {
owner = "dprint";
repo = "dprint";
tag = finalAttrs.version;
hash = "sha256-pBiMJ+S23J5W+nldW6WpqnvkODcQsEwM2IzDhe6TUlM=";
};
cargoHash = "sha256-doaZlr5B9XhOaEawLGgM3yWJjgJ5f6TLUiqb+Ze+v0I=";
nativeBuildInputs = [ installShellFiles ];
# Avoiding "Undefined symbols" such as "___unw_remove_find_dynamic_unwind_sections" since dprint 0.50.1
# Adding "libunwind" in buildInputs did not resolve it.
env.RUSTFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-C link-args=-Wl,-undefined,dynamic_lookup";
cargoBuildFlags = [
"--package=dprint"
# Required only for dprint package tests; the binary is removed in postInstall.
"--package=test-process-plugin"
];
cargoTestFlags = [
"--package=dprint"
];
checkFlags = [
# Require creating directory and network access
"--skip=plugins::cache_fs_locks::test"
"--skip=utils::lax_single_process_fs_flag::test"
# Require cargo is running
"--skip=utils::process::test"
# Requires deno for the testing, and making unstable results on darwin
"--skip=utils::url::test::unsafe_ignore_cert"
];
postInstall =
let
dprint =
if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
"$out/bin/dprint"
else
lib.getExe buildPackages.dprint;
in
''
rm "$out/bin/test-process-plugin"
export DPRINT_CACHE_DIR="$(mktemp -d)"
installShellCompletion --cmd dprint \
--bash <(${dprint} completions bash) \
--zsh <(${dprint} completions zsh) \
--fish <(${dprint} completions fish)
'';
nativeInstallCheckInputs = [
writableTmpDirAsHomeHook
versionCheckHook
];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/dprint";
versionCheckProgramArg = "--version";
versionCheckKeepEnvironment = [ "HOME" ];
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "Code formatting platform written in Rust";
longDescription = ''
dprint is a pluggable and configurable code formatting platform written in Rust.
It offers multiple WASM plugins to support various languages. It's written in
Rust, so its small, fast, and portable.
'';
changelog = "https://github.com/dprint/dprint/releases/tag/${finalAttrs.version}";
homepage = "https://dprint.dev";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
khushraj
kachick
phanirithvij
];
mainProgram = "dprint";
};
})

View File

@@ -0,0 +1,82 @@
{
lib,
fetchurl,
stdenv,
dprint,
writableTmpDirAsHomeHook,
}:
let
mkDprintPlugin =
{
url,
hash,
pname,
version,
description,
initConfig,
updateUrl,
license ? lib.licenses.mit,
maintainers ? [ lib.maintainers.phanirithvij ],
}:
stdenv.mkDerivation (finalAttrs: {
inherit pname version;
src = fetchurl { inherit url hash; };
dontUnpack = true;
meta = {
inherit description license maintainers;
};
/*
in the dprint configuration
dprint expects a plugin path to end with .wasm extension
for auto update with nixpkgs-update to work
we cannot have .wasm extension at the end in the nix store path
*/
buildPhase = ''
mkdir -p $out
cp $src $out/plugin.wasm
'';
doInstallCheck = true;
nativeInstallCheckInputs = [
dprint
writableTmpDirAsHomeHook
];
# Prevent schema unmatching errors
# See https://github.com/NixOS/nixpkgs/pull/369415#issuecomment-2566112144 for detail
installCheckPhase = ''
runHook preInstallCheck
mkdir empty && cd empty
dprint check --allow-no-files --config-discovery=false --plugins "$out/plugin.wasm"
runHook postInstallCheck
'';
passthru = {
updateScript = ./update-plugins.py;
inherit initConfig updateUrl;
};
});
inherit (lib)
filterAttrs
isDerivation
mapAttrs'
nameValuePair
removeSuffix
;
files = filterAttrs (
name: type: type == "regular" && name != "default.nix" && lib.hasSuffix ".nix" name
) (builtins.readDir ./.);
plugins = mapAttrs' (
name: _:
nameValuePair (removeSuffix ".nix" name) (import (./. + "/${name}") { inherit mkDprintPlugin; })
) files;
# Expects a function that receives the dprint plugin set as an input
# and returns a list of plugins
# Example:
# pkgs.dprint-plugins.getPluginList (plugins: [
# plugins.dprint-plugin-toml
# (pkgs.callPackage ./dprint/plugins/sample.nix {})
# ]
getPluginList = cb: map (p: "${p}/plugin.wasm") (cb plugins);
in
plugins // { inherit mkDprintPlugin getPluginList; }

View File

@@ -0,0 +1,21 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "Biome (JS/TS) wrapper plugin";
hash = "sha256-czgTZXlW+LdTKGtX7JJtG7qAbnWlQpunMY92WiC+X8A=";
initConfig = {
configExcludes = [ "**/node_modules" ];
configKey = "biome";
fileExtensions = [
"ts"
"tsx"
"js"
"jsx"
"cjs"
"mjs"
];
};
pname = "dprint-plugin-biome";
updateUrl = "https://plugins.dprint.dev/dprint/biome/latest.json";
url = "https://plugins.dprint.dev/biome-0.10.4.wasm";
version = "0.10.4";
}

View File

@@ -0,0 +1,14 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "Dockerfile code formatter";
hash = "sha256-gsfMLa4zw8AblOS459ZS9OZrkGCQi5gBN+a3hvOsspk=";
initConfig = {
configExcludes = [ ];
configKey = "dockerfile";
fileExtensions = [ "dockerfile" ];
};
pname = "dprint-plugin-dockerfile";
updateUrl = "https://plugins.dprint.dev/dprint/dockerfile/latest.json";
url = "https://plugins.dprint.dev/dockerfile-0.3.2.wasm";
version = "0.3.2";
}

View File

@@ -0,0 +1,14 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "JSON/JSONC code formatter";
hash = "sha256-uFcFLi9aYsBrAqkhFmg9GI+LKiV19LxdNjxQ85EH9To=";
initConfig = {
configExcludes = [ "**/*-lock.json" ];
configKey = "json";
fileExtensions = [ "json" ];
};
pname = "dprint-plugin-json";
updateUrl = "https://plugins.dprint.dev/dprint/json/latest.json";
url = "https://plugins.dprint.dev/json-0.20.0.wasm";
version = "0.20.0";
}

View File

@@ -0,0 +1,14 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "Jupyter notebook code block formatter";
hash = "sha256-IlGwt2TnKeH9NwmUmU1keaTInXgYQVLIPNnr30A9lsM=";
initConfig = {
configExcludes = [ ];
configKey = "jupyter";
fileExtensions = [ "ipynb" ];
};
pname = "dprint-plugin-jupyter";
updateUrl = "https://plugins.dprint.dev/dprint/jupyter/latest.json";
url = "https://plugins.dprint.dev/jupyter-0.2.0.wasm";
version = "0.2.0";
}

View File

@@ -0,0 +1,14 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "Markdown code formatter";
hash = "sha256-2lpgVMExOjMVRTvX6hGRWuufwh2AIkiXaOzkN8LhZgw=";
initConfig = {
configExcludes = [ ];
configKey = "markdown";
fileExtensions = [ "md" ];
};
pname = "dprint-plugin-markdown";
updateUrl = "https://plugins.dprint.dev/dprint/markdown/latest.json";
url = "https://plugins.dprint.dev/markdown-0.19.0.wasm";
version = "0.19.0";
}

View File

@@ -0,0 +1,17 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "Ruff (Python) wrapper plugin";
hash = "sha256-15InHQgF9c0Js4yUJxmZ1oNj1O16FBU12u/GOoaSAJ8=";
initConfig = {
configExcludes = [ ];
configKey = "ruff";
fileExtensions = [
"py"
"pyi"
];
};
pname = "dprint-plugin-ruff";
updateUrl = "https://plugins.dprint.dev/dprint/ruff/latest.json";
url = "https://plugins.dprint.dev/ruff-0.3.9.wasm";
version = "0.3.9";
}

View File

@@ -0,0 +1,14 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "TOML code formatter";
hash = "sha256-ASbIESaRVC0wtSpjkHbsyD4Hus6HdjjO58aRX9Nrhik=";
initConfig = {
configExcludes = [ ];
configKey = "toml";
fileExtensions = [ "toml" ];
};
pname = "dprint-plugin-toml";
updateUrl = "https://plugins.dprint.dev/dprint/toml/latest.json";
url = "https://plugins.dprint.dev/toml-0.7.0.wasm";
version = "0.7.0";
}

View File

@@ -0,0 +1,21 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "TypeScript/JavaScript code formatter";
hash = "sha256-azXAPEwle+VeKFWeWooNn7dPv0DD6zaKer0mdr1K9II=";
initConfig = {
configExcludes = [ "**/node_modules" ];
configKey = "typescript";
fileExtensions = [
"ts"
"tsx"
"js"
"jsx"
"cjs"
"mjs"
];
};
pname = "dprint-plugin-typescript";
updateUrl = "https://plugins.dprint.dev/dprint/typescript/latest.json";
url = "https://plugins.dprint.dev/typescript-0.95.11.wasm";
version = "0.95.11";
}

View File

@@ -0,0 +1,19 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "CSS, SCSS, Sass and Less formatter";
hash = "sha256-mFlhfqtglKtKNls96PO/2AWLL1fNC5msQCd9EgdKauE=";
initConfig = {
configExcludes = [ "**/node_modules" ];
configKey = "malva";
fileExtensions = [
"css"
"scss"
"sass"
"less"
];
};
pname = "g-plane-malva";
updateUrl = "https://plugins.dprint.dev/g-plane/malva/latest.json";
url = "https://plugins.dprint.dev/g-plane/malva-v0.11.2.wasm";
version = "0.11.2";
}

View File

@@ -0,0 +1,24 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "HTML, Vue, Svelte, Astro, Angular, Jinja, Twig, Nunjucks, and Vento formatter";
hash = "sha256-fCvurr8f79io/jIjwCfwr/WGjvcKZtptRrx9GFfytSI=";
initConfig = {
configExcludes = [ ];
configKey = "markup";
fileExtensions = [
"html"
"vue"
"svelte"
"astro"
"jinja"
"jinja2"
"twig"
"njk"
"vto"
];
};
pname = "g-plane-markup_fmt";
updateUrl = "https://plugins.dprint.dev/g-plane/markup_fmt/latest.json";
url = "https://plugins.dprint.dev/g-plane/markup_fmt-v0.19.0.wasm";
version = "0.19.0";
}

View File

@@ -0,0 +1,17 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "GraphQL formatter";
hash = "sha256-PlQwpR0tMsghMrOX7is+anN57t9xa9weNtoWpc0E9ec=";
initConfig = {
configExcludes = [ ];
configKey = "graphql";
fileExtensions = [
"graphql"
"gql"
];
};
pname = "g-plane-pretty_graphql";
updateUrl = "https://plugins.dprint.dev/g-plane/pretty_graphql/latest.json";
url = "https://plugins.dprint.dev/g-plane/pretty_graphql-v0.2.1.wasm";
version = "0.2.1";
}

View File

@@ -0,0 +1,17 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "YAML formatter";
hash = "sha256-6ua021G7ZW7Ciwy/OHXTA1Joj9PGEx3SZGtvaA//gzo=";
initConfig = {
configExcludes = [ ];
configKey = "yaml";
fileExtensions = [
"yaml"
"yml"
];
};
pname = "g-plane-pretty_yaml";
updateUrl = "https://plugins.dprint.dev/g-plane/pretty_yaml/latest.json";
url = "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm";
version = "0.5.0";
}

View File

@@ -0,0 +1,154 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python -p nix 'python3.withPackages (pp: [ pp.requests ])'
import json
import os
from pathlib import Path
import sys
import subprocess
import requests
USAGE = """Usage: {0} [ | plugin-name | plugin-file-path]
eg.
{0}
{0} dprint-plugin-json
{0} /path/to/dprint-plugin-json.nix"""
FILE_PATH = Path(os.path.realpath(__file__))
SCRIPT_DIR = FILE_PATH.parent
pname = ""
if len(sys.argv) > 1:
if "-help" in "".join(sys.argv):
print(USAGE.format(FILE_PATH.name))
exit(0)
pname = sys.argv[1]
else:
pname = os.environ.get("UPDATE_NIX_PNAME", "")
# get sri hash for a url, no unpack
def nix_prefetch_url(url, algo="sha256"):
hash = (
subprocess.check_output(["nix-prefetch-url", "--type", algo, url])
.decode("utf-8")
.rstrip()
)
sri = (
subprocess.check_output(
# split by space is enough for this command
"nix --extra-experimental-features nix-command "
f"hash convert --hash-algo {algo} --to sri {hash}".split(" ")
)
.decode("utf-8")
.rstrip()
)
return sri
# json object to nix string
def json_to_nix(jsondata):
# to quote strings, dumps twice does it
json_str = json.dumps(json.dumps(jsondata))
return (
subprocess.check_output(
"nix --extra-experimental-features nix-command eval "
f"--expr 'builtins.fromJSON ''{json_str}''' --impure | nixfmt",
shell=True,
)
.decode("utf-8")
.rstrip()
)
# nix string to json object
def nix_to_json(nixstr):
return json.loads(
subprocess.check_output(
f"nix --extra-experimental-features nix-command eval --json --expr '{nixstr}'",
shell=True,
)
.decode("utf-8")
.rstrip()
)
# nixfmt a file
def nixfmt(nixfile):
subprocess.run(["nixfmt", nixfile])
def get_update_url(plugin_url):
"""Get a single plugin's update url given the plugin's url"""
# remove -version.wasm at the end
url = "-".join(plugin_url.split("-")[:-1])
names = url.split("/")[3:]
# if single name then -> dprint/<name>
if len(names) == 1:
names.insert(0, "dprint")
return "https://plugins.dprint.dev/" + "/".join(names) + "/latest.json"
def write_plugin_derivation(drv_attrs):
drv = f"{{ mkDprintPlugin }}: mkDprintPlugin {json_to_nix(drv_attrs)}"
filepath = SCRIPT_DIR / f"{drv_attrs["pname"]}.nix"
with open(filepath, "w+", encoding="utf8") as f:
f.write(drv)
nixfmt(filepath)
def update_plugin_by_name(name):
"""Update a single plugin by name"""
# allow passing in filename as well as pname
if name.endswith(".nix"):
name = Path(name[:-4]).name
try:
p = (SCRIPT_DIR / f"{name}.nix").read_text().replace("\n", "")
except OSError as e:
print(f"failed to update plugin {name}: error: {e}")
exit(1)
start_idx = p.find("mkDprintPlugin {") + len("mkDprintPlugin {")
p = nix_to_json("{" + p[start_idx:].strip())
data = requests.get(p["updateUrl"]).json()
p["url"] = data["url"]
p["version"] = data["version"]
p["hash"] = nix_prefetch_url(data["url"])
write_plugin_derivation(p)
def update_plugins():
"""Update all the plugins"""
data = requests.get("https://plugins.dprint.dev/info.json").json()["latest"]
for e in data:
update_url = get_update_url(e["url"])
pname = e["name"]
if "/" in e["name"]:
pname = pname.replace("/", "-")
drv_attrs = {
"url": e["url"],
"hash": nix_prefetch_url(e["url"]),
"updateUrl": update_url,
"pname": pname,
"version": e["version"],
"description": e["description"],
"initConfig": {
"configKey": e["configKey"],
"configExcludes": e["configExcludes"],
"fileExtensions": e["fileExtensions"],
},
}
write_plugin_derivation(drv_attrs)
if pname != "":
update_plugin_by_name(pname)
else:
update_plugins()

View File

@@ -0,0 +1,52 @@
{
lib,
stdenv,
fetchFromGitLab,
libuv,
coreutils-full,
pkg-config,
gnugrep,
gnused,
}:
stdenv.mkDerivation rec {
pname = "dps8m";
version = "3.1.0";
src = fetchFromGitLab {
owner = "dps8m";
repo = "dps8m";
rev = "R${version}";
hash = "sha256-2PTL9C1sV+UTZibjyxBkQh9Y1xqwawNPwWL4eX0ilvU=";
fetchSubmodules = true;
};
env = {
ENV = "${coreutils-full}/bin/env";
GREP = "${gnugrep}/bin/grep";
SED = "${gnused}/bin/sed";
PREFIX = placeholder "out";
};
nativeBuildInputs = [
coreutils-full
pkg-config
];
buildInputs = [
libuv
];
meta = with lib; {
description = "GE / Honeywell / Bull DPS-8/M mainframe simulator";
homepage = "https://gitlab.com/dps8m/dps8m";
changelog = "https://gitlab.com/dps8m/dps8m/-/wikis/DPS8M-${src.rev}-Release-Notes";
license = licenses.icu;
maintainers = with maintainers; [
matthewcroughan
sarcasticadmin
];
mainProgram = "dps8m";
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,45 @@
{
lib,
python3Packages,
fetchFromGitHub,
}:
python3Packages.buildPythonApplication rec {
pname = "dpt-rp1-py";
version = "0.1.16";
format = "pyproject";
src = fetchFromGitHub {
owner = "janten";
repo = "dpt-rp1-py";
rev = "v${version}";
sha256 = "0zvf09b9rzpx5b0w81ziqd7v321hfhgsgvshdx23karj2hf75bvj";
};
doCheck = false;
build-system = with python3Packages; [
setuptools
];
dependencies = with python3Packages; [
anytree
fusepy
httpsig
pbkdf2
pyyaml
requests
tqdm
urllib3
zeroconf
];
pythonImportsCheck = [ "dptrp1" ];
meta = with lib; {
homepage = "https://github.com/janten/dpt-rp1-py";
description = "Python script to manage Sony DPT-RP1 without Digital Paper App";
license = licenses.mit;
maintainers = with maintainers; [ mt-caret ];
mainProgram = "dptrp1";
};
}

View File

@@ -0,0 +1,65 @@
{
lib,
python3,
fetchFromGitLab,
nix-update-script,
}:
let
version = "1.43";
in
python3.pkgs.buildPythonApplication {
pname = "dput-ng";
inherit version;
pyproject = true;
src = fetchFromGitLab {
domain = "salsa.debian.org";
owner = "debian";
repo = "dput-ng";
tag = "debian/${version}";
hash = "sha256-zrH4h4C4y3oTiOXsidFv/rIJNzCdV2lqzNEg0SOkX4w=";
};
build-system = with python3.pkgs; [
setuptools
];
dependencies = with python3.pkgs; [
jsonschema
paramiko
sphinx
coverage
xdg
python-debian
];
postInstall = ''
cp -r bin $out/
'';
pythonImportsCheck = [ "dput" ];
nativeCheckInputs = with python3.pkgs; [
pytestCheckHook
];
# Requires running dpkg
disabledTestPaths = [ "tests/test_upload.py" ];
passthru.updateScript = nix-update-script {
# Debian's tagging scheme is the bane of my existence.
# Essentially: all tags from 1.40 onwards start with `debian/`,
# then the version, and then an optional suffix (usually reserved for backports).
# We want to ignore the backport versions, and strip the `debian/` prefix.
extraArgs = [ "--version-regex=(?:debian\/)?(\d+(?:\.\d+)*)(?:[_\+].*)?" ];
};
meta = {
description = "Next-generation Debian package upload tool";
homepage = "https://dput.readthedocs.io/en/latest/";
license = with lib.licenses; [ gpl2Plus ];
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ pluiedev ];
mainProgram = "dput";
};
}