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,90 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
# nativeBuildInputs
installShellFiles,
buildPackages,
versionCheckHook,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "ty";
version = "0.0.1-alpha.21";
src = fetchFromGitHub {
owner = "astral-sh";
repo = "ty";
tag = finalAttrs.version;
fetchSubmodules = true;
hash = "sha256-C7u2fBOtKGIYnBkYIIsbbcDsfZezXoZjQN1/TTXU2bg=";
};
# For Darwin platforms, remove the integration test for file notifications,
# as these tests fail in its sandboxes.
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
rm ${finalAttrs.cargoRoot}/crates/ty/tests/file_watching.rs
'';
cargoRoot = "ruff";
buildAndTestSubdir = finalAttrs.cargoRoot;
cargoBuildFlags = [ "--package=ty" ];
cargoHash = "sha256-sjnLsOQSSCB5Yz3GsUzgPpTCUj0sJ4T3ZV60Vl7+ng0=";
nativeBuildInputs = [ installShellFiles ];
# `ty`'s tests use `insta-cmd`, which depends on the structure of the `target/` directory,
# and also fails to find the environment variable `$CARGO_BIN_EXE_ty`, which leads to tests failing.
# Instead, we specify the path ourselves and forgo the lookup.
# As the patches occur solely in test code, they have no effect on the packaged `ty` binary itself.
#
# `stdenv.hostPlatform.rust.cargoShortTarget` is taken from `cargoSetupHook`'s `installPhase`,
# which constructs a path as below to reference the built binary.
preCheck = ''
export CARGO_BIN_EXE_ty="$PWD"/target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/ty
'';
cargoTestFlags = [
"--package=ty" # CLI tests; file-watching tests only on Linux platforms
"--package=ty_python_semantic" # core type checking tests
"--package=ty_test" # test framework tests
];
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
doInstallCheck = true;
postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
let
emulator = stdenv.hostPlatform.emulator buildPackages;
in
''
installShellCompletion --cmd ty \
--bash <(${emulator} $out/bin/ty generate-shell-completion bash) \
--fish <(${emulator} $out/bin/ty generate-shell-completion fish) \
--zsh <(${emulator} $out/bin/ty generate-shell-completion zsh)
''
);
passthru = {
updateScript = nix-update-script { extraArgs = [ "--version=unstable" ]; };
};
meta = {
description = "Extremely fast Python type checker and language server, written in Rust";
homepage = "https://github.com/astral-sh/ty";
changelog = "https://github.com/astral-sh/ty/blob/${finalAttrs.version}/CHANGELOG.md";
license = lib.licenses.mit;
mainProgram = "ty";
maintainers = with lib.maintainers; [
bengsparks
GaetanLepage
];
};
})

View File

@@ -0,0 +1,40 @@
{
lib,
rustPlatform,
fetchFromGitHub,
installShellFiles,
}:
rustPlatform.buildRustPackage rec {
pname = "tydra";
version = "1.0.3";
src = fetchFromGitHub {
owner = "Mange";
repo = "tydra";
rev = "v${version}";
sha256 = "sha256-bH/W54b7UHdkbgLXAd+l5I6UAKjWDMW+I5mfwT4yEEY=";
};
cargoHash = "sha256-sFNrpddhsqxy7HtCXV78oacyNzrTeM0rUcL7qgeJTcM=";
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installManPage doc/{tydra.1,tydra-actions.5}
$out/bin/tydra --generate-completions bash > tydra.bash
$out/bin/tydra --generate-completions fish > tydra.fish
$out/bin/tydra --generate-completions zsh > _tydra
installShellCompletion tydra.{bash,fish} _tydra
'';
meta = with lib; {
description = "Shortcut menu-based task runner, inspired by Emacs Hydra";
homepage = "https://github.com/Mange/tydra";
license = licenses.mit;
maintainers = with maintainers; [ Br1ght0ne ];
mainProgram = "tydra";
};
}

View File

@@ -0,0 +1,35 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "tygo";
version = "0.2.19";
src = fetchFromGitHub {
owner = "gzuidhof";
repo = "tygo";
rev = "v${version}";
hash = "sha256-Eyvvqk8D9q8rOODR72kJSg+g7cVjx3FJCPmSog6eP1E=";
};
vendorHash = "sha256-E73yqGhPzZA/1xTYGvTBy0/b4SE9hzx+gdhjX3ClE/Y=";
env.CGO_ENABLED = 0;
ldflags = [
"-s"
"-w"
"-extldflags -static"
];
meta = {
description = "Generate Typescript types from Golang source code";
homepage = "https://github.com/gzuidhof/tygo";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ alexymantha ];
mainProgram = "tygo";
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
autoreconfHook,
gtk3,
vte,
lua5_3,
pcre2,
}:
stdenv.mkDerivation rec {
pname = "tym";
version = "3.5.2";
src = fetchFromGitHub {
owner = "endaaman";
repo = "tym";
rev = version;
sha256 = "sha256-ySriCBmwDiDmAkIIByaZgmK0nUyYiVb0VAV5bi38JGw=";
};
nativeBuildInputs = [
pkg-config
autoreconfHook
];
buildInputs = [
gtk3
vte
lua5_3
pcre2
];
meta = with lib; {
description = "Lua-configurable terminal emulator";
homepage = "https://github.com/endaaman/tym";
license = licenses.mit;
maintainers = with maintainers; [
wesleyjrz
kashw2
];
platforms = platforms.linux;
mainProgram = "tym";
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
fetchFromGitHub,
python3Packages,
nix-update-script,
installShellFiles,
versionCheckHook,
}:
python3Packages.buildPythonApplication rec {
pname = "typeinc";
version = "1.0.3";
pyproject = true;
src = fetchFromGitHub {
owner = "AnirudhG07";
repo = "Typeinc";
tag = "v${version}";
hash = "sha256-/R3mNxZE4Pt4UlCljsQphHBCoA2JIZrTorqU4Adcdp0=";
};
build-system = [ python3Packages.hatchling ];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installManPage docs/man/typeinc.1
'';
nativeCheckInputs = [ versionCheckHook ];
passthru.updateScript = nix-update-script { };
meta = {
description = "Terminal tool to test your typing speed with various difficulty levels";
homepage = "https://github.com/AnirudhG07/Typeinc";
mainProgram = "typeinc";
license = lib.licenses.asl20;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ lonerOrz ];
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule {
pname = "typer";
version = "0-unstable-2023-02-08";
src = fetchFromGitHub {
owner = "maaslalani";
repo = "typer";
rev = "02aa80b3be8a6c2c9d08d9a56b3fe784adf00933";
hash = "sha256-J3wTqWxHEQz1AAt7DfUmpgc7wmfILBtyHuDrmqN96fI=";
};
vendorHash = "sha256-t4zim6WhqGAf1zHmmbJbpVvQcE/aoNL7ZLdjU7f3rp8=";
ldflags = [
"-s"
"-w"
];
meta = with lib; {
description = "Typing test in your terminal";
homepage = "https://github.com/maaslalani/typer";
license = licenses.mit;
maintainers = with maintainers; [ figsoda ];
mainProgram = "typer";
};
}

View File

@@ -0,0 +1,61 @@
{
lib,
buildGo125Module,
fetchFromGitHub,
nix-update-script,
}:
let
buildGoModule = buildGo125Module;
in
buildGoModule {
pname = "typescript-go";
version = "0-unstable-2025-10-03";
src = fetchFromGitHub {
owner = "microsoft";
repo = "typescript-go";
rev = "e729a0a55aa898cd3ce424a5c97e07f5dc98580f";
hash = "sha256-ZIluvlQNC21EZA4le+lyeynaJj4D0JYxI9njgw7Uuyc=";
fetchSubmodules = false;
};
vendorHash = "sha256-ywhlLaUq2bjfE9GZIUOIcufIY1GLw3ZRGM+ZDfEpOiU=";
ldflags = [
"-s"
"-w"
];
env.CGO_ENABLED = 0;
subPackages = [
"cmd/tsgo"
];
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
version="$("$out/bin/tsgo" --version)"
[[ "$version" == *"7.0.0"* ]]
runHook postInstallCheck
'';
passthru = {
updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
};
};
meta = {
description = "Go implementation of TypeScript";
homepage = "https://github.com/microsoft/typescript-go";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
kachick
];
mainProgram = "tsgo";
};
}

View File

@@ -0,0 +1,15 @@
diff --git a/src/lsp-server.ts b/src/lsp-server.ts
index ef5907d..9494430 100644
--- a/src/lsp-server.ts
+++ b/src/lsp-server.ts
@@ -323,6 +323,10 @@ export class LspServer {
}
}
+ if (!fallbackTsserverPath) {
+ fallbackTsserverPath = "@typescript@";
+ }
+
const fallbackVersionProvider = new TypeScriptVersionProvider(fallbackTsserverPath, this.logger);
const fallbackSettingVersion = fallbackVersionProvider.getUserSettingVersion();
if (fallbackSettingVersion) {

View File

@@ -0,0 +1,99 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchYarnDeps,
fixup-yarn-lock,
makeWrapper,
nodejs,
prefetch-yarn-deps,
replaceVars,
yarn,
testers,
typescript,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "typescript-language-server";
version = "5.0.0";
src = fetchFromGitHub {
owner = "typescript-language-server";
repo = "typescript-language-server";
rev = "v${finalAttrs.version}";
hash = "sha256-dWTo9OM5gPKj78/KtCMeu59KYL5IhhapOsFtuj9JzVQ=";
};
patches = [
(replaceVars ./default-fallbackTsserverPath.diff {
typescript = "${typescript}/lib/node_modules/typescript/lib/tsserver.js";
})
];
offlineCache = fetchYarnDeps {
yarnLock = "${finalAttrs.src}/yarn.lock";
hash = "sha256-9WezeKRsnwWB98YVhQD1nzrT/T6T3plIVwKhVkOsKPo=";
};
nativeBuildInputs = [
fixup-yarn-lock
makeWrapper
nodejs
prefetch-yarn-deps
yarn
];
configurePhase = ''
runHook preConfigure
export HOME=$(mktemp -d)
yarn config --offline set yarn-offline-mirror $offlineCache
fixup-yarn-lock yarn.lock
yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
patchShebangs node_modules
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
yarn --offline build
runHook postBuild
'';
installPhase = ''
runHook preInstall
yarn --offline --production install
mkdir -p "$out/lib/node_modules/typescript-language-server"
cp -r lib node_modules package.json "$out/lib/node_modules/typescript-language-server"
makeWrapper "${nodejs}/bin/node" "$out/bin/typescript-language-server" \
--add-flags "$out/lib/node_modules/typescript-language-server/lib/cli.mjs"
runHook postInstall
'';
passthru = {
tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
};
updateScript = nix-update-script { };
};
meta = {
changelog = "https://github.com/typescript-language-server/typescript-language-server/releases/tag/v${finalAttrs.version}";
description = "Language Server Protocol implementation for TypeScript using tsserver";
homepage = "https://github.com/typescript-language-server/typescript-language-server";
license = with lib.licenses; [
asl20
mit
];
mainProgram = "typescript-language-server";
maintainers = with lib.maintainers; [ marcel ];
};
})

View File

@@ -0,0 +1,15 @@
Disable dprint on dstBundler
dprint fails on sandbox, because it requires internet access to install its
plugins.
--- a/scripts/dtsBundler.mjs
+++ b/scripts/dtsBundler.mjs
@@ -430,5 +430,5 @@
return result.replace(/\r\n/g, "\n");
}
-fs.writeFileSync(output, dprint(publicContents));
-fs.writeFileSync(internalOutput, dprint(internalContents));
+fs.writeFileSync(output, publicContents);
+fs.writeFileSync(internalOutput, internalContents);

View File

@@ -0,0 +1,49 @@
{
lib,
buildNpmPackage,
fetchFromGitHub,
versionCheckHook,
nix-update-script,
}:
buildNpmPackage (finalAttrs: {
pname = "typescript";
version = "5.9.3";
src = fetchFromGitHub {
owner = "microsoft";
repo = "TypeScript";
tag = "v${finalAttrs.version}";
hash = "sha256-OVsvlHtYZhoCtTxdZO6mhVPpIICWEt1Q92Jqrf95jyM=";
};
patches = [
./disable-dprint-dstBundler.patch
];
npmDepsHash = "sha256-4ft5168ru+aGPvZAxASQ4wkjtfNG2e0sNhJTedbiKQA=";
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/tsc";
versionCheckProgramArg = "--version";
passthru = {
updateScript = nix-update-script {
extraArgs = [
"--version-regex=^v([\\d.]+)$"
];
};
};
meta = {
description = "Superset of JavaScript that compiles to clean JavaScript output";
homepage = "https://www.typescriptlang.org/";
changelog = "https://github.com/microsoft/TypeScript/releases/tag/v${finalAttrs.version}";
license = lib.licenses.asl20;
maintainers = [ ];
mainProgram = "tsc";
};
})

View File

@@ -0,0 +1,66 @@
{
lib,
stdenv,
fetchurl,
autoPatchelfHook,
nixosTests,
}:
let
inherit (stdenv.hostPlatform) system;
throwSystem = throw "Unsupported system: ${system}";
sources = lib.importJSON ./sources.json;
platform = sources.platforms.${system} or throwSystem;
inherit (sources) version;
inherit (platform) arch hash;
in
stdenv.mkDerivation {
pname = "typesense";
inherit version;
src = fetchurl {
url = "https://dl.typesense.org/releases/${version}/typesense-server-${version}-${arch}.tar.gz";
inherit hash;
};
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [
autoPatchelfHook
];
# The tar.gz contains no subdirectory
sourceRoot = ".";
installPhase = ''
mkdir -p $out/bin
cp $sourceRoot/typesense-server $out/bin
'';
passthru = {
tests = { inherit (nixosTests) typesense; };
updateScript = ./update.sh;
};
meta = with lib; {
homepage = "https://typesense.org";
description = "Fast, typo-tolerant search engine for building delightful search experiences";
mainProgram = "typesense-server";
license = licenses.gpl3;
# There has been an attempt at building this from source, which were deemed
# unfeasible at the time of writing this (July 2023) for the following reasons.
# - Pre 0.25 would have been possible, but typesense has switched to bazel for 0.25+,
# so the build would break immediately next version
# - The new bazel build has many issues, only some of which were fixable:
# - preBuild requires export LANG="C.UTF-8", since onxxruntime contains a
# unicode file path that is handled incorrectly and otherwise leads to a build failure
# - bazel downloads extensions to the build systems at build time which have
# invalid shebangs that need to be fixed by patching rules_foreign_cc through
# bazel (so a patch in nix that adds a patch to the bazel WORKSPACE)
# - WORKSPACE has to be patched to use system cmake and ninja instead of downloaded toolchains
# - The cmake dependencies that are pulled in via bazel at build time will
# try to download stuff via cmake again, which is not possible in the sandbox.
# This is where I stopped trying for now.
# XXX: retry once typesense has officially released their bazel based build.
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = with maintainers; [ oddlama ];
};
}

View File

@@ -0,0 +1,21 @@
{
"version": "29.0",
"platforms": {
"aarch64-linux": {
"arch": "linux-arm64",
"hash": "sha256-ztjCyK2378tg9yT9D6ProINlMT5GyUIEH8duHivCQ2E="
},
"x86_64-linux": {
"arch": "linux-amd64",
"hash": "sha256-BD0qE1dEVKVUPwO2fMO0SMXiwG9dD0RMnAzkVZitFKA="
},
"x86_64-darwin": {
"arch": "darwin-amd64",
"hash": "sha256-9imHOPW8OkFczuNxXGn3bXFI49BIdUJ5GGh1mrvcMgE="
},
"aarch64-darwin": {
"arch": "darwin-arm64",
"hash": "sha256-yAOR/bGYBQGp8Mllhh0yKyqmItd2+IfLib3W+lIHwr0="
}
}
}

View File

@@ -0,0 +1,43 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq nix-prefetch common-updater-scripts nix coreutils
# shellcheck shell=bash
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
old_version=$(jq -r ".version" sources.json || echo -n "0.0.1")
version=$(curl -s "https://api.github.com/repos/typesense/typesense/releases/latest" | jq -r ".tag_name")
version="${version#v}"
if [[ "$old_version" == "$version" ]]; then
echo "Already up to date!"
exit 0
fi
declare -A platforms=(
[aarch64-linux]="linux-arm64"
[aarch64-darwin]="darwin-arm64"
[x86_64-darwin]="darwin-amd64"
[x86_64-linux]="linux-amd64"
)
sources_tmp="$(mktemp)"
cat <<EOF > "$sources_tmp"
{
"version": "$version",
"platforms": {}
}
EOF
for platform in "${!platforms[@]}"; do
arch="${platforms[$platform]}"
url="https://dl.typesense.org/releases/${version}/typesense-server-${version}-${arch}.tar.gz"
sha256hash="$(nix-prefetch-url --type sha256 "$url")"
hash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$sha256hash")"
echo "$(jq --arg arch "$arch" \
--arg platform "$platform" \
--arg hash "$hash" \
'.platforms += {($platform): {arch: $arch, hash: $hash}}' \
"$sources_tmp")" > "$sources_tmp"
done
cp "$sources_tmp" sources.json

View File

@@ -0,0 +1,44 @@
{
lib,
rustPlatform,
fetchFromGitHub,
installShellFiles,
stdenv,
}:
rustPlatform.buildRustPackage rec {
pname = "typeshare";
version = "1.13.3";
src = fetchFromGitHub {
owner = "1password";
repo = "typeshare";
rev = "v${version}";
hash = "sha256-80wfQGfmzAuxAFS5jRlxLHh39G/5il6EXlrqeoNtkrk=";
};
cargoHash = "sha256-Hmgg+nLtAmOB0h91wwQc2jZLibpWptPpf8Vizuz0jVE=";
nativeBuildInputs = [ installShellFiles ];
buildFeatures = [ "go" ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd typeshare \
--bash <($out/bin/typeshare completions bash) \
--fish <($out/bin/typeshare completions fish) \
--zsh <($out/bin/typeshare completions zsh)
'';
meta = {
description = "Command Line Tool for generating language files with typeshare";
mainProgram = "typeshare";
homepage = "https://github.com/1password/typeshare";
changelog = "https://github.com/1password/typeshare/blob/v${version}/CHANGELOG.md";
license = with lib.licenses; [
asl20 # or
mit
];
maintainers = with lib.maintainers; [ figsoda ];
};
}

View File

@@ -0,0 +1,118 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
makeWrapper,
nix-update-script,
nodejs,
pnpm,
testers,
}:
let
workspace = "@typespec/compiler...";
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "typespec";
version = "1.4.0";
src = fetchFromGitHub {
owner = "microsoft";
repo = "typespec";
tag = "typespec-stable@${finalAttrs.version}";
hash = "sha256-huyEQA+XhlGVxnxUzQH1aIZUE4EbCN6HakitzuDyR18=";
};
nativeBuildInputs = [
makeWrapper
nodejs
pnpm.configHook
];
pnpmWorkspaces = [ workspace ];
pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs)
pname
version
src
pnpmWorkspaces
postPatch
;
fetcherVersion = 1;
hash = "sha256-/Y7KhdNeyUV2CQQWjhYBDDT24oE6UdBO6HTweUUaNqc=";
};
postPatch = ''
# The `packageManager` attribute matches the version _exactly_, which makes
# the build fail if it doesn't match exactly.
substituteInPlace package.json \
--replace-fail '"packageManager": "pnpm@10.11.0"' '"packageManager": "pnpm"'
# `fetchFromGitHub` doesn't clone via git and thus installing would otherwise fail.
substituteInPlace packages/compiler/scripts/generate-manifest.js \
--replace-fail 'execSync("git rev-parse HEAD").toString().trim()' '"${finalAttrs.src.rev}"'
'';
buildPhase = ''
runHook preBuild
pnpm -r --filter ${workspace} build
runHook postBuild
'';
preInstall = ''
# Remove unnecessary files.
find -name node_modules -type d -exec rm -rf {} \; || true
pnpm config set hoist=false
pnpm install --offline --ignore-scripts --frozen-lockfile --filter="@typespec/compiler" --prod --no-optional
'';
installPhase = ''
runHook preInstall
mkdir -p "$out/bin" "$out/lib/typespec"
cp -r --parents \
node_modules/ \
package.json \
packages/compiler/cmd \
packages/compiler/dist \
packages/compiler/entrypoints \
packages/compiler/lib \
packages/compiler/node_modules \
packages/compiler/templates \
packages/compiler/package.json \
"$out/lib/typespec"
makeWrapper "${lib.getExe nodejs}" "$out/bin/tsp" \
--add-flags "$out/lib/typespec/packages/compiler/cmd/tsp.js"
makeWrapper "${lib.getExe nodejs}" "$out/bin/tsp-server" \
--add-flags "$out/lib/typespec/packages/compiler/cmd/tsp-server.js"
runHook postInstall
'';
passthru.tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
};
passthru.updateScript = nix-update-script {
extraArgs = [ ''--version-regex=typespec-stable@(\d+\.\d+\.\d+)'' ];
};
meta = {
description = "Language for defining cloud service APIs and shapes";
longDescription = ''
TypeSpec is a highly extensible language with primitives that can describe
API shapes common among REST, OpenAPI, gRPC, and other protocols.
TypeSpec is excellent for generating many different API description
formats, client and service code, documentation, and many other assets.
All this while keeping your TypeSpec definition as a single source of truth.
'';
homepage = "https://typespec.io/";
changelog = "https://github.com/microsoft/typespec/releases/tag/typespec-stable@${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ paukaifler ];
mainProgram = "tsp";
};
})

View File

@@ -0,0 +1,36 @@
{
lib,
stdenv,
fetchurl,
ncurses,
}:
stdenv.mkDerivation rec {
pname = "typespeed";
version = "0.6.5";
buildInputs = [ ncurses ];
src = fetchurl {
url = "https://typespeed.sourceforge.net/typespeed-${version}.tar.gz";
sha256 = "5c860385ceed8a60f13217cc0192c4c2b4705c3e80f9866f7d72ff306eb72961";
};
patches = [ ./typespeed-config-in-home.patch ];
# Workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: typespeed-typespeed.o:/build/typespeed-0.6.5/src/typespeed.h:69: multiple definition of
# `opt'; typespeed-file.o:/build/typespeed-0.6.5/src/typespeed.h:69: first defined here
env.NIX_CFLAGS_COMPILE = "-fcommon";
configureFlags = [ "--datadir=\${out}/share/" ];
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
meta = with lib; {
description = "Curses based typing game";
mainProgram = "typespeed";
homepage = "https://typespeed.sourceforge.net/";
license = licenses.gpl2Plus;
platforms = platforms.unix;
maintainers = [ maintainers.auntie ];
};
}

View File

@@ -0,0 +1,148 @@
diff --git a/src/file.c b/src/file.c
index d1d1982..1655f6f 100644
--- a/src/file.c
+++ b/src/file.c
@@ -125,6 +125,8 @@ int hcompar(const void *, const void *);
int loadscores(char *);
static int parseline(char *, char **, char **);
void readconfig(void);
+void mkconfig(char *filename);
+void mkscore(char *filename);
static void readfile(char *, int);
static void setoptions(char *, char *, int);
@@ -1125,7 +1127,7 @@ void
readconfig(void)
{
char *envhome;
- char userhigh[MAXPATHLEN], userconf[MAXPATHLEN];
+ char userhigh[MAXPATHLEN], userconf[MAXPATHLEN], confdir[MAXPATHLEN];
struct stat sb;
if (xsnprintf(ruledir, sizeof(ruledir), "%s", RULEDIR)) {
@@ -1140,18 +1142,33 @@ readconfig(void)
readfile(CONFIGFILE, 1);
if ((envhome = getenv("HOME")) == NULL)
- return;
+ xerr(1, "readconfig: environment variable HOME not set");
if (xsnprintf(userconf, sizeof(userconf), "%s/.typespeed/config",
- envhome))
- return;
+ envhome))
+ xerr(1, "readconfig: string error");
+ if (xsnprintf(userhigh, sizeof(userhigh), "%s/.typespeed/score",
+ envhome))
+ xerr(1, "readconfig: string error");
if (stat(userconf, &sb) || (sb.st_mode & S_IFMT) != S_IFREG)
- return;
-
- if (xsnprintf(userhigh, sizeof(userhigh), "%s/.typespeed/score",
- envhome))
- return;
+ {
+ if (xsnprintf(confdir, sizeof(confdir), "%s/.typespeed",
+ envhome))
+ xerr(1, "readconfig: string error");
+ if(stat(confdir, &sb) == -1)
+ if(mkdir(confdir, S_IRWXU | S_IRWXG | S_IRWXO))
+ xerr(1, "readconfig: could not create config directory %s",
+ confdir);
+ /* create the user configuration with default values */
+ mkconfig(userconf);
+ }
+ /* check for the high score file */
+ if (stat(userhigh, &sb) || (sb.st_mode & S_IFMT) != S_IFREG)
+ {
+ /* create a blank high score file */
+ mkscore(userhigh);
+ }
/*
* Open a user writable high score.
@@ -1159,14 +1176,48 @@ readconfig(void)
* file. Protect system-wide high score file with group
* write permissions: privileged gid already dropped.
*/
- if (close(hfd) == -1)
- xerr(1, "readconfig: close");
- if ((hfd = open(userhigh, O_RDWR, 0)) == -1)
+ if ((hfd = open(userhigh, O_RDWR)) == -1)
xerr(1, "readconfig: open: %s", userhigh);
readfile(userconf, 1);
}
+#define DEFAULT_CONFIG "cheat = no\n" \
+ "highorder = score cps tcps\n" \
+ "ruledir = " RULEDIR "\n" \
+ "worddir = " WORDDIR "\n"
+
+/*
+ * Create the user configuration, with default values, at the given path.
+ */
+void
+mkconfig(char *filename)
+{
+ int cfd;
+
+ if((cfd = open(filename, O_WRONLY | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO)) == -1)
+ xerr(1, "mkconfig: open: %s", filename);
+ if(write(cfd, DEFAULT_CONFIG, sizeof(DEFAULT_CONFIG)/sizeof(DEFAULT_CONFIG[0]) - 1) == -1)
+ xerr(1, "mkconfig: write: %s", filename);
+ if(close(cfd) == -1)
+ xerr(1, "mkconfig: close: %s", filename);
+}
+
+/*
+ * Create the user high score file, which is just a blank file.
+ */
+void
+mkscore(char *filename)
+{
+ int sfd;
+ if((sfd = open(filename, O_WRONLY | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO)) == -1)
+ xerr(1, "mkscore: open: %s", filename);
+ if(write(sfd, "", 0) == -1)
+ xerr(1, "mkconfig: write: %s", filename);
+ if(close(sfd) == -1)
+ xerr(1, "mkconfig: close: %s", filename);
+}
+
/*
* Function used to open configuration and game rule files and to
* set options with function setoptions.
diff --git a/src/typespeed.c b/src/typespeed.c
index 7ac5ee2..77e9acb 100644
--- a/src/typespeed.c
+++ b/src/typespeed.c
@@ -319,8 +319,13 @@ main(int argc, char **argv)
progname++;
/* just open high score file while being setgid games */
- if ((hfd = open(HIGHFILE, O_RDWR, 0)) == -1)
- xerr(1, "main: open: %s", HIGHFILE);
+ /*
+ * For NixOS, a global high score file doesn't make sense, so we just comment
+ * this out. A high score file in the user's home directory will be opened
+ * later in readconfig().
+ */
+/* if ((hfd = open(HIGHFILE, O_RDWR, 0)) == -1)
+ xerr(1, "main: open: %s", HIGHFILE); */
#ifndef WIN32
/* drop privileges */
@@ -348,9 +353,9 @@ main(int argc, char **argv)
#endif /* WIN32 */
/* check file descriptors for consistency */
- if (hfd == STDIN_FILENO || hfd == STDOUT_FILENO ||
+/* if (hfd == STDIN_FILENO || hfd == STDOUT_FILENO ||
hfd == STDERR_FILENO)
- exit(1);
+ exit(1); */
if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO) ||
!isatty(STDERR_FILENO))
xerrx(1, "not fully connected to a terminal");

View File

@@ -0,0 +1,68 @@
{
lib,
stdenv,
fetchFromGitLab,
rustPlatform,
meson,
ninja,
pkg-config,
rustc,
cargo,
wrapGAppsHook4,
blueprint-compiler,
desktop-file-utils,
appstream-glib,
openssl,
libadwaita,
libpanel,
gtksourceview5,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "typewriter";
version = "0.1.0";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "JanGernert";
repo = "typewriter";
tag = "v.${finalAttrs.version}";
hash = "sha256-c4wh59RNYMyK1rwoxzjhDCtnGnAxGABAu5cugV3P0zU=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname version src;
hash = "sha256-YvzVpSAPORxjvbGQqRK1V8DKcF12NUOGOgmegJSODQc=";
};
strictDeps = true;
nativeBuildInputs = [
meson
ninja
pkg-config
rustPlatform.cargoSetupHook
rustc
cargo
wrapGAppsHook4
blueprint-compiler
desktop-file-utils
appstream-glib
];
buildInputs = [
openssl
libadwaita
libpanel
gtksourceview5
];
meta = {
mainProgram = "typewriter";
description = "Create documents with typst";
homepage = "https://gitlab.gnome.org/JanGernert/typewriter";
changelog = "https://gitlab.gnome.org/JanGernert/typewriter/-/releases/v.${finalAttrs.version}";
platforms = lib.platforms.linux;
license = lib.licenses.gpl3Plus;
maintainers = [ lib.maintainers.awwpotato ];
};
})

View File

@@ -0,0 +1,13 @@
diff --git a/src/error.rs b/src/error.rs
index 4563e1e..050610d 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -34,7 +34,7 @@ impl fmt::Display for Error {
}
impl error::Error for Error {
- fn source<'a>(&'a self) -> Option<&(dyn error::Error + 'static)> {
+ fn source(&self) -> Option<&(dyn error::Error + 'static)> {
self.reason.as_deref()
}
}

View File

@@ -0,0 +1,51 @@
{
lib,
rustPlatform,
fetchFromGitHub,
installShellFiles,
stdenv,
}:
rustPlatform.buildRustPackage rec {
pname = "typical";
version = "0.12.1";
src = fetchFromGitHub {
owner = "stepchowfun";
repo = "typical";
rev = "v${version}";
hash = "sha256-y7PWTzD9+rkC4wZYhecmDTa3AoWl4Tgh7QXbSK4Qq5Q=";
};
cargoHash = "sha256-+SnwxmNQDj6acr2nEKJkNmR5PqnTIvyMApyZOmCld2U=";
nativeBuildInputs = [
installShellFiles
];
preCheck = ''
export NO_COLOR=true
'';
patches = [
# Related to https://github.com/stepchowfun/typical/pull/501
# Committing a slightly different patch because the upstream one doesn't apply cleanly
./lifetime.patch
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd typical \
--bash <($out/bin/typical shell-completion bash) \
--fish <($out/bin/typical shell-completion fish) \
--zsh <($out/bin/typical shell-completion zsh)
'';
meta = with lib; {
description = "Data interchange with algebraic data types";
mainProgram = "typical";
homepage = "https://github.com/stepchowfun/typical";
changelog = "https://github.com/stepchowfun/typical/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ figsoda ];
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
buildGoModule,
fetchFromGitHub,
testers,
typioca,
}:
buildGoModule rec {
pname = "typioca";
version = "3.1.0";
src = fetchFromGitHub {
owner = "bloznelis";
repo = "typioca";
rev = version;
hash = "sha256-fViYwewzhJUJjMupCYk1UsnnPAhByYZqYkuKD6MJNnE=";
};
vendorHash = "sha256-fUkajuviQuQuVgzWAxsInd+c+eNQArKNjiNsi7mCNWU=";
ldflags = [
"-s"
"-w"
"-X=github.com/bloznelis/typioca/cmd.Version=${version}"
];
passthru.tests = {
version = testers.testVersion {
package = typioca;
};
};
meta = with lib; {
description = "Cozy typing speed tester in terminal";
homepage = "https://github.com/bloznelis/typioca";
changelog = "https://github.com/bloznelis/typioca/releases/tag/${src.rev}";
license = licenses.mit;
maintainers = with maintainers; [ figsoda ];
mainProgram = "typioca";
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
stdenvNoCC,
fetchzip,
}:
stdenvNoCC.mkDerivation {
pname = "typodermic-free-fonts";
version = "2024-04";
src = fetchzip {
url = "https://typodermicfonts.com/wp-content/uploads/2024/04/typodermic-free-fonts-2024b.zip";
hash = "sha256-EbK2wrYdIFmz/gdM+46CNb4Z21jrVYZMh+dtduwC8aI=";
curlOptsList = [
"--user-agent"
"Mozilla/5.0"
]; # unbreak their wordpress
stripRoot = false;
};
dontUnpack = true;
installPhase = ''
runHook preInstall
mkdir -p $out/share/fonts
cp -a "$src/Typodermic Fonts" "$out/share/fonts/opentype"
runHook postInstall
'';
meta = {
homepage = "https://typodermicfonts.com/";
description = "Typodermic fonts";
license = lib.licenses.unfree // {
fullName = "Font Software for Desktop End User License Agreement";
url = "https://typodermicfonts.com/end-user-license-agreement/";
}; # Font is fine for use in printing and display but cannot be embbeded.
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
stdenvNoCC,
fetchzip,
}:
stdenvNoCC.mkDerivation {
pname = "typodermic-public-domain";
version = "2024-04";
src = fetchzip {
url = "https://typodermicfonts.com/wp-content/uploads/2024/04/typodermic-public-domain-2024-04.zip";
hash = "sha256-grAAU/yL/Q1EyZtrvcgrB6bcXMZoNs7suVYaKibqBOE=";
curlOptsList = [
"--user-agent"
"Mozilla/5.0"
]; # unbreak their wordpress
stripRoot = false;
};
dontUnpack = true;
installPhase = ''
runHook preInstall
mkdir -p $out/share/fonts
cp -a "$src/OpenType Fonts" "$out/share/fonts/opentype"
runHook postInstall
'';
meta = {
homepage = "https://typodermicfonts.com/";
description = "Vintage Typodermic fonts";
license = lib.licenses.cc0;
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,143 @@
{
stdenv,
fetchurl,
dpkg,
lib,
glib,
nss,
nspr,
cups,
dbus,
libdrm,
gtk3,
pango,
cairo,
libxkbcommon,
libgbm,
expat,
alsa-lib,
buildFHSEnv,
writeTextFile,
}:
let
pname = "typora";
version = "1.11.5";
src = fetchurl {
urls = [
"https://download.typora.io/linux/typora_${version}_amd64.deb"
"https://downloads.typoraio.cn/linux/typora_${version}_amd64.deb"
];
hash = "sha256-CpUF8pRLzR3RzFD85Cobbmo3BInaeCee0NWKsmelPGs=";
};
typoraBase = stdenv.mkDerivation {
inherit pname version src;
nativeBuildInputs = [ dpkg ];
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share
mv usr/share $out
ln -s $out/share/typora/Typora $out/bin/Typora
runHook postInstall
'';
};
typoraFHS = buildFHSEnv {
pname = "typora-fhs";
inherit version;
targetPkgs =
pkgs:
(with pkgs; [
typoraBase
udev
alsa-lib
glib
nss
nspr
atk
cups
dbus
gtk3
libdrm
pango
cairo
libgbm
libGL
expat
libxkbcommon
])
++ (with pkgs.xorg; [
libX11
libXcursor
libXrandr
libXcomposite
libXdamage
libXext
libXfixes
libxcb
]);
runScript = ''
Typora "$@"
'';
};
launchScript = writeTextFile {
name = "typora-launcher";
executable = true;
text = ''
#!${stdenv.shell}
# Configuration directory setup
XDG_CONFIG_HOME=''${XDG_CONFIG_HOME:-~/.config}
TYPORA_CONFIG_DIR="$XDG_CONFIG_HOME/Typora"
TYPORA_DICT_DIR="$TYPORA_CONFIG_DIR/typora-dictionaries"
# Create config directories with proper permissions
mkdir -p "$TYPORA_DICT_DIR"
chmod 755 "$TYPORA_CONFIG_DIR"
chmod 755 "$TYPORA_DICT_DIR"
# Read user flags if they exist
if [ -f "$XDG_CONFIG_HOME/typora-flags.conf" ]; then
TYPORA_USER_FLAGS="$(sed 's/#.*//' "$XDG_CONFIG_HOME/typora-flags.conf" | tr '\n' ' ')"
fi
exec ${typoraFHS}/bin/typora-fhs "$@" $TYPORA_USER_FLAGS
'';
};
in
stdenv.mkDerivation {
inherit pname version;
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
ln -s ${launchScript} $out/bin/typora
ln -s ${typoraBase}/share/ $out
runHook postInstall
'';
meta = {
description = "A minimal Markdown editor and reader.";
homepage = "https://typora.io/";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ npulidomateo ];
platforms = [ "x86_64-linux" ];
mainProgram = "typora";
};
}

View File

@@ -0,0 +1,35 @@
{
lib,
rustPlatform,
fetchFromGitHub,
}:
rustPlatform.buildRustPackage rec {
pname = "typos-lsp";
# Please update the corresponding VSCode extension too.
# See pkgs/applications/editors/vscode/extensions/tekumara.typos-vscode/default.nix
version = "0.1.45";
src = fetchFromGitHub {
owner = "tekumara";
repo = "typos-lsp";
tag = "v${version}";
hash = "sha256-Yyb2i3ymkxZGmyl3N7hcM2pWuJZRMxcWRNk283wdyy4=";
};
cargoHash = "sha256-FMKS49Uz7gwsXoa9VjVlMwUzZWUJ5D2kOYjQro9iNwE=";
# fix for compilation on aarch64
# see https://github.com/NixOS/nixpkgs/issues/145726
prePatch = ''
rm .cargo/config.toml
'';
meta = with lib; {
description = "Source code spell checker";
homepage = "https://github.com/tekumara/typos-lsp";
changelog = "https://github.com/tekumara/typos-lsp/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ tarantoj ];
mainProgram = "typos-lsp";
};
}

View File

@@ -0,0 +1,50 @@
{
lib,
rustPlatform,
fetchFromGitHub,
versionCheckHook,
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
pname = "typos";
version = "1.38.1";
src = fetchFromGitHub {
owner = "crate-ci";
repo = "typos";
tag = "v${version}";
hash = "sha256-xr3k3wx9EWKm00kt1GxE31Mw5wa3N3VJJCKaUbQa4ic=";
};
cargoHash = "sha256-2XgnCXYqBvx7LRWaPt4iXznIXIEzYBlWMXbwEVZyGA8=";
passthru.updateScript = nix-update-script { };
preCheck = ''
export LC_ALL=C.UTF-8
'';
postCheck = ''
unset LC_ALL
'';
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
versionCheckProgramArg = "--version";
meta = {
description = "Source code spell checker";
mainProgram = "typos";
homepage = "https://github.com/crate-ci/typos";
changelog = "https://github.com/crate-ci/typos/blob/v${version}/CHANGELOG.md";
license = with lib.licenses; [
asl20 # or
mit
];
maintainers = with lib.maintainers; [
figsoda
mgttlinger
];
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
python3Packages,
fetchFromGitHub,
}:
python3Packages.buildPythonApplication rec {
pname = "typr";
version = "1.0.1.21";
pyproject = true;
src = fetchFromGitHub {
owner = "DriftingOtter";
repo = "Typr";
tag = version;
hash = "sha256-49e5tnX/vea3xLJP62Sj2gCdjbfsulIU48X/AR/3IBI=";
};
build-system = with python3Packages; [ setuptools ];
dependencies = with python3Packages; [ rich ];
doCheck = false; # absent
meta = {
homepage = "https://github.com/DriftingOtter/Typr";
description = "Your Personal Typing Tutor";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ artur-sannikov ];
mainProgram = "typr";
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
fetchFromGitHub,
rustPlatform,
pkg-config,
openssl,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "typship";
version = "0.4.2";
src = fetchFromGitHub {
owner = "sjfhsjfh";
repo = "typship";
tag = "v${finalAttrs.version}";
hash = "sha256-LDiKAQmzEgzFJH2NAR3FYsO4SmH5uAEOa6I4A0FnwJk=";
};
cargoHash = "sha256-t4Vnww49CnkBSRsAWKxSpJffuUuqFAxqUN0GtoxnKLY=";
nativeBuildInputs = [
pkg-config
];
buildInputs = [
openssl
];
env = {
OPENSSL_NO_VENDOR = true; # From the typst package
};
meta = {
description = "Typst package CLI tool";
homepage = "https://github.com/sjfhsjfh/typship";
license = lib.licenses.mit;
changelog = "https://github.com/sjfhsjfh/typship/releases/tag/v${finalAttrs.version}";
maintainers = with lib.maintainers; [ heijligen ];
};
})

View File

@@ -0,0 +1,36 @@
{
lib,
rustPlatform,
fetchCrate,
makeWrapper,
typst,
}:
rustPlatform.buildRustPackage rec {
pname = "typst-live";
version = "0.8.0";
src = fetchCrate {
inherit pname version;
hash = "sha256-bR4Rhhs6rAC6C1nfPFj/3rCtfEziuTGn5m33CR0qZkU=";
};
cargoHash = "sha256-C85hV7uCsuRsxH2/8arjz9Pqs5j23s5b9RHmFsRtZSw=";
nativeBuildInputs = [
makeWrapper
];
postInstall = ''
wrapProgram $out/bin/typst-live \
--suffix PATH : ${lib.makeBinPath [ typst ]}
'';
meta = with lib; {
description = "Hot reloading for your typst files";
homepage = "https://github.com/ItsEthra/typst-live";
license = licenses.mit;
maintainers = with maintainers; [ figsoda ];
mainProgram = "typst-live";
};
}

View File

@@ -0,0 +1,79 @@
{
lib,
rustPlatform,
fetchFromGitHub,
installShellFiles,
pkg-config,
openssl,
nix-update-script,
versionCheckHook,
callPackage,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "typst";
version = "0.13.1";
src = fetchFromGitHub {
owner = "typst";
repo = "typst";
tag = "v${finalAttrs.version}";
hash = "sha256-vbBwIQt4xWZaKpXgFwDsRQIQ0mmsQPRR39m8iZnnuj0=";
};
cargoHash = "sha256-4kVj2BODEFjLcrh5sxfcgsdLF2Zd3K1GnhA4DEz1Nl4=";
nativeBuildInputs = [
installShellFiles
pkg-config
];
buildInputs = [
openssl
];
env = {
GEN_ARTIFACTS = "artifacts";
OPENSSL_NO_VENDOR = true;
# to not have "unknown hash" in help output
TYPST_VERSION = finalAttrs.version;
};
# Fix for "Found argument '--test-threads' which wasn't expected, or isn't valid in this context"
postPatch = ''
substituteInPlace tests/src/tests.rs --replace-fail 'ARGS.num_threads' 'ARGS.test_threads'
substituteInPlace tests/src/args.rs --replace-fail 'num_threads' 'test_threads'
'';
postInstall = ''
installManPage crates/typst-cli/artifacts/*.1
installShellCompletion \
crates/typst-cli/artifacts/typst.{bash,fish} \
--zsh crates/typst-cli/artifacts/_typst
'';
cargoTestFlags = [ "--workspace" ];
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
passthru = {
updateScript = nix-update-script { };
packages = callPackage ./typst-packages.nix { };
withPackages = callPackage ./with-packages.nix { };
};
meta = {
changelog = "https://github.com/typst/typst/releases/tag/v${finalAttrs.version}";
description = "New markup-based typesetting system that is powerful and easy to learn";
homepage = "https://github.com/typst/typst";
license = lib.licenses.asl20;
mainProgram = "typst";
maintainers = with lib.maintainers; [
figsoda
kanashimia
RossSmyth
];
};
})

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,53 @@
{
lib,
callPackage,
}:
let
toPackageName = name: version: "${name}_${lib.replaceStrings [ "." ] [ "_" ] version}";
in
lib.makeExtensible (
final:
lib.recurseIntoAttrs (
lib.foldlAttrs (
packageSet: pname: versionSet:
packageSet
// (lib.foldlAttrs (
subPackageSet: version: packageSpec:
subPackageSet
// {
${toPackageName pname version} = callPackage (
{
lib,
buildTypstPackage,
fetchzip,
}:
buildTypstPackage (finalAttrs: {
inherit pname version;
src = fetchzip {
inherit (packageSpec) hash;
url = "https://packages.typst.org/preview/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
stripRoot = false;
};
typstDeps = builtins.filter (x: x != null) (
lib.map (d: (lib.attrsets.attrByPath [ d ] null final)) packageSpec.typstDeps
);
meta = {
inherit (packageSpec) description;
maintainers = with lib.maintainers; [ cherrypiejam ];
license = lib.map (lib.flip lib.getAttr lib.licensesSpdx) packageSpec.license;
}
// (if packageSpec ? "homepage" then { inherit (packageSpec) homepage; } else { });
})
) { };
}
) { } versionSet)
// {
${pname} = final.${toPackageName pname (lib.last (lib.attrNames versionSet))};
}
) { } (lib.importTOML ./typst-packages-from-universe.toml)
)
)

View File

@@ -0,0 +1,34 @@
{
lib,
buildEnv,
typstPackages,
makeBinaryWrapper,
typst,
}:
lib.makeOverridable (
{ ... }@typstPkgs:
f:
buildEnv {
inherit (typst) meta;
name = "${typst.name}-env";
paths = lib.foldl' (acc: p: acc ++ lib.singleton p ++ p.propagatedBuildInputs) [ ] (f typstPkgs);
pathsToLink = [ "/lib/typst-packages" ];
nativeBuildInputs = [ makeBinaryWrapper ];
postBuild = ''
export TYPST_LIB_DIR="$out/lib/typst/packages"
mkdir -p $TYPST_LIB_DIR
mv $out/lib/typst-packages $TYPST_LIB_DIR/preview
cp -r ${typst}/share $out/share
mkdir -p $out/bin
makeWrapper "${lib.getExe typst}" "$out/bin/typst" --set TYPST_PACKAGE_CACHE_PATH $TYPST_LIB_DIR
'';
}
) typstPackages

View File

@@ -0,0 +1,31 @@
{
lib,
rustPlatform,
fetchFromGitHub,
}:
rustPlatform.buildRustPackage rec {
pname = "typstfmt";
version = "0.2.10";
src = fetchFromGitHub {
owner = "astrale-sharp";
repo = "typstfmt";
rev = version;
hash = "sha256-JsNaHeFYr92VdruE87dLj2kPGc9M+ww7AGiGO4Gbbr0=";
};
cargoHash = "sha256-sY2LLBsyRt7Zc84//WZWNq6e7Vx/TtPC/zoDF2Ug7yQ=";
meta = {
changelog = "https://github.com/astrale-sharp/typstfmt/blob/${src.rev}/CHANGELOG.md";
description = "Formatter for the Typst language";
homepage = "https://github.com/astrale-sharp/typstfmt";
license = lib.licenses.mit;
mainProgram = "typstfmt";
maintainers = with lib.maintainers; [
figsoda
geri1701
];
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
python3,
fetchFromGitHub,
}:
python3.pkgs.buildPythonApplication rec {
pname = "typstwriter";
version = "0.3";
pyproject = true;
src = fetchFromGitHub {
owner = "Bzero";
repo = "typstwriter";
tag = "V${version}";
hash = "sha256-0tCl/dMSWmUWZEVystb6BIYTwW7b6PH4LyERK4mi/LQ=";
};
build-system = [ python3.pkgs.flit-core ];
dependencies = with python3.pkgs; [
platformdirs
pygments
pyside6
qtpy
superqt
];
optional-dependencies = with python3.pkgs; {
tests = [
pytest
pytest-qt
];
};
pythonImportsCheck = [ "typstwriter" ];
meta = {
changelog = "https://github.com/Bzero/typstwriter/releases/tag/V${version}";
description = "Integrated editor for the typst typesetting system";
homepage = "https://github.com/Bzero/typstwriter";
license = lib.licenses.mit;
mainProgram = "typstwriter";
maintainers = [ ];
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
rustPlatform,
fetchFromGitHub,
nix-update-script,
versionCheckHook,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "typstyle";
version = "0.13.17";
src = fetchFromGitHub {
owner = "typstyle-rs";
repo = "typstyle";
tag = "v${finalAttrs.version}";
hash = "sha256-JsRMs6ARiXs/S/ybkzNo4giR3BvGbOm8X/UH08kvznU=";
};
cargoHash = "sha256-G7X5FoWHEWFoLqfHmbuSylG7/xp4aXrSugnGc20oZcE=";
# Disabling tests requiring network access
checkFlags = [
"--skip=e2e"
];
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru = {
updateScript = nix-update-script { };
};
meta = {
changelog = "https://github.com/typstyle-rs/typstyle/blob/${finalAttrs.src.tag}/CHANGELOG.md";
description = "Format your typst source code";
homepage = "https://github.com/typstyle-rs/typstyle";
license = lib.licenses.asl20;
mainProgram = "typstyle";
maintainers = with lib.maintainers; [
prince213
];
};
})

View File

@@ -0,0 +1,41 @@
{
lib,
buildGoModule,
fetchFromGitHub,
versionCheckHook,
}:
buildGoModule rec {
pname = "typtea";
version = "0.1.6";
src = fetchFromGitHub {
owner = "ashish0kumar";
repo = "typtea";
tag = "v${version}";
hash = "sha256-3mqUHX/EiRGYVCutnzrXYx7C67CVpawNjokVzvMJBYU=";
};
vendorHash = "sha256-LWY1Tnh4iyNAV7dNjlKdT9IwPJRN25HkEAGSkQIRe9I=";
ldflags = [
"-s"
"-w"
"-X github.com/ashish0kumar/typtea/cmd.version=${version}"
];
doInstallCheck = true;
nativeInstallCheckInputs = [
versionCheckHook
];
meta = {
changelog = "https://github.com/ashish0kumar/typtea/releases/tag/v${version}";
description = "Terminal-based typing speed test with multi-language support";
homepage = "https://github.com/ashish0kumar/typtea";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ashish0kumar ];
mainProgram = "typtea";
platforms = lib.platforms.unix;
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
buildGoModule rec {
pname = "tyson";
version = "0.1.1-unstable-2024-04-10";
src = fetchFromGitHub {
owner = "jetpack-io";
repo = "tyson";
rev = "d6b38819db9b260928b29f4d39bf4c72841c6a01";
hash = "sha256-NoQJBEedV3NDNQ4PVvvjjsO7N+rq40LWKp962P+naEY=";
};
vendorHash = "sha256-kJIfKgVaHuCYvvTZXyuZ/Hg8z1BlW4oW6+5s1inFizg=";
nativeBuildInputs = [
installShellFiles
];
ldflags = [
"-s"
"-w"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd tyson \
--bash <($out/bin/tyson completion bash) \
--fish <($out/bin/tyson completion fish) \
--zsh <($out/bin/tyson completion zsh)
'';
meta = with lib; {
description = "TypeScript as a configuration language";
mainProgram = "tyson";
homepage = "https://github.com/jetify-com/tyson";
changelog = "https://github.com/jetify-com/tyson/releases/tag/${src.rev}";
license = licenses.asl20;
maintainers = with maintainers; [ figsoda ];
};
}