mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
Merge staging-next into staging
This commit is contained in:
commit
b17737e3bc
71 changed files with 1566 additions and 9561 deletions
|
|
@ -45,17 +45,14 @@ If a particular lock file is present, it is a strong indication of which package
|
|||
|
||||
It's better to try to use a Nix tool that understands the lock file.
|
||||
Using a different tool might give you a hard-to-understand error because different packages have been installed.
|
||||
An example of problems that could arise can be found [here](https://github.com/NixOS/nixpkgs/pull/126629).
|
||||
Upstream use npm, but this is an attempt to package it with `yarn2nix` (that uses yarn.lock).
|
||||
|
||||
Using a different tool forces you to commit a lock file to the repository.
|
||||
These files are fairly large, so when packaging for nixpkgs, this approach does not scale well.
|
||||
|
||||
Exceptions to this rule are:
|
||||
|
||||
- When you encounter one of the bugs from a Nix tool. In each of the tool-specific instructions, known problems will be detailed. If you have a problem with a particular tool, then it's best to try another tool, even if this means you will have to re-create a lock file and commit it to Nixpkgs. In general `yarn2nix` has fewer known problems, and so a simple search in Nixpkgs will reveal many `yarn.lock` files committed.
|
||||
- When you encounter one of the bugs from a Nix tool. In each of the tool-specific instructions, known problems will be detailed. If you have a problem with a particular tool, then it's best to try another tool, even if this means you will have to re-create a lock file and commit it to Nixpkgs.
|
||||
- Some lock files contain particular version of a package that has been pulled off npm for some reason. In that case, you can recreate upstream lock (by removing the original and `npm install`, `yarn`, ...) and commit this to nixpkgs.
|
||||
- The only tool that supports workspaces (a feature of npm that helps manage sub-directories with different package.json from a single top level package.json) is `yarn2nix`. If upstream has workspaces you should try `yarn2nix`.
|
||||
|
||||
### Try to use upstream package.json {#javascript-upstream-package-json}
|
||||
|
||||
|
|
@ -92,7 +89,6 @@ Exceptions to this rule are:
|
|||
Each tool has an abstraction to just build the node_modules (dependencies) directory.
|
||||
You can always use the `stdenv.mkDerivation` with the node_modules to build the package (symlink the node_modules directory and then use the package build command).
|
||||
The node_modules abstraction can be also used to build some web framework frontends.
|
||||
For an example of this see how [plausible](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/web-apps/plausible/default.nix) is built. `mkYarnModules` to make the derivation containing node_modules.
|
||||
Then when building the frontend you can just symlink the node_modules directory.
|
||||
|
||||
## Tool-specific instructions {#javascript-tool-specific}
|
||||
|
|
@ -598,139 +594,6 @@ To install the package `yarnInstallHook` uses both `npm` and `yarn` to cleanup p
|
|||
|
||||
- `yarnKeepDevDeps`: Disables the removal of devDependencies from `node_modules` before installation.
|
||||
|
||||
#### yarn2nix {#javascript-yarn2nix}
|
||||
|
||||
> [!WARNING]
|
||||
> The `yarn2nix` functions have been deprecated in favor of `yarnConfigHook`, `yarnBuildHook` and `yarnInstallHook` (for Yarn v1) and `yarn-berry_*.*` tooling (Yarn v3 and v4). Documentation for `yarn2nix` functions still appears here for the sake of the packages that still use them. See also a tracking issue [#324246](https://github.com/NixOS/nixpkgs/issues/324246).
|
||||
|
||||
##### Preparation {#javascript-yarn2nix-preparation}
|
||||
|
||||
You will need at least a `yarn.lock` file. If upstream does not have one you need to generate it and reference it in your package definition.
|
||||
|
||||
If the downloaded files contain the `package.json` and `yarn.lock` files they can be used like this:
|
||||
|
||||
```nix
|
||||
{
|
||||
offlineCache = fetchYarnDeps {
|
||||
yarnLock = src + "/yarn.lock";
|
||||
hash = "....";
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
##### mkYarnPackage {#javascript-yarn2nix-mkYarnPackage}
|
||||
|
||||
> [!WARNING]
|
||||
> The `mkYarnPackage` functions have been deprecated in favor of `yarnConfigHook`, `yarnBuildHook` and `yarnInstallHook` (for Yarn v1) and `yarn-berry_*.*` tooling (Yarn v3 and v4). Documentation for `mkYarnPackage` functions still appears here for the sake of the packages that still use them. See also a tracking issue [#324246](https://github.com/NixOS/nixpkgs/issues/324246).
|
||||
|
||||
`mkYarnPackage` will by default try to generate a binary. For packages only generating static assets (Svelte, Vue, React, Webpack, ...), you will need to explicitly override the build step with your instructions.
|
||||
|
||||
It's important to use the `--offline` flag. For example if you script is `"build": "something"` in `package.json` use:
|
||||
|
||||
```nix
|
||||
{
|
||||
nativeBuildInputs = [ writableTmpDirAsHomeHook ];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
yarn --offline build
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
}
|
||||
```
|
||||
|
||||
The `distPhase` is packing the package's dependencies in a tarball using `yarn pack`. You can disable it using:
|
||||
|
||||
```nix
|
||||
{ doDist = false; }
|
||||
```
|
||||
|
||||
The configure phase can sometimes fail because it makes many assumptions that may not always apply. One common override is:
|
||||
|
||||
```nix
|
||||
{
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
|
||||
ln -s $node_modules node_modules
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
}
|
||||
```
|
||||
|
||||
or if you need a writeable node_modules directory:
|
||||
|
||||
```nix
|
||||
{
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
|
||||
cp -r $node_modules node_modules
|
||||
chmod +w node_modules
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
}
|
||||
```
|
||||
|
||||
##### mkYarnModules {#javascript-yarn2nix-mkYarnModules}
|
||||
|
||||
This will generate a derivation including the `node_modules` directory.
|
||||
If you have to build a derivation for an integrated web framework (Rails, Phoenix, etc.), this is probably the easiest way.
|
||||
|
||||
#### Overriding dependency behavior {#javascript-mkYarnPackage-overriding-dependencies}
|
||||
|
||||
In the `mkYarnPackage` record the property `pkgConfig` can be used to override packages when you encounter problems building.
|
||||
|
||||
For instance, say your package is throwing errors when trying to invoke node-sass:
|
||||
|
||||
```
|
||||
ENOENT: no such file or directory, scandir '/build/source/node_modules/node-sass/vendor'
|
||||
```
|
||||
|
||||
To fix this we will specify different versions of build inputs to use, as well as some post install steps to get the software built the way we want:
|
||||
|
||||
```nix
|
||||
mkYarnPackage rec {
|
||||
pkgConfig = {
|
||||
node-sass = {
|
||||
buildInputs = with final; [
|
||||
python
|
||||
libsass
|
||||
pkg-config
|
||||
];
|
||||
postInstall = ''
|
||||
LIBSASS_EXT=auto yarn --offline run build
|
||||
rm build/config.gypi
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
##### Pitfalls {#javascript-yarn2nix-pitfalls}
|
||||
|
||||
- If version is missing from upstream package.json, yarn will silently install nothing. In that case, you will need to override package.json as shown in the [package.json section](#javascript-upstream-package-json)
|
||||
- Having trouble with `node-gyp`? Try adding these lines to the `yarnPreBuild` steps:
|
||||
|
||||
```nix
|
||||
{
|
||||
yarnPreBuild = ''
|
||||
mkdir -p $HOME/.node-gyp/${nodejs.version}
|
||||
echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion
|
||||
ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version}
|
||||
export npm_config_nodedir=${nodejs}
|
||||
'';
|
||||
}
|
||||
```
|
||||
|
||||
- The `echo 9` steps comes from this answer: <https://stackoverflow.com/a/49139496>
|
||||
- Exporting the headers in `npm_config_nodedir` comes from this issue: <https://github.com/nodejs/node-gyp/issues/1191#issuecomment-301243919>
|
||||
- `offlineCache` (described [above](#javascript-yarn2nix-preparation)) must be specified to avoid [Import From Derivation](#ssec-import-from-derivation) (IFD) when used inside Nixpkgs.
|
||||
|
||||
#### Yarn Berry v3/v4 {#javascript-yarn-v3-v4}
|
||||
Yarn Berry (v3 / v4) have similar formats, they start with blocks like these:
|
||||
|
||||
|
|
|
|||
|
|
@ -448,7 +448,13 @@
|
|||
"index.html#overriding-the-generator",
|
||||
"index.html#javascript-node2nix",
|
||||
"index.html#javascript-node2nix-preparation",
|
||||
"index.html#javascript-node2nix-pitfalls"
|
||||
"index.html#javascript-node2nix-pitfalls",
|
||||
"index.html#javascript-yarn2nix-mkYarnPackage",
|
||||
"index.html#javascript-yarn2nix",
|
||||
"index.html#javascript-yarn2nix-preparation",
|
||||
"index.html#javascript-yarn2nix-mkYarnModules",
|
||||
"index.html#javascript-mkYarnPackage-overriding-dependencies",
|
||||
"index.html#javascript-yarn2nix-pitfalls"
|
||||
],
|
||||
"sec-nixpkgs-release-26.05-lib": [
|
||||
"release-notes.html#sec-nixpkgs-release-26.05-lib"
|
||||
|
|
@ -3720,24 +3726,6 @@
|
|||
"javascript-yarninstallhook": [
|
||||
"index.html#javascript-yarninstallhook"
|
||||
],
|
||||
"javascript-yarn2nix": [
|
||||
"index.html#javascript-yarn2nix"
|
||||
],
|
||||
"javascript-yarn2nix-preparation": [
|
||||
"index.html#javascript-yarn2nix-preparation"
|
||||
],
|
||||
"javascript-yarn2nix-mkYarnPackage": [
|
||||
"index.html#javascript-yarn2nix-mkYarnPackage"
|
||||
],
|
||||
"javascript-yarn2nix-mkYarnModules": [
|
||||
"index.html#javascript-yarn2nix-mkYarnModules"
|
||||
],
|
||||
"javascript-mkYarnPackage-overriding-dependencies": [
|
||||
"index.html#javascript-mkYarnPackage-overriding-dependencies"
|
||||
],
|
||||
"javascript-yarn2nix-pitfalls": [
|
||||
"index.html#javascript-yarn2nix-pitfalls"
|
||||
],
|
||||
"javascript-yarnBerry-missing-hashes": [
|
||||
"index.html#javascript-yarnBerry-missing-hashes"
|
||||
],
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@
|
|||
adding `pkg-config`, `xfce4-dev-tools`, and `wrapGAppsHook3` to your `nativeBuildInputs` and
|
||||
`--enable-maintainer-mode` to your `configureFlags`.
|
||||
|
||||
- `yarn2nix`/`yarn2nix-moretea` and its tooling(`mkYarnPackage`, `mkYarnModules`, and `fixup_yarn_lock`) have been removed as they were unmaintainable in nixpkgs. If you want to build with Yarn V1 going forward, use the hooks instead(`yarnBuildHook`, `yarnConfigHook`, and `yarnInstallHook`). See the yarn v1 documentation in the nixpkgs manual for more details.
|
||||
|
||||
- `albert` has been updated to the version 34.0.5. This release redesigns the query system to support stateful asynchronous handlers and infinite scrolling, and adds internationalized tokenization.
|
||||
This update introduces several breaking changes: the Python plugin interface is now v5.0, the `PATH` plugin has been renamed to `Commandline`, and the QStylesheets-based widgets box model frontend has been removed.
|
||||
For more information read the [changelog for 34.0.0](https://albertlauncher.github.io/2026/01/19/albert-v34.0.0-released/).
|
||||
|
|
@ -284,6 +286,8 @@
|
|||
|
||||
- The `libcxxhardeningextensive` hardening flag has been **disabled** by default. Enabling it by default in 25.11 was unintentional and may have had a negative effect on performance in some cases. `libcxxhardeningfast` remains enabled by default.
|
||||
|
||||
- The packages `ibtool`, `actool` and `re-plistbuddy` have been added, providing reimplementations of the corresponding proprietary Apple tools. They are more compatible with the originals than the previously existing `xcbuild` package, and should enable more darwin software to be built from source.
|
||||
|
||||
- Switch inhibitors were introduced, which add a pre-switch check that compares a list of strings between the previous and the new generation, and refuses to switch into the new generation when there is a difference between the two lists. This allows to avoid switching into a system when for instance the systemd version changed by adding `config.systemd.package.version` to the switch inhibitors for your system. You can still forcefully switch into any generation by setting `NIXOS_NO_CHECK=1`.
|
||||
|
||||
- GNU Taler has been updated to version 1.3.
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ in
|
|||
description = ''
|
||||
Addresses (IPv4 or IPv6) to listen on for connections by the reverse proxy/tls terminator.
|
||||
If set to `null`, tuwunel will listen on IPv4 and IPv6 localhost.
|
||||
Must be `null` if `unix_socket_path` is set.
|
||||
'';
|
||||
};
|
||||
global.port = lib.mkOption {
|
||||
|
|
@ -167,14 +166,6 @@ in
|
|||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = !(cfg.settings ? global.unix_socket_path) || !(cfg.settings ? global.address);
|
||||
message = ''
|
||||
In `services.matrix-tuwunel.settings.global`, `unix_socket_path` and `address` cannot be set at the
|
||||
same time.
|
||||
Leave one of the two options unset or explicitly set them to `null`.
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = cfg.user != defaultUser -> config ? users.users.${cfg.user};
|
||||
message = "If `services.matrix-tuwunel.user` is changed, the configured user must already exist.";
|
||||
|
|
|
|||
|
|
@ -240,11 +240,11 @@ in
|
|||
requires = [
|
||||
"network-online.target"
|
||||
]
|
||||
++ lib.optionals cfg.database.createLocally [ "postgresql.service" ];
|
||||
++ lib.optionals cfg.database.createLocally [ "postgresql.target" ];
|
||||
after = [
|
||||
"network-online.target"
|
||||
]
|
||||
++ lib.optionals cfg.database.createLocally [ "postgresql.service" ];
|
||||
++ lib.optionals cfg.database.createLocally [ "postgresql.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
environment = cfg.environment // {
|
||||
# Required, otherwise chrome dumps core
|
||||
|
|
@ -262,12 +262,12 @@ in
|
|||
"network-online.target"
|
||||
"linkwarden.service"
|
||||
]
|
||||
++ lib.optionals cfg.database.createLocally [ "postgresql.service" ];
|
||||
++ lib.optionals cfg.database.createLocally [ "postgresql.target" ];
|
||||
after = [
|
||||
"network-online.target"
|
||||
"linkwarden.service"
|
||||
]
|
||||
++ lib.optionals cfg.database.createLocally [ "postgresql.service" ];
|
||||
++ lib.optionals cfg.database.createLocally [ "postgresql.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
environment = cfg.environment // {
|
||||
# Required, otherwise chrome dumps core
|
||||
|
|
|
|||
|
|
@ -3,17 +3,50 @@
|
|||
name = "dawarich-nixos";
|
||||
|
||||
nodes.machine =
|
||||
{ pkgs, ... }:
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
services.dawarich = {
|
||||
enable = true;
|
||||
localDomain = "localhost";
|
||||
};
|
||||
|
||||
environment.etc.geojson.source = pkgs.fetchurl {
|
||||
url = "https://github.com/Freika/dawarich/raw/8c24764aa56a084e980e21bc2ffd13a72fd611db/spec/fixtures/files/geojson/export.json";
|
||||
hash = "sha256-qI00E5ixKTRJduAD+qB3JzvrpoJmC55llNtSiPVyxz4=";
|
||||
};
|
||||
environment.etc.geojson.text =
|
||||
let
|
||||
# based on https://github.com/Freika/dawarich/raw/8c24764aa56a084e980e21bc2ffd13a72fd611db/spec/fixtures/files/geojson/export.json
|
||||
# but with different timestamps to avoid points being flagged as anomalies
|
||||
points = map (i: {
|
||||
lat = i / 10.0;
|
||||
lon = i / 10.0;
|
||||
timestamp = 1609459200 + i * 1000;
|
||||
}) (lib.range 1 10);
|
||||
|
||||
mkGeoJsonPoint =
|
||||
{
|
||||
lat,
|
||||
lon,
|
||||
timestamp,
|
||||
}:
|
||||
{
|
||||
type = "Feature";
|
||||
geometry = {
|
||||
type = "Point";
|
||||
coordinates = [
|
||||
lon
|
||||
lat
|
||||
];
|
||||
};
|
||||
properties = {
|
||||
altitude = 1;
|
||||
vertical_accuracy = 1;
|
||||
accuracy = 1;
|
||||
inherit timestamp;
|
||||
};
|
||||
};
|
||||
in
|
||||
builtins.toJSON {
|
||||
type = "FeatureCollection";
|
||||
features = map mkGeoJsonPoint points;
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
|
|
|
|||
|
|
@ -42,15 +42,15 @@ let
|
|||
isDarwin = stdenv.hostPlatform.isDarwin;
|
||||
supported = {
|
||||
x86_64-linux = {
|
||||
hash = "sha256-4EMCbRdPUNOmvW2c2BgdzvPLr7lWAzAKarUI9nBVBeI=";
|
||||
hash = "sha256-5L4PrwcZ/Q3g6qlCsCebx3czLZVD2sDrDf99l9nooSo=";
|
||||
arch = "linux-x64";
|
||||
};
|
||||
aarch64-linux = {
|
||||
hash = "sha256-bjs2xNhd/dTDlhRjC5TunV8jEV187dEduLGuuX/oUnI=";
|
||||
hash = "sha256-nQNDPfk6BRHp7veyx18GMlEt3Xa8iDuqtHG7qzJcPS4=";
|
||||
arch = "linux-arm64";
|
||||
};
|
||||
aarch64-darwin = {
|
||||
hash = "sha256-EZE9Vk1GRFNUiXCqohjNrNeZ/o5wl6tvamn6+tgoKGI=";
|
||||
hash = "sha256-jhoa9UcYg2Uj8x9AZwAh68k7WCi6mpgNUUx2YsRIkjw=";
|
||||
arch = "darwin-arm64";
|
||||
};
|
||||
};
|
||||
|
|
@ -63,7 +63,7 @@ vscode-utils.buildVscodeMarketplaceExtension {
|
|||
mktplcRef = base // {
|
||||
name = "cpptools";
|
||||
publisher = "ms-vscode";
|
||||
version = "1.31.4";
|
||||
version = "1.31.5";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@
|
|||
}:
|
||||
mkLibretroCore {
|
||||
core = "fmsx";
|
||||
version = "0-unstable-2026-03-31";
|
||||
version = "0-unstable-2026-04-20";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "libretro";
|
||||
repo = "fmsx-libretro";
|
||||
rev = "6b807c588d63677770f7f2ed8b94ca0e9da256ce";
|
||||
hash = "sha256-vA9ODUtmmrDPbZjmRJ9IIFELLTD8g8aHmQdo/B/d1fQ=";
|
||||
rev = "3933db571485b7c6572968f154fa8621c5568357";
|
||||
hash = "sha256-hKN/SEnUJW1F4d6unC5k5J95pq0rNMQzLFIfIQL+0v4=";
|
||||
};
|
||||
|
||||
makefile = "Makefile";
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@
|
|||
}:
|
||||
mkLibretroCore {
|
||||
core = "mesen";
|
||||
version = "0-unstable-2026-03-31";
|
||||
version = "0-unstable-2026-04-20";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "libretro";
|
||||
repo = "mesen";
|
||||
rev = "4df4d3681e89321cd4e571ee5cacfdef91842566";
|
||||
hash = "sha256-f067kvu+Pp27iJiVAZczg49Qxz9DVPnGw/Hjwi6+a0Y=";
|
||||
rev = "0102910c39ad1a62bc3f784466f3f67ca9eae335";
|
||||
hash = "sha256-fDGG6U+yhpbcvKuSN30F0dM+NCXlPTPULNEqTZTL/Vc=";
|
||||
};
|
||||
|
||||
makefile = "Makefile";
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@
|
|||
}:
|
||||
mkLibretroCore {
|
||||
core = "play";
|
||||
version = "0-unstable-2026-04-13";
|
||||
version = "0-unstable-2026-04-23";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jpd002";
|
||||
repo = "Play-";
|
||||
rev = "3fc06a0e010a85aa296eabab266697f8012a8d74";
|
||||
hash = "sha256-OKvsJqgn561ncoGnPweuMsrdcrY/r7rSlv+Ow05wxBY=";
|
||||
rev = "158ec0cbdadc8778093016c9acbec9af45a9aab4";
|
||||
hash = "sha256-UXvFsFwymGqk7GfI4qMyxEy71PqHLitV9E+C2iavud4=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -54,11 +54,11 @@
|
|||
"vendorHash": "sha256-Y/r9gdvPhN27nve+IZyqypZkvCXHE7Ox31JLDQd9l4k="
|
||||
},
|
||||
"aminueza_minio": {
|
||||
"hash": "sha256-rAdHPVw/G5uO/67yLOohHvO3/KxjyQkIpagKPd0vMOQ=",
|
||||
"hash": "sha256-UvuHbb8aeh1pKFY9VLUdxwYZVYLRVEFCZrL/NrmpnGc=",
|
||||
"homepage": "https://registry.terraform.io/providers/aminueza/minio",
|
||||
"owner": "aminueza",
|
||||
"repo": "terraform-provider-minio",
|
||||
"rev": "v3.32.1",
|
||||
"rev": "v3.33.1",
|
||||
"spdx": "AGPL-3.0",
|
||||
"vendorHash": "sha256-4Jsi6YkjWakH53Ub/CALDYfL1UC/xWRBvAmJTpHTVtk="
|
||||
},
|
||||
|
|
@ -274,13 +274,13 @@
|
|||
"vendorHash": "sha256-3o6YRDrq4rQhNAFyqiGJrAoxuAykWw85OExRGSE3kGI="
|
||||
},
|
||||
"datadog_datadog": {
|
||||
"hash": "sha256-QAmtZnmdHlKI+lLqBsH6SpshxwpBvAaXWspj/a4vlpI=",
|
||||
"hash": "sha256-HgbGKqQ27GBA2BpiwkkLIvLcNCgh05p6ZNno8cNFUso=",
|
||||
"homepage": "https://registry.terraform.io/providers/DataDog/datadog",
|
||||
"owner": "DataDog",
|
||||
"repo": "terraform-provider-datadog",
|
||||
"rev": "v4.5.0",
|
||||
"rev": "v4.6.0",
|
||||
"spdx": "MPL-2.0",
|
||||
"vendorHash": "sha256-RVDQ7HeZkSryb6ocZJeEx2iIgw411+SByEopg7Q+b1c="
|
||||
"vendorHash": "sha256-Q4fJbEvV6nvp9mafrOrGnKwyWmNT9CYenAeXND5hKng="
|
||||
},
|
||||
"datadrivers_nexus": {
|
||||
"hash": "sha256-yfxlDln4brI8QTFnhVsNOO3vRiqft3YWytvy2GMNBdY=",
|
||||
|
|
@ -499,13 +499,13 @@
|
|||
"vendorHash": "sha256-MYVkNvJ+rbwGw0htClIbmxk3YX2OK/ZO/QOTyMRFiug="
|
||||
},
|
||||
"hashicorp_aws": {
|
||||
"hash": "sha256-EaNOYM4qpWiAsemTOMpFFwJLcrlOxMVgjuECh4KhUsM=",
|
||||
"hash": "sha256-ztoQ8xF42QdVNNBEh1Gcpvs1WjRwNB1RDTbU97sQ5jo=",
|
||||
"homepage": "https://registry.terraform.io/providers/hashicorp/aws",
|
||||
"owner": "hashicorp",
|
||||
"repo": "terraform-provider-aws",
|
||||
"rev": "v6.38.0",
|
||||
"rev": "v6.42.0",
|
||||
"spdx": "MPL-2.0",
|
||||
"vendorHash": "sha256-picwxtQOtsBX8SkA64+ekFNDC7zIpg0CG66kelO2THk="
|
||||
"vendorHash": "sha256-koqH8h1oixv+cH6y9Z5mjgIVGB/XWHSo/UCgQW6bh2U="
|
||||
},
|
||||
"hashicorp_awscc": {
|
||||
"hash": "sha256-wRuw+7z/CyAyqL4b6iKLqMuon4UcNxf8pBYHbt90FGw=",
|
||||
|
|
@ -706,13 +706,13 @@
|
|||
"vendorHash": null
|
||||
},
|
||||
"hetznercloud_hcloud": {
|
||||
"hash": "sha256-7c6sOPLH38D2sJsS9VoFl9LkZ0CNp5bFFyrVzPnXPYs=",
|
||||
"hash": "sha256-KDtsI3AKz4xFFBxiPmjP3nHA4MDbs0ubEZPcG8HtCv0=",
|
||||
"homepage": "https://registry.terraform.io/providers/hetznercloud/hcloud",
|
||||
"owner": "hetznercloud",
|
||||
"repo": "terraform-provider-hcloud",
|
||||
"rev": "v1.60.1",
|
||||
"rev": "v1.61.0",
|
||||
"spdx": "MPL-2.0",
|
||||
"vendorHash": "sha256-rd7QuDdq7xRMyaQIDyXY1DI2Tt/wy3oXan/nE0HIyT0="
|
||||
"vendorHash": "sha256-4XBSqaUCiYyCeWCFBuguuy/0z/4+UoKfySey4vlvNLk="
|
||||
},
|
||||
"huaweicloud_huaweicloud": {
|
||||
"hash": "sha256-Eg811AwJwuHZ/270+TNh6JskCGRUt0ikk6yShjtVtcU=",
|
||||
|
|
@ -751,13 +751,13 @@
|
|||
"vendorHash": null
|
||||
},
|
||||
"integrations_github": {
|
||||
"hash": "sha256-tygj+fCzKhipsyXVMtUxjEy/TvIAGFBPYHwlJJulAVI=",
|
||||
"hash": "sha256-lP2z7RTaiLvnKQ2nyyUUOV9KjcLAKBDUyIqi0Lv1mqQ=",
|
||||
"homepage": "https://registry.terraform.io/providers/integrations/github",
|
||||
"owner": "integrations",
|
||||
"repo": "terraform-provider-github",
|
||||
"rev": "v6.11.1",
|
||||
"rev": "v6.12.0",
|
||||
"spdx": "MIT",
|
||||
"vendorHash": null
|
||||
"vendorHash": "sha256-qzyV/rgQ79XvoTBRjjIsPFfqAXLROiIAlY7Y/d8SYcM="
|
||||
},
|
||||
"jfrog_artifactory": {
|
||||
"hash": "sha256-BSUOmqHwnDEYojtwTXBWo9oGG2FbgaODUKClZPCaK/I=",
|
||||
|
|
|
|||
416
pkgs/build-support/rust/fetch-cargo-vendor-util-v2.py
Normal file
416
pkgs/build-support/rust/fetch-cargo-vendor-util-v2.py
Normal file
|
|
@ -0,0 +1,416 @@
|
|||
import functools
|
||||
import hashlib
|
||||
import json
|
||||
import multiprocessing as mp
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tomllib
|
||||
from os.path import islink, realpath
|
||||
from pathlib import Path
|
||||
from typing import Any, TypedDict, cast
|
||||
from urllib.parse import unquote
|
||||
|
||||
import requests
|
||||
import tomli_w
|
||||
from requests.adapters import HTTPAdapter, Retry
|
||||
|
||||
eprint = functools.partial(print, file=sys.stderr)
|
||||
|
||||
|
||||
def load_toml(path: Path) -> dict[str, Any]:
|
||||
with open(path, "rb") as f:
|
||||
return tomllib.load(f)
|
||||
|
||||
|
||||
def get_lockfile_version(cargo_lock_toml: dict[str, Any]) -> int:
|
||||
# lockfile v1 and v2 don't have the `version` key, so assume v2
|
||||
version = cargo_lock_toml.get("version", 2)
|
||||
|
||||
# TODO: add logic for differentiating between v1 and v2
|
||||
|
||||
return version
|
||||
|
||||
|
||||
def create_http_session() -> requests.Session:
|
||||
retries = Retry(
|
||||
total=5,
|
||||
backoff_factor=0.5,
|
||||
status_forcelist=[500, 502, 503, 504]
|
||||
)
|
||||
session = requests.Session()
|
||||
session.headers["User-Agent"] = "nixpkgs-fetchCargoVendor/2 (https://github.com/NixOS/nixpkgs)"
|
||||
session.mount('http://', HTTPAdapter(max_retries=retries))
|
||||
session.mount('https://', HTTPAdapter(max_retries=retries))
|
||||
return session
|
||||
|
||||
|
||||
def download_file_with_checksum(session: requests.Session, url: str, destination_path: Path) -> str:
|
||||
sha256_hash = hashlib.sha256()
|
||||
with session.get(url, stream=True) as response:
|
||||
if not response.ok:
|
||||
raise Exception(f"Failed to fetch file from {url}. Status code: {response.status_code}")
|
||||
with open(destination_path, "wb") as file:
|
||||
for chunk in response.iter_content(1024): # Download in chunks
|
||||
if chunk: # Filter out keep-alive chunks
|
||||
file.write(chunk)
|
||||
sha256_hash.update(chunk)
|
||||
|
||||
# Compute the final checksum
|
||||
checksum = sha256_hash.hexdigest()
|
||||
return checksum
|
||||
|
||||
|
||||
def get_download_url_for_tarball(pkg: dict[str, Any]) -> str:
|
||||
# TODO: support other registries
|
||||
# maybe fetch config.json from the registry root and get the dl key
|
||||
# See: https://doc.rust-lang.org/cargo/reference/registry-index.html#index-configuration
|
||||
if pkg["source"] != "registry+https://github.com/rust-lang/crates.io-index":
|
||||
raise Exception("Only the default crates.io registry is supported.")
|
||||
|
||||
# Use static.crates.io (CDN) instead of crates.io/api to avoid the 1 req/sec
|
||||
# rate limit on the API servers.
|
||||
return f"https://static.crates.io/crates/{pkg["name"]}/{pkg["version"]}/download"
|
||||
|
||||
|
||||
def download_tarball(session: requests.Session, pkg: dict[str, Any], out_dir: Path) -> None:
|
||||
|
||||
url = get_download_url_for_tarball(pkg)
|
||||
filename = f"{pkg["name"]}-{pkg["version"]}.tar.gz"
|
||||
|
||||
# TODO: allow legacy checksum specification, see importCargoLock for example
|
||||
# also, don't forget about the other usage of the checksum
|
||||
expected_checksum = pkg["checksum"]
|
||||
|
||||
tarball_out_dir = out_dir / "tarballs" / filename
|
||||
eprint(f"Fetching {url} -> tarballs/{filename}")
|
||||
|
||||
calculated_checksum = download_file_with_checksum(session, url, tarball_out_dir)
|
||||
|
||||
if calculated_checksum != expected_checksum:
|
||||
raise Exception(f"Hash mismatch! File fetched from {url} had checksum {calculated_checksum}, expected {expected_checksum}.")
|
||||
|
||||
|
||||
def download_git_tree(url: str, git_sha_rev: str, out_dir: Path) -> None:
|
||||
|
||||
tree_out_dir = out_dir / "git" / git_sha_rev
|
||||
eprint(f"Fetching {url}#{git_sha_rev} -> git/{git_sha_rev}")
|
||||
|
||||
cmd = ["nix-prefetch-git", "--builder", "--quiet", "--fetch-submodules", "--url", url, "--rev", git_sha_rev, "--out", str(tree_out_dir)]
|
||||
subprocess.check_output(cmd)
|
||||
|
||||
|
||||
GIT_SOURCE_REGEX = re.compile("git\\+(?P<url>[^?]+)(\\?(?P<type>rev|tag|branch)=(?P<value>.*))?#(?P<git_sha_rev>.*)")
|
||||
|
||||
|
||||
class GitSourceInfo(TypedDict):
|
||||
url: str
|
||||
type: str | None
|
||||
value: str | None
|
||||
git_sha_rev: str
|
||||
|
||||
|
||||
def parse_git_source(source: str, lockfile_version: int) -> GitSourceInfo:
|
||||
match = GIT_SOURCE_REGEX.match(source)
|
||||
if match is None:
|
||||
raise Exception(f"Unable to process git source: {source}.")
|
||||
|
||||
source_info = cast(GitSourceInfo, match.groupdict(default=None))
|
||||
|
||||
# the source URL is URL-encoded in lockfile_version >=4
|
||||
# since we just used regex to parse it we have to manually decode the escaped branch/tag name
|
||||
if lockfile_version >= 4 and source_info["value"] is not None:
|
||||
source_info["value"] = unquote(source_info["value"])
|
||||
|
||||
return source_info
|
||||
|
||||
|
||||
def create_vendor_staging(lockfile_path: Path, out_dir: Path) -> None:
|
||||
cargo_lock_toml = load_toml(lockfile_path)
|
||||
lockfile_version = get_lockfile_version(cargo_lock_toml)
|
||||
|
||||
git_packages: list[dict[str, Any]] = []
|
||||
registry_packages: list[dict[str, Any]] = []
|
||||
|
||||
for pkg in cargo_lock_toml["package"]:
|
||||
# ignore local dependenices
|
||||
if "source" not in pkg.keys():
|
||||
eprint(f"Skipping local dependency: {pkg["name"]}")
|
||||
continue
|
||||
source = pkg["source"]
|
||||
|
||||
if source.startswith("git+"):
|
||||
git_packages.append(pkg)
|
||||
elif source.startswith("registry+"):
|
||||
registry_packages.append(pkg)
|
||||
else:
|
||||
raise Exception(f"Can't process source: {source}.")
|
||||
|
||||
git_sha_rev_to_url: dict[str, str] = {}
|
||||
for pkg in git_packages:
|
||||
source_info = parse_git_source(pkg["source"], lockfile_version)
|
||||
git_sha_rev_to_url[source_info["git_sha_rev"]] = source_info["url"]
|
||||
|
||||
out_dir.mkdir(exist_ok=True)
|
||||
shutil.copy(lockfile_path, out_dir / "Cargo.lock")
|
||||
|
||||
# fetch git trees sequentially, since fetching concurrently leads to flaky behaviour
|
||||
if len(git_packages) != 0:
|
||||
(out_dir / "git").mkdir()
|
||||
for git_sha_rev, url in git_sha_rev_to_url.items():
|
||||
download_git_tree(url, git_sha_rev, out_dir)
|
||||
|
||||
# run tarball download jobs in parallel, with at most 5 concurrent download jobs
|
||||
with mp.Pool(min(5, mp.cpu_count())) as pool:
|
||||
if len(registry_packages) != 0:
|
||||
(out_dir / "tarballs").mkdir()
|
||||
session = create_http_session()
|
||||
tarball_args_gen = ((session, pkg, out_dir) for pkg in registry_packages)
|
||||
pool.starmap(download_tarball, tarball_args_gen)
|
||||
|
||||
|
||||
def get_manifest_metadata(manifest_path: Path) -> dict[str, Any]:
|
||||
cmd = ["cargo", "metadata", "--format-version", "1", "--no-deps", "--manifest-path", str(manifest_path)]
|
||||
output = subprocess.check_output(cmd)
|
||||
return json.loads(output)
|
||||
|
||||
|
||||
def try_get_crate_manifest_path_from_manifest_path(manifest_path: Path, crate_name: str) -> Path | None:
|
||||
try:
|
||||
metadata = get_manifest_metadata(manifest_path)
|
||||
except subprocess.CalledProcessError:
|
||||
eprint(f"Warning: cargo metadata failed for {manifest_path}, skipping")
|
||||
return None
|
||||
|
||||
for pkg in metadata["packages"]:
|
||||
if pkg["name"] == crate_name:
|
||||
return Path(pkg["manifest_path"])
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def find_crate_manifest_in_tree(tree: Path, crate_name: str) -> Path:
|
||||
# Scan all Cargo.toml files; sort by depth/path to make ordering deterministic
|
||||
# and prefer less-nested manifests first.
|
||||
manifest_paths = sorted(
|
||||
tree.glob("**/Cargo.toml"),
|
||||
key=lambda path: (len(path.parts), str(path)),
|
||||
)
|
||||
|
||||
for manifest_path in manifest_paths:
|
||||
res = try_get_crate_manifest_path_from_manifest_path(manifest_path, crate_name)
|
||||
if res is not None:
|
||||
return res
|
||||
|
||||
raise Exception(f"Couldn't find manifest for crate {crate_name} inside {tree}.")
|
||||
|
||||
|
||||
def copy_and_patch_git_crate_subtree(git_tree: Path, crate_name: str, crate_out_dir: Path) -> None:
|
||||
|
||||
# This function will get called by copytree to decide which entries of a directory should be copied
|
||||
# We'll copy everything except symlinks that are invalid
|
||||
def ignore_func(dir_str: str, path_strs: list[str]) -> list[str]:
|
||||
ignorelist: list[str] = []
|
||||
|
||||
dir = Path(realpath(dir_str, strict=True))
|
||||
|
||||
for path_str in path_strs:
|
||||
path = dir / path_str
|
||||
if not islink(path):
|
||||
continue
|
||||
|
||||
# Filter out cyclic symlinks and symlinks pointing at nonexistant files
|
||||
try:
|
||||
target_path = Path(realpath(path, strict=True))
|
||||
except OSError:
|
||||
ignorelist.append(path_str)
|
||||
eprint(f"Failed to resolve symlink, ignoring: {path}")
|
||||
continue
|
||||
|
||||
# Filter out symlinks that point outside of the current crate's base git tree
|
||||
# This can be useful if the nix build sandbox is turned off and there is a symlink to a common absolute path
|
||||
if not target_path.is_relative_to(git_tree):
|
||||
ignorelist.append(path_str)
|
||||
eprint(f"Symlink points outside of the crate's base git tree, ignoring: {path} -> {target_path}")
|
||||
continue
|
||||
|
||||
return ignorelist
|
||||
|
||||
crate_manifest_path = find_crate_manifest_in_tree(git_tree, crate_name)
|
||||
crate_tree = crate_manifest_path.parent
|
||||
|
||||
eprint(f"Copying to {crate_out_dir}")
|
||||
shutil.copytree(crate_tree, crate_out_dir, ignore=ignore_func)
|
||||
crate_out_dir.chmod(0o755)
|
||||
|
||||
with open(crate_manifest_path, "r") as f:
|
||||
manifest_data = f.read()
|
||||
|
||||
if "workspace" in manifest_data:
|
||||
crate_manifest_metadata = get_manifest_metadata(crate_manifest_path)
|
||||
workspace_root = Path(crate_manifest_metadata["workspace_root"])
|
||||
|
||||
root_manifest_path = workspace_root / "Cargo.toml"
|
||||
manifest_path = crate_out_dir / "Cargo.toml"
|
||||
|
||||
manifest_path.chmod(0o644)
|
||||
eprint(f"Patching {manifest_path}")
|
||||
|
||||
cmd = ["replace-workspace-values", str(manifest_path), str(root_manifest_path)]
|
||||
subprocess.check_output(cmd)
|
||||
|
||||
|
||||
def extract_crate_tarball_contents(tarball_path: Path, crate_out_dir: Path) -> None:
|
||||
eprint(f"Unpacking to {crate_out_dir}")
|
||||
crate_out_dir.mkdir()
|
||||
cmd = ["tar", "xf", str(tarball_path), "-C", str(crate_out_dir), "--strip-components=1"]
|
||||
subprocess.check_output(cmd)
|
||||
|
||||
|
||||
def make_git_source_selector(source_info: GitSourceInfo) -> dict[str, str]:
|
||||
selector = {}
|
||||
selector["git"] = source_info["url"]
|
||||
if source_info["type"] is not None:
|
||||
selector[source_info["type"]] = source_info["value"]
|
||||
return selector
|
||||
|
||||
|
||||
def make_registry_source_selector(source: str) -> dict[str, str]:
|
||||
registry = source[9:] if source.startswith("registry+") else source
|
||||
selector = {}
|
||||
selector["registry"] = registry
|
||||
return selector
|
||||
|
||||
|
||||
def create_vendor(vendor_staging_dir: Path, out_dir: Path) -> None:
|
||||
lockfile_path = vendor_staging_dir / "Cargo.lock"
|
||||
out_dir.mkdir(exist_ok=True)
|
||||
shutil.copy(lockfile_path, out_dir / "Cargo.lock")
|
||||
|
||||
cargo_lock_toml = load_toml(lockfile_path)
|
||||
lockfile_version = get_lockfile_version(cargo_lock_toml)
|
||||
|
||||
source_to_ind: dict[str, str] = {}
|
||||
source_config = {}
|
||||
next_registry_ind = 0
|
||||
next_git_ind = 0
|
||||
|
||||
def add_source_replacement(
|
||||
orig_key: str,
|
||||
orig_selector: dict[str, str],
|
||||
vendored_key: str,
|
||||
vendored_dir: str
|
||||
) -> None:
|
||||
source_config[vendored_key] = {}
|
||||
source_config[vendored_key]["directory"] = vendored_dir
|
||||
source_config[orig_key] = orig_selector
|
||||
source_config[orig_key]["replace-with"] = vendored_key
|
||||
|
||||
# we reserve registry index 0 for crates-io
|
||||
source_to_ind["registry+https://github.com/rust-lang/crates.io-index"] = "registry-0"
|
||||
source_to_ind["sparse+https://index.crates.io/"] = "registry-0"
|
||||
add_source_replacement(
|
||||
orig_key="crates-io",
|
||||
orig_selector={}, # there is an internal selector defined for the `crates-io` source
|
||||
vendored_key="vendored-source-registry-0",
|
||||
vendored_dir="@vendor@/source-registry-0"
|
||||
)
|
||||
next_registry_ind += 1
|
||||
|
||||
for pkg in cargo_lock_toml["package"]:
|
||||
# ignore local dependencies
|
||||
if "source" not in pkg.keys():
|
||||
continue
|
||||
source: str = pkg["source"]
|
||||
if source in source_to_ind:
|
||||
continue
|
||||
|
||||
if source.startswith("git+"):
|
||||
ind = f"git-{next_git_ind}"
|
||||
next_git_ind += 1
|
||||
source_info = parse_git_source(source, lockfile_version)
|
||||
selector = make_git_source_selector(source_info)
|
||||
elif source.startswith("registry+") or source.startswith("sparse+"):
|
||||
ind = f"registry-{next_registry_ind}"
|
||||
next_registry_ind += 1
|
||||
selector = make_registry_source_selector(source)
|
||||
else:
|
||||
raise Exception(f"Can't process source: {source}.")
|
||||
|
||||
source_to_ind[source] = ind
|
||||
add_source_replacement(
|
||||
orig_key=f"original-source-{ind}",
|
||||
orig_selector=selector,
|
||||
vendored_key=f"vendored-source-{ind}",
|
||||
vendored_dir=f"@vendor@/source-{ind}"
|
||||
)
|
||||
|
||||
config_path = out_dir / ".cargo" / "config.toml"
|
||||
config_path.parent.mkdir()
|
||||
|
||||
with open(config_path, "wb") as config_file:
|
||||
tomli_w.dump({"source": source_config}, config_file)
|
||||
|
||||
for pkg in cargo_lock_toml["package"]:
|
||||
|
||||
# ignore local dependenices
|
||||
if "source" not in pkg.keys():
|
||||
continue
|
||||
|
||||
source: str = pkg["source"]
|
||||
source_ind = source_to_ind[source]
|
||||
crate_dir_name = f"{pkg["name"]}-{pkg["version"]}"
|
||||
source_dir_name = f"source-{source_ind}"
|
||||
crate_out_dir = out_dir / source_dir_name / crate_dir_name
|
||||
crate_out_dir.parent.mkdir(exist_ok=True)
|
||||
|
||||
if source.startswith("git+"):
|
||||
|
||||
source_info = parse_git_source(source, lockfile_version)
|
||||
|
||||
git_sha_rev = source_info["git_sha_rev"]
|
||||
git_tree = vendor_staging_dir / "git" / git_sha_rev
|
||||
|
||||
copy_and_patch_git_crate_subtree(git_tree, pkg["name"], crate_out_dir)
|
||||
|
||||
# git based crates allow having no checksum information
|
||||
with open(crate_out_dir / ".cargo-checksum.json", "w") as f:
|
||||
json.dump({"files": {}}, f)
|
||||
|
||||
elif source.startswith("registry+") or source.startswith("sparse+"):
|
||||
filename = f"{pkg["name"]}-{pkg["version"]}.tar.gz"
|
||||
|
||||
# TODO: change this when non-crates-io registries are supported
|
||||
dir_name = "tarballs"
|
||||
|
||||
tarball_path = vendor_staging_dir / dir_name / filename
|
||||
|
||||
extract_crate_tarball_contents(tarball_path, crate_out_dir)
|
||||
|
||||
# non-git based crates need the package checksum at minimum
|
||||
with open(crate_out_dir / ".cargo-checksum.json", "w") as f:
|
||||
json.dump({"files": {}, "package": pkg["checksum"]}, f)
|
||||
|
||||
else:
|
||||
raise Exception(f"Can't process source: {source}.")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
subcommand = sys.argv[1]
|
||||
|
||||
subcommand_func_dict = {
|
||||
"create-vendor-staging": lambda: create_vendor_staging(lockfile_path=Path(sys.argv[2]), out_dir=Path(sys.argv[3])),
|
||||
"create-vendor": lambda: create_vendor(vendor_staging_dir=Path(sys.argv[2]), out_dir=Path(sys.argv[3]))
|
||||
}
|
||||
|
||||
subcommand_func = subcommand_func_dict.get(subcommand)
|
||||
|
||||
if subcommand_func is None:
|
||||
raise Exception(f"Unknown subcommand: '{subcommand}'. Must be one of {list(subcommand_func_dict.keys())}")
|
||||
|
||||
subcommand_func()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
@ -22,18 +22,29 @@ let
|
|||
];
|
||||
} (builtins.readFile ./replace-workspace-values.py);
|
||||
|
||||
fetchCargoVendorUtil = writers.writePython3Bin "fetch-cargo-vendor-util" {
|
||||
libraries =
|
||||
with python3Packages;
|
||||
[
|
||||
requests
|
||||
tomli-w
|
||||
]
|
||||
++ requests.optional-dependencies.socks; # to support socks proxy envs like ALL_PROXY in requests
|
||||
flakeIgnore = [
|
||||
"E501"
|
||||
];
|
||||
} (builtins.readFile ./fetch-cargo-vendor-util.py);
|
||||
mkFetchCargoVendorUtil =
|
||||
name: src:
|
||||
writers.writePython3Bin name {
|
||||
libraries =
|
||||
with python3Packages;
|
||||
[
|
||||
requests
|
||||
tomli-w
|
||||
]
|
||||
++ requests.optional-dependencies.socks; # to support socks proxy envs like ALL_PROXY in requests
|
||||
flakeIgnore = [
|
||||
"E501"
|
||||
];
|
||||
} (builtins.readFile src);
|
||||
|
||||
# Separate util used only by the FOD `vendorStaging` stage below. Kept
|
||||
# distinct from fetchCargoVendorUtil so that changes to the network-facing
|
||||
# bits (User-Agent, download URL) don't invalidate the input-addressed
|
||||
# `-vendor` stage and force a mass rebuild of every Rust package in nixpkgs.
|
||||
# vendorStaging is an FOD, so swapping its util is free for consumers.
|
||||
# TODO: unify with fetchCargoVendorUtil on the next `staging` cycle.
|
||||
fetchCargoVendorUtilV2 = mkFetchCargoVendorUtil "fetch-cargo-vendor-util-v2" ./fetch-cargo-vendor-util-v2.py;
|
||||
fetchCargoVendorUtil = mkFetchCargoVendorUtil "fetch-cargo-vendor-util" ./fetch-cargo-vendor-util.py;
|
||||
in
|
||||
|
||||
{
|
||||
|
|
@ -61,7 +72,7 @@ let
|
|||
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
|
||||
|
||||
nativeBuildInputs = [
|
||||
fetchCargoVendorUtil
|
||||
fetchCargoVendorUtilV2
|
||||
cacert
|
||||
(nix-prefetch-git.override {
|
||||
git = gitMinimal;
|
||||
|
|
@ -79,7 +90,7 @@ let
|
|||
cd "$cargoRoot"
|
||||
fi
|
||||
|
||||
fetch-cargo-vendor-util create-vendor-staging ./Cargo.lock "$out"
|
||||
fetch-cargo-vendor-util-v2 create-vendor-staging ./Cargo.lock "$out"
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "ananicy-rules-cachyos";
|
||||
version = "0-unstable-2026-04-15";
|
||||
version = "0-unstable-2026-04-23";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "CachyOS";
|
||||
repo = "ananicy-rules";
|
||||
rev = "59de158ecc602270a86e58b89663d141dd688d87";
|
||||
hash = "sha256-TwO2pINGLsrYMeUJthj+hPcej+MfFB1zjq+89/QMS+I=";
|
||||
rev = "dcae8ac6b1213f82015135a09780c07ac54ff378";
|
||||
hash = "sha256-rkNczo6MxmLWpSnC1SGza21Gwns1FV/ZxXBTRBZ3xM4=";
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@
|
|||
|
||||
let
|
||||
pname = "chatzone-desktop";
|
||||
version = "5.6.0";
|
||||
version = "5.6.1";
|
||||
src = fetchurl {
|
||||
url = "https://ir.ozone.ru/s3/chatzone-clients/ci/5.6.0/1111/chatzone-desktop-linux-5.6.0.AppImage";
|
||||
hash = "sha256-cMXdCXYUpgdmZntKS4YOLSJ84VVx7O83Kxa3jM+AWvI=";
|
||||
url = "https://ir.ozone.ru/s3/chatzone-clients/ci/5.6.1/1159/chatzone-desktop-linux-5.6.1.AppImage";
|
||||
hash = "sha256-fLwkroco9cwNoDXPB+9Qu0qRXDE36zaF8MPjHonRbfk=";
|
||||
};
|
||||
appimageContents = appimageTools.extract { inherit pname version src; };
|
||||
in
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
description = "Change or display the stack size of an ELF binary";
|
||||
homepage = "https://github.com/Gottox/chelf";
|
||||
license = lib.licenses.bsd2;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = [ ];
|
||||
mainProgram = "chelf";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -40,6 +40,6 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
mainProgram = "cog";
|
||||
homepage = "https://github.com/oknozor/cocogitto";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = [ ];
|
||||
maintainers = with lib.maintainers; [ gs-101 ];
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -44,13 +44,13 @@ lib.checkListOfEnum "colloid-icon-theme: scheme variants"
|
|||
stdenvNoCC.mkDerivation
|
||||
rec {
|
||||
inherit pname;
|
||||
version = "2025-02-09";
|
||||
version = "2025-07-19";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "vinceliuice";
|
||||
repo = "colloid-icon-theme";
|
||||
tag = version;
|
||||
hash = "sha256-x2SSaIkKm1415avO7R6TPkpghM30HmMdjMFUUyPWZsk=";
|
||||
hash = "sha256-CzFEMY3oJE3sHdIMQQi9qizG8jKo72gR8FlVK0w0p74=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
|
@ -86,6 +86,11 @@ lib.checkListOfEnum "colloid-icon-theme: scheme variants"
|
|||
runHook postInstall
|
||||
'';
|
||||
|
||||
# Drop dangling symlinks from the upstream icon set.
|
||||
postFixup = ''
|
||||
find $out/share/icons -xtype l -delete
|
||||
'';
|
||||
|
||||
passthru.updateScript = gitUpdater { };
|
||||
|
||||
meta = {
|
||||
|
|
|
|||
|
|
@ -20,13 +20,13 @@ let
|
|||
in
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "ddev";
|
||||
version = "1.25.1";
|
||||
version = "1.25.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ddev";
|
||||
repo = "ddev";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-kHGGUFX/xlmQsYxKPxSuRJHk2na9gU1Kd2jhNclAp5s=";
|
||||
hash = "sha256-JcZTKGjYTvrUT6IAKfVJsJj3e4Q60uiIdK3Y9GzeIVw=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
|
|
|
|||
|
|
@ -9,16 +9,16 @@
|
|||
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "dgraph";
|
||||
version = "25.3.2";
|
||||
version = "25.3.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dgraph-io";
|
||||
repo = "dgraph";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-tKKDCYaQxIW8JFKLUxg8i+QVDu4H+9GZOYTHB51YRn4=";
|
||||
hash = "sha256-Zkx9dWEWRhUj/hwcgDyH3ikbcvjVHJnALNERunXytag=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-C7wJ12OjCc7WzxpVtsAsaj7leRLfcVFmp1xHcaNAsQw=";
|
||||
vendorHash = "sha256-I+eLpWdS4Dc3XPbeJ8jlSc/ZIw6yveovcIXnfihke3s=";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@
|
|||
}:
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "gemini-cli-bin";
|
||||
version = "0.38.1";
|
||||
version = "0.39.1";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://github.com/google-gemini/gemini-cli/releases/download/v${finalAttrs.version}/gemini-cli-bundle.zip";
|
||||
hash = "sha256-+XMClLm7HGWST1MESxIVHGmgyvPPqrXGUomoiDY/eUE=";
|
||||
hash = "sha256-mDKBquxjdeIpNOFOrL2Nnsxwr9Fz8FH/Ulhpiwrv1TA=";
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -56,24 +56,24 @@
|
|||
|
||||
let
|
||||
pname = "gitkraken";
|
||||
version = "11.6.0";
|
||||
version = "12.0.1";
|
||||
|
||||
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
|
||||
|
||||
srcs = {
|
||||
x86_64-linux = fetchzip {
|
||||
url = "https://api.gitkraken.dev/releases/production/linux/x64/${version}/gitkraken-amd64.tar.gz";
|
||||
hash = "sha256-MU/WB4RsNViEulvE6fB7S4QTjjMI/50enlyCIX+xar4=";
|
||||
hash = "sha256-Tn4j9zmH8hr5rKaPFgox/LopTvEWghnPGf4JiM8y86k=";
|
||||
};
|
||||
|
||||
x86_64-darwin = fetchzip {
|
||||
url = "https://api.gitkraken.dev/releases/production/darwin/x64/${version}/GitKraken-v${version}.zip";
|
||||
hash = "sha256-Ty+eRZJ6bnBsrs1VtGem1+m9WDZZf/PgiOvFIazQF6I=";
|
||||
hash = "sha256-bKbqu94JPI4VOPcphkw/vAN/ihb5wc5qh/qaw7bweG0=";
|
||||
};
|
||||
|
||||
aarch64-darwin = fetchzip {
|
||||
url = "https://api.gitkraken.dev/releases/production/darwin/arm64/${version}/GitKraken-v${version}.zip";
|
||||
hash = "sha256-mpJNhvKIBYt3Yd+RjxSgzRP6AfnfHPRbQ0dzd5kQQIQ=";
|
||||
hash = "sha256-h2RSdK75i1NbchGauDSvaYJyz39Bncgf+RQIfRdDQuE=";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -207,9 +207,9 @@ let
|
|||
|
||||
# SSL and permissions fix for bundled nodegit
|
||||
pushd $out/share/${pname}/resources/app.asar.unpacked/node_modules/@axosoft/nodegit/build/Release
|
||||
mv nodegit-ubuntu-20.node nodegit-ubuntu-20-ssl-1.1.1.node
|
||||
mv nodegit-ubuntu-20-ssl-static.node nodegit-ubuntu-20.node
|
||||
chmod 755 nodegit-ubuntu-20.node
|
||||
mv nodegit-x64-ubuntu-20.node nodegit-x64-ubuntu-20-ssl-1.1.1.node
|
||||
mv nodegit-x64-ubuntu-20-ssl-static.node nodegit-x64-ubuntu-20.node
|
||||
chmod 755 nodegit-x64-ubuntu-20.node
|
||||
popd
|
||||
|
||||
# Devendor bundled git
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
makeWrapper,
|
||||
ninja,
|
||||
perl,
|
||||
perlPackages,
|
||||
brotli,
|
||||
openssl,
|
||||
libcap,
|
||||
|
|
@ -23,13 +24,13 @@
|
|||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "h2o";
|
||||
version = "2.3.0-rolling-2026-02-28";
|
||||
version = "2.3.0-rolling-2026-04-15";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "h2o";
|
||||
repo = "h2o";
|
||||
rev = "725e54bc932fbe0c6e208db4e71eb1df79ec43ff";
|
||||
hash = "sha256-SAH7AZYy6ZRRa8zhhe8voKJCqM5CxSuZA/XwT1Nb9NI=";
|
||||
rev = "4aa96860e99cc2a2e2777433949bb05aed678ebe";
|
||||
hash = "sha256-0utcajHyLpP+MXwW12pGWd/E58jK5//Erq0dQmzBO5U=";
|
||||
};
|
||||
|
||||
outputs = [
|
||||
|
|
@ -44,6 +45,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
cmake
|
||||
makeWrapper
|
||||
ninja
|
||||
perlPackages.JSON
|
||||
]
|
||||
++ lib.optionals withMruby [
|
||||
bison
|
||||
|
|
@ -72,6 +74,9 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
--set "H2O_PERL" "${lib.getExe perl}" \
|
||||
--prefix "PATH" : "${lib.getBin openssl}/bin"
|
||||
done
|
||||
|
||||
wrapProgram "$out/bin/h2olog" \
|
||||
--set "PERL5LIB" "$PERL5LIB"
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
|
|
|
|||
|
|
@ -50,13 +50,13 @@ let
|
|||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "hmcl";
|
||||
version = "3.12.4";
|
||||
version = "3.13.2";
|
||||
|
||||
src = fetchurl {
|
||||
# HMCL has built-in keys, such as the Microsoft OAuth secret and the CurseForge API key.
|
||||
# See https://github.com/HMCL-dev/HMCL/blob/refs/tags/release-3.6.12/.github/workflows/gradle.yml#L26-L28
|
||||
url = "https://github.com/HMCL-dev/HMCL/releases/download/v${finalAttrs.version}/HMCL-${finalAttrs.version}.jar";
|
||||
hash = "sha256-CxLs3rMW++FGF7WV9EMIb+69ZrnV2MadEHD/NMyXBIw=";
|
||||
hash = "sha256-2OLtf47fmNiEFOkjHiDCj99seiMy25PlmRDSFKu9WFI=";
|
||||
};
|
||||
|
||||
# - HMCL prompts users to download prebuilt Terracotta binary for
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@
|
|||
|
||||
gcc15Stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "hyprlauncher";
|
||||
version = "0.1.5";
|
||||
version = "0.1.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "hyprwm";
|
||||
repo = "hyprlauncher";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-nu3pMtkMwKsEhpBE4XMpayXDGdnrXVXrscSsxp7qf1I=";
|
||||
hash = "sha256-FHw6S2rz716ZwuF661aT5HYN1b6qyyBDkwhEL5hzHUk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@
|
|||
|
||||
gcc15Stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "hyprwire";
|
||||
version = "0.3.0";
|
||||
version = "0.3.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "hyprwm";
|
||||
repo = "hyprwire";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-PR/KER+yiHabFC/h1Wjb+9fR2Uy0lWM3Qld7jPVaWkk=";
|
||||
hash = "sha256-AKPaKeLDy0QXRBk/XzR7RktX7CV63ejYsTUgsPdXKvg=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
updateScript = nix-update-script { };
|
||||
};
|
||||
|
||||
passthru = {
|
||||
meta = {
|
||||
description = "CAD program for creating virtual LEGO models";
|
||||
mainProgram = "leocad";
|
||||
homepage = "https://www.leocad.org/";
|
||||
|
|
|
|||
|
|
@ -89,16 +89,16 @@ let
|
|||
in
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "matrix-tuwunel";
|
||||
version = "1.5.1";
|
||||
version = "1.6.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "matrix-construct";
|
||||
repo = "tuwunel";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-VdG8tSbRPTG915l0Y7eYsGprPSerYF2dpo64D4er5io=";
|
||||
hash = "sha256-7w2+hltPj0mP3xcmHfjFvIqxwFkcf71bzm4TFiz745g=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-97DM+khPcwze3iH4DJODyI8WEjqcl3ftg26odcRdrKc=";
|
||||
cargoHash = "sha256-DuHV4/a3B/Khq9/RgxFg5RfQ2svdKPv+QyuUqKGAveo=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
|
|
|
|||
|
|
@ -25,16 +25,16 @@ let
|
|||
in
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "motrix-next";
|
||||
version = "3.6.8";
|
||||
version = "3.8.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "AnInsomniacy";
|
||||
repo = "motrix-next";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-nn1YivQ7UCRpWnWa2w0F06n6bQrMJ1d8Gb84hY6K5WE=";
|
||||
hash = "sha256-PPzNdhRYKwABKH7Fh0l0gdZEDn0ZljshAeetetPxXHQ=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-mrzyIvHlfs3epOm3ZKPetmJOCKpZdHlfosOP7iLlu1k=";
|
||||
cargoHash = "sha256-lvfmhYx7HSk3SrCJ03pZwq3ZAXnGtv2MIKX8+N5lQMc=";
|
||||
|
||||
pnpmDeps = fetchPnpmDeps {
|
||||
inherit (finalAttrs)
|
||||
|
|
@ -43,7 +43,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
src
|
||||
;
|
||||
inherit pnpm;
|
||||
hash = "sha256-WvcN4LLRKiOxYEjImZ7VerwHFj33ELJvDKyP3F2UYG8=";
|
||||
hash = "sha256-s/xKVhY6NRIGbVkaXOei9z9n0CQkoK5eGhc5/WcEGFI=";
|
||||
fetcherVersion = 3;
|
||||
};
|
||||
|
||||
|
|
@ -73,7 +73,8 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
cargoRoot = "src-tauri";
|
||||
buildAndTestSubdir = finalAttrs.cargoRoot;
|
||||
|
||||
checkFlags = lib.optional stdenv.hostPlatform.isDarwin "--skip=commands::protocol::tests::macos_tests::get_default_handler_bundle_id_returns_some_for_https";
|
||||
# Some tests on macOS attempt to retrieve system settings, such as the default browser and system proxy.
|
||||
doCheck = !stdenv.hostPlatform.isDarwin;
|
||||
|
||||
# Deactivate the upstream update mechanism
|
||||
postPatch = ''
|
||||
|
|
@ -98,7 +99,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
]
|
||||
}
|
||||
# Tricky way to make the protocol handler desktop file point to the wrapper
|
||||
--set-default APPIMAGE $out/bin/motrix-next
|
||||
--set-default APPIMAGE motrix-next
|
||||
)
|
||||
wrapGApp $out/bin/motrix-next
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -1,52 +1,54 @@
|
|||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
buildNpmPackage,
|
||||
fetchFromGitHub,
|
||||
fetchPnpmDeps,
|
||||
fetchzip,
|
||||
|
||||
nodejs,
|
||||
pnpm_9,
|
||||
fetchPnpmDeps,
|
||||
openlistPnpm ? pnpm_10,
|
||||
pnpmConfigHook,
|
||||
pnpm_10,
|
||||
}:
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
buildNpmPackage (finalAttrs: {
|
||||
pname = "openlist-frontend";
|
||||
version = "4.1.10";
|
||||
version = "4.2.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "OpenListTeam";
|
||||
repo = "OpenList-Frontend";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-V8nfQsGLhd7eERF0/ly3sRdGmffYa9r6GhtjciOXxMU=";
|
||||
hash = "sha256-4WSL6j0dANUNlHFkMBb8j/KyNHWDQmLnC1y2FFJiBEI=";
|
||||
};
|
||||
|
||||
i18n = fetchzip {
|
||||
url = "https://github.com/OpenListTeam/OpenList-Frontend/releases/download/v${finalAttrs.version}/i18n.tar.gz";
|
||||
hash = "sha256-VdNqXdLXs2n/ikUDm1YQRNAXqYqFjMWRGLPRpmJVoaI=";
|
||||
hash = "sha256-VzHNZh0ZA2FncAkyozHeBilN4KKsPqbpMESx4QCppW0=";
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
cp -r ${finalAttrs.i18n}/* src/lang/
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
nodejs
|
||||
pnpmConfigHook
|
||||
pnpm_9
|
||||
openlistPnpm
|
||||
];
|
||||
|
||||
npmDeps = null;
|
||||
pnpmDeps = fetchPnpmDeps {
|
||||
inherit (finalAttrs) pname version src;
|
||||
pnpm = pnpm_9;
|
||||
fetcherVersion = 2;
|
||||
hash = "sha256-xylF+Z7Fkx/bFYPlzqfGrl051ZLKzPgdlF7U8vKtQq8=";
|
||||
pnpm = openlistPnpm;
|
||||
fetcherVersion = 3;
|
||||
hash = "sha256-rTDk1p568AKim+ZD00uq1q4XNNMeUFL1rGDBWx2C6DQ=";
|
||||
};
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
npmConfigHook = pnpmConfigHook;
|
||||
|
||||
cp -r ${finalAttrs.i18n}/* src/lang/
|
||||
pnpm build
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
# [plugin vite:legacy-generate-polyfill-chunk]
|
||||
# Error: getaddrinfo ENOTFOUND localhost
|
||||
__darwinAllowLocalNetworking = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
|
@ -62,5 +64,6 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
|||
homepage = "https://github.com/OpenListTeam/OpenList-Frontend";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ moraxyc ];
|
||||
inherit (nodejs.meta) platforms;
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -2,22 +2,24 @@
|
|||
lib,
|
||||
stdenv,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
callPackage,
|
||||
fetchFromGitHub,
|
||||
iana-etc,
|
||||
installShellFiles,
|
||||
libredirect,
|
||||
versionCheckHook,
|
||||
fuse,
|
||||
}:
|
||||
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "openlist";
|
||||
version = "4.1.10";
|
||||
version = "4.2.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "OpenListTeam";
|
||||
repo = "OpenList";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-+B3ea0LvzpRll9HpfEU6RkSgnQtVprSlrO+Tq07T0eQ=";
|
||||
hash = "sha256-9MDcAQh06W6mOhYpFR49bxvTTrIoJnKY9P3WRVWsujI=";
|
||||
# populate values that require us to use git. By doing this in postFetch we
|
||||
# can delete .git afterwards and maintain better reproducibility of the src.
|
||||
leaveDotGit = true;
|
||||
|
|
@ -33,7 +35,12 @@ buildGoModule (finalAttrs: {
|
|||
frontend = callPackage ./frontend.nix { };
|
||||
|
||||
proxyVendor = true;
|
||||
vendorHash = "sha256-xUTTVejCDDMfzWdmtXiWcc0/hzhniZJcNzPFFFiNnJk=";
|
||||
vendorHash = "sha256-Ho9zVKdzpGKZ/ftJmidUkMBsN4qfvLa96Fg3ayTfYac=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
]
|
||||
++ lib.optional stdenv.hostPlatform.isDarwin libredirect.hook;
|
||||
|
||||
buildInputs = [ fuse ];
|
||||
|
||||
|
|
@ -56,6 +63,10 @@ buildGoModule (finalAttrs: {
|
|||
ldflags+=" -X github.com/OpenListTeam/OpenList/v4/internal/conf.GitCommit=$(<COMMIT)"
|
||||
'';
|
||||
|
||||
preCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/services=${iana-etc}/etc/services
|
||||
'';
|
||||
|
||||
checkFlags =
|
||||
let
|
||||
# Skip tests that require network access
|
||||
|
|
@ -74,8 +85,6 @@ buildGoModule (finalAttrs: {
|
|||
in
|
||||
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd OpenList \
|
||||
--bash <($out/bin/OpenList completion bash) \
|
||||
|
|
@ -86,9 +95,9 @@ buildGoModule (finalAttrs: {
|
|||
$out/bin/OpenList completion powershell > $out/share/powershell/OpenList.Completion.ps1
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
# panic: open /etc/protocols: operation not permitted
|
||||
doInstallCheck = !stdenv.hostPlatform.isDarwin;
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
versionCheckProgram = "${placeholder "out"}/bin/OpenList";
|
||||
versionCheckProgramArg = "version";
|
||||
|
||||
passthru.updateScript = lib.getExe (callPackage ./update.nix { });
|
||||
|
|
|
|||
|
|
@ -9,17 +9,17 @@
|
|||
|
||||
buildGoModule {
|
||||
pname = "packwiz";
|
||||
version = "0-unstable-2025-01-19";
|
||||
version = "0-unstable-2026-02-18";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "packwiz";
|
||||
repo = "packwiz";
|
||||
rev = "241f24b550f6fe838913a56bdd58bac2fc53254a";
|
||||
sha256 = "sha256-VmNsWzsFVNRciNIPUXUVos4cBdpawgN1/nPwMjNpx+0=";
|
||||
rev = "dfd8b68a4796c763e25bad50265ea1f1233e24f1";
|
||||
sha256 = "sha256-QK8sY7e6QHhg+GH8NiiePGFlsQBI0jjUlsgBuq1Yopc=";
|
||||
};
|
||||
passthru.updateScript = unstableGitUpdater { };
|
||||
|
||||
vendorHash = "sha256-krdrLQHM///dtdlfEhvSUDV2QljvxFc2ouMVQVhN7A0=";
|
||||
vendorHash = "sha256-ChUE4hWl+UyPpbzK0GbJTD0AoBCogI7qGstga4+WujI=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
|
|
@ -36,7 +36,10 @@ buildGoModule {
|
|||
description = "Command line tool for editing and distributing Minecraft modpacks, using a git-friendly TOML format";
|
||||
homepage = "https://packwiz.infra.link/";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ infinidoge ];
|
||||
maintainers = with lib.maintainers; [
|
||||
infinidoge
|
||||
bddvlpr
|
||||
];
|
||||
mainProgram = "packwiz";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@
|
|||
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "pangolin-cli";
|
||||
version = "0.6.0";
|
||||
version = "0.6.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "fosrl";
|
||||
repo = "cli";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-9uQLCSH7LLl8I/LgsgTo6w808iwmH1FF0GYNn5xyVuc=";
|
||||
hash = "sha256-WKwoQIE3ibIJKiEGM8kWJ/7O+HjSyRJkLF1qyaVshOE=";
|
||||
};
|
||||
|
||||
ldflags = [
|
||||
|
|
@ -51,6 +51,7 @@ buildGoModule (finalAttrs: {
|
|||
license = lib.licenses.agpl3Only;
|
||||
maintainers = with lib.maintainers; [
|
||||
water-sucks
|
||||
jackr
|
||||
];
|
||||
mainProgram = "pangolin";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,16 +7,16 @@
|
|||
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "pocketbase";
|
||||
version = "0.36.9";
|
||||
version = "0.37.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pocketbase";
|
||||
repo = "pocketbase";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-OClsHslrnQMzHib+C6HKDjlO5sM2j00k4/LuJjh4Uk8=";
|
||||
hash = "sha256-n7oUsBMLKtFmz8iWu79vphBy7L9b7PMau8hOKKzi6Dc=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-5gbGLq6icXT8cVA1f1zjuV35scPozDjjhHMrgunD0hw=";
|
||||
vendorHash = "sha256-7Y7cn8t3HTV4vsTRXuM8gG0UjqCnxivQyo/KM47Itro=";
|
||||
|
||||
# This is the released subpackage from upstream repo
|
||||
subPackages = [ "examples/base" ];
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
let
|
||||
pname = "postman";
|
||||
version = "11.93.0";
|
||||
version = "11.94.0";
|
||||
|
||||
src =
|
||||
let
|
||||
|
|
@ -27,10 +27,10 @@ let
|
|||
name = "postman-${version}.${if stdenvNoCC.hostPlatform.isLinux then "tar.gz" else "zip"}";
|
||||
url = "https://dl.pstmn.io/download/version/${version}/${system}";
|
||||
hash = selectSystem {
|
||||
aarch64-darwin = "sha256-P7MF0Hg1n/0Wsdg9YEJTHRy8NGjDkDrCCFMbu3uovho=";
|
||||
aarch64-linux = "sha256-OOJAdywyGZaFMpi/IKub53NfJ2IEu3E+bkmYeDT/xjc=";
|
||||
x86_64-darwin = "sha256-xBY8Nqtax8e/5k/pAOCRSdHiOETR1RS1A/anVwhWipw=";
|
||||
x86_64-linux = "sha256-hsW/2Fs1uY+iUl9hzzr5lcVxoydSZn3p/B0AsqXwlww=";
|
||||
aarch64-darwin = "sha256-rZLqbcX5ZRNeDUyEWcsLWMr3KXsnXRKBRmLZKMH9gIs=";
|
||||
aarch64-linux = "sha256-sMJohqgY8DrC7DLgU9AQofLWMhebznAJSLFe5D65c4M=";
|
||||
x86_64-darwin = "sha256-Bit/M3Z+3bJsGSWdCDp9xK9RnxH6bptI0eMqt28dwHQ=";
|
||||
x86_64-linux = "sha256-PsTFM5UwX104G8YIwAy1OY4EgNhspupkPJ53y3qwGUc=";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
diff --git a/frontend/svelte.config.js b/frontend/svelte.config.js
|
||||
index 397fe4d4..3a08f7a2 100644
|
||||
--- a/frontend/svelte.config.js
|
||||
+++ b/frontend/svelte.config.js
|
||||
@@ -12,8 +12,8 @@ const config = {
|
||||
},
|
||||
adapter: adapter({
|
||||
fallback: null,
|
||||
- pages: '../templates/html',
|
||||
- assets: '../static/v1',
|
||||
+ pages: 'dist/templates/html',
|
||||
+ assets: 'dist/static/v1',
|
||||
precompress: true,
|
||||
strict: true,
|
||||
}),
|
||||
|
|
@ -1,122 +1,65 @@
|
|||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
fetchNpmDeps,
|
||||
rustPlatform,
|
||||
buildNpmPackage,
|
||||
npmHooks,
|
||||
nodejs,
|
||||
nix-update-script,
|
||||
writableTmpDirAsHomeHook,
|
||||
pkg-config,
|
||||
perl,
|
||||
wasm-pack,
|
||||
wasm-bindgen-cli_0_2_108,
|
||||
wasm-bindgen-cli_0_2_118,
|
||||
binaryen,
|
||||
lld,
|
||||
rust-jemalloc-sys-unprefixed,
|
||||
}:
|
||||
let
|
||||
version = "0.34.3";
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "rauthy";
|
||||
version = "0.35.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "sebadob";
|
||||
repo = "rauthy";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-ey6y/EGmz/80s0nbxsk6li9KCJV5IAtBp5QqAj7a6R0=";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-m9MRKBoRbHSXgK1nsxoI1laY2pDybnSaTeihKy6+1AU=";
|
||||
};
|
||||
|
||||
cargoDeps = rustPlatform.fetchCargoVendor {
|
||||
inherit src pname version;
|
||||
hash = "sha256-mkIHup/6aA9QDPlekhdZiXWryhetsJMxl3HAXsabACQ=";
|
||||
};
|
||||
|
||||
# Wasm modules are needed to build the frontend and are part of the main Rust repo.
|
||||
#
|
||||
# We use rustPlatform.buildRustPackage to get the correct environment for wasm-pack.
|
||||
# Since the "wasm-modules" crate has no binary output, cargoInstallPostBuildHook fails,
|
||||
# so we disable the cargo install phase.
|
||||
wasmModules = rustPlatform.buildRustPackage {
|
||||
inherit version src cargoDeps;
|
||||
pname = "${pname}-wasm-modules";
|
||||
|
||||
nativeBuildInputs = [
|
||||
writableTmpDirAsHomeHook
|
||||
wasm-pack
|
||||
wasm-bindgen-cli_0_2_108
|
||||
binaryen
|
||||
lld
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
mkdir -p $out/wasm
|
||||
cd src/wasm-modules
|
||||
|
||||
wasm-pack -v build --out-dir $out/wasm/spow --no-pack --out-name spow --features spow
|
||||
wasm-pack -v build --out-dir $out/wasm/md --no-pack --out-name md --features md
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
dontCargoInstall = true;
|
||||
|
||||
# Skip checks here; they will run in the main package.
|
||||
doCheck = false;
|
||||
};
|
||||
|
||||
frontend = buildNpmPackage {
|
||||
inherit version src;
|
||||
pname = "${pname}-frontend";
|
||||
|
||||
sourceRoot = "${src.name}/frontend";
|
||||
|
||||
patches = [
|
||||
./0001-build-svelte-files-inside-the-current-directory.patch
|
||||
];
|
||||
|
||||
patchFlags = [
|
||||
"-p2"
|
||||
];
|
||||
|
||||
npmDepsHash = "sha256-N/tFwQNWMudFtetIKfirXDvWH3CfRwjdpBcxkXZsVig=";
|
||||
|
||||
preBuild = ''
|
||||
mkdir -p ./src/wasm/
|
||||
cp -r ${wasmModules}/wasm/* ./src/wasm/
|
||||
'';
|
||||
};
|
||||
in
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
inherit
|
||||
pname
|
||||
version
|
||||
src
|
||||
cargoDeps
|
||||
;
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
binaryen
|
||||
lld
|
||||
nodejs
|
||||
npmHooks.npmConfigHook
|
||||
perl
|
||||
wasm-bindgen-cli_0_2_118
|
||||
wasm-pack
|
||||
];
|
||||
|
||||
buildInputs = [ rust-jemalloc-sys-unprefixed ];
|
||||
|
||||
npmRoot = "frontend";
|
||||
|
||||
npmDeps = fetchNpmDeps {
|
||||
src = "${finalAttrs.src}/frontend";
|
||||
hash = "sha256-MVfon/jKtXfgm6YBkeNx3CGloR7bzqgExUckoLMW8B4=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-GHU1vCSAf3SUaqTpymQzQqX3FSVNvJtYD3Av4Dsm+Rc=";
|
||||
|
||||
preBuild = ''
|
||||
cp -r ${frontend}/lib/node_modules/frontend/dist/templates/html/ templates/html
|
||||
cp -r ${frontend}/lib/node_modules/frontend/dist/static/ static
|
||||
pushd src/wasm-modules
|
||||
wasm-pack build -d ../../frontend/src/wasm/spow --no-pack --out-name spow --features spow
|
||||
wasm-pack build -d ../../frontend/src/wasm/md --no-pack --out-name md --features md
|
||||
popd
|
||||
pushd "$npmRoot"
|
||||
npm run build
|
||||
popd
|
||||
'';
|
||||
|
||||
# Tests fail and appear unmaintained upstream.
|
||||
doCheck = false;
|
||||
|
||||
passthru = {
|
||||
inherit frontend;
|
||||
|
||||
updateScript = nix-update-script {
|
||||
extraArgs = [
|
||||
"--subpackage=frontend"
|
||||
];
|
||||
};
|
||||
updateScript = nix-update-script { };
|
||||
};
|
||||
|
||||
meta = {
|
||||
|
|
@ -125,7 +68,9 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
homepage = "https://github.com/sebadob/rauthy";
|
||||
changelog = "https://github.com/sebadob/rauthy/blob/${finalAttrs.src.tag}/CHANGELOG.md";
|
||||
license = lib.licenses.asl20;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [ angelodlfrtr ];
|
||||
maintainers = with lib.maintainers; [
|
||||
angelodlfrtr
|
||||
ungeskriptet
|
||||
];
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
From 9cb3e66870ae22d87222ee7636e5b6c85c776673 Mon Sep 17 00:00:00 2001
|
||||
From: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
|
||||
Date: Sun, 27 Jul 2025 15:53:17 +0200
|
||||
Subject: [PATCH] missing include cstdlib
|
||||
|
||||
Fix an error with libcxx-21
|
||||
|
||||
>In file included from ../rubberband-4.0.0/src/common/mathmisc.cpp:24:
|
||||
>../rubberband-4.0.0/src/common/mathmisc.h:58:1:
|
||||
>error: unknown type name 'size_t'; did you mean 'std::size_t'?
|
||||
|
||||
Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
|
||||
---
|
||||
src/common/mathmisc.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/common/mathmisc.h b/src/common/mathmisc.h
|
||||
index d8bcc14d..66f3378c 100644
|
||||
--- a/src/common/mathmisc.h
|
||||
+++ b/src/common/mathmisc.h
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
#include "sysutils.h"
|
||||
|
||||
+#include <cstdlib>
|
||||
+
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif // M_PI
|
||||
|
|
@ -23,6 +23,12 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
hash = "sha256-rwUDE+5jvBizWy4GTl3OBbJ2qvbRqiuKgs7R/i+AKOk=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix missing size_t definition when building with libc++ 21.
|
||||
# Source: https://github.com/breakfastquay/rubberband/pull/126
|
||||
./0001-Fix-an-error-with-libcxx-21.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
meson
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ buildDotnetModule {
|
|||
pname = "sonarr";
|
||||
inherit version src;
|
||||
|
||||
# Upstream expects to be ran from a "bin" directory
|
||||
installPath = "${placeholder "out"}/lib/sonarr/bin";
|
||||
strictDeps = true;
|
||||
nativeBuildInputs = [
|
||||
nodejs
|
||||
|
|
@ -87,12 +89,18 @@ buildDotnetModule {
|
|||
yarn --offline run build --env production
|
||||
'';
|
||||
postInstall =
|
||||
let
|
||||
packageInfo = writers.writeText "package_info" ''
|
||||
PackageVersion=${version}
|
||||
PackageAuthor=[NixOS](https://nixos.org)
|
||||
'';
|
||||
in
|
||||
lib.optionalString withFFmpeg ''
|
||||
rm -- "$out/lib/sonarr/ffprobe"
|
||||
ln -s -- "$ffprobe" "$out/lib/sonarr/ffprobe"
|
||||
ln -sf -- "$ffprobe" "$out/lib/sonarr/bin/ffprobe"
|
||||
''
|
||||
+ ''
|
||||
cp -a -- _output/UI "$out/lib/sonarr/UI"
|
||||
cp -a -- _output/UI "$out/lib/sonarr/bin/UI"
|
||||
ln -s ${packageInfo} $out/lib/sonarr/package_info
|
||||
'';
|
||||
# Add an alias for compatibility with Sonarr v3 package.
|
||||
postFixup = ''
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
desktop-file-utils,
|
||||
fetchFromGitHub,
|
||||
fetchYarnDeps,
|
||||
fixup_yarn_lock,
|
||||
fixup-yarn-lock,
|
||||
gjs,
|
||||
glib-networking,
|
||||
gobject-introspection,
|
||||
|
|
@ -41,7 +41,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
pkg-config
|
||||
wrapGAppsHook4
|
||||
yarn
|
||||
fixup_yarn_lock
|
||||
fixup-yarn-lock
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
|
|
@ -63,7 +63,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
preConfigure = ''
|
||||
export HOME="$PWD"
|
||||
yarn config --offline set yarn-offline-mirror $yarnOfflineCache
|
||||
fixup_yarn_lock yarn.lock
|
||||
fixup-yarn-lock yarn.lock
|
||||
'';
|
||||
|
||||
mesonFlags = [
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@
|
|||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "tlsclient";
|
||||
version = "1.6.6";
|
||||
version = "1.7";
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~moody";
|
||||
repo = "tlsclient";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-nUvOmEwdMKuPM9KaMGxmW0Lvo3968wjDc95pLB17YnM=";
|
||||
hash = "sha256-oClIbswConBrmU0hpIVcS2L0DVF2/xdnbAv3X0RvNZ0=";
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
|
|
|
|||
36
pkgs/by-name/tr/truehdd/package.nix
Normal file
36
pkgs/by-name/tr/truehdd/package.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
rustPlatform,
|
||||
nix-update-script,
|
||||
}:
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "truehdd";
|
||||
version = "0.4.0";
|
||||
|
||||
__structuredAttrs = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "truehdd";
|
||||
repo = "truehdd";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-PhJWtiYtELNkpnhI9e6tv3zFsSJnIYhu2eSy7RyReUE=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-UvHdFtdkQPySEpCZ31n25jfvCsf7ETA7SVSR+/WfEM8=";
|
||||
|
||||
env.VERGEN_GIT_DESCRIBE = finalAttrs.version;
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "Tools for inspecting and decoding Dolby TrueHD bitstreams";
|
||||
homepage = "https://github.com/truehdd/truehdd";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [
|
||||
Renna42
|
||||
];
|
||||
mainProgram = "truehdd";
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
})
|
||||
|
|
@ -7,9 +7,9 @@ change has been made to the scripts meant to be patched.
|
|||
If you're updating the patch, ventoy-x.x.xx-old and new are based on the ventoy repo
|
||||
INSTALL directory.
|
||||
|
||||
diff -Naur ventoy-1.1.10-old/CreatePersistentImg.sh ventoy-1.1.10-new/CreatePersistentImg.sh
|
||||
--- ventoy-1.1.10-old/CreatePersistentImg.sh 2026-03-03 16:17:02.368587084 +0000
|
||||
+++ ventoy-1.1.10-new/CreatePersistentImg.sh 2026-03-03 16:21:52.272094662 +0000
|
||||
diff --color -Naur ventoy-1.1.12-old/CreatePersistentImg.sh ventoy-1.1.12-new/CreatePersistentImg.sh
|
||||
--- ventoy-1.1.12-old/CreatePersistentImg.sh 2026-04-24 18:49:51.361292687 +0100
|
||||
+++ ventoy-1.1.12-new/CreatePersistentImg.sh 2026-04-24 19:04:58.496998056 +0100
|
||||
@@ -119,17 +119,13 @@
|
||||
sync
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ diff -Naur ventoy-1.1.10-old/CreatePersistentImg.sh ventoy-1.1.10-new/CreatePers
|
|||
- echo '/ union' > ./persist_tmp_mnt/$config
|
||||
+ path_to_persist_mnt="`mktemp -d`"
|
||||
+ if mount $freeloop "$path_to_persist_mnt"; then
|
||||
+ echo '/ union' > "$path_to_persist_mnt"/$config
|
||||
+ echo '/ union' > "$path_to_persist_mnt"/$config
|
||||
sync
|
||||
- umount ./persist_tmp_mnt
|
||||
+ umount "$path_to_persist_mnt"
|
||||
|
|
@ -33,18 +33,18 @@ diff -Naur ventoy-1.1.10-old/CreatePersistentImg.sh ventoy-1.1.10-new/CreatePers
|
|||
fi
|
||||
|
||||
if [ ! -z "$passphrase" ]; then
|
||||
diff -Naur ventoy-1.1.10-old/tool/ventoy_lib.sh ventoy-1.1.10-new/tool/ventoy_lib.sh
|
||||
--- ventoy-1.1.10-old/tool/ventoy_lib.sh 2026-03-03 16:17:02.423110021 +0000
|
||||
+++ ventoy-1.1.10-new/tool/ventoy_lib.sh 2026-03-03 16:42:27.917098949 +0000
|
||||
@@ -6,6 +6,8 @@
|
||||
diff --color -Naur ventoy-1.1.12-old/tool/ventoy_lib.sh ventoy-1.1.12-new/tool/ventoy_lib.sh
|
||||
--- ventoy-1.1.12-old/tool/ventoy_lib.sh 2026-04-24 18:49:51.411033394 +0100
|
||||
+++ ventoy-1.1.12-new/tool/ventoy_lib.sh 2026-04-24 18:58:48.286466989 +0100
|
||||
@@ -5,6 +5,8 @@
|
||||
VENTOY_PART_SIZE_MB=32
|
||||
VENTOY_SECTOR_SIZE=512
|
||||
VENTOY_SECTOR_NUM=65536
|
||||
|
||||
+LOGFILE="/var/log/ventoy.log"
|
||||
+
|
||||
|
||||
ventoy_false() {
|
||||
[ "1" = "2" ]
|
||||
}
|
||||
@@ -29,7 +31,7 @@
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ diff -Naur ventoy-1.1.10-old/tool/ventoy_lib.sh ventoy-1.1.10-new/tool/ventoy_li
|
|||
}
|
||||
|
||||
vtoy_gen_uuid() {
|
||||
@@ -51,31 +53,7 @@
|
||||
@@ -51,31 +53,6 @@
|
||||
}
|
||||
|
||||
check_tool_work_ok() {
|
||||
|
|
@ -67,7 +67,7 @@ diff -Naur ventoy-1.1.10-old/tool/ventoy_lib.sh ventoy-1.1.10-new/tool/ventoy_li
|
|||
- return
|
||||
- fi
|
||||
-
|
||||
- if mkexfatfs -V > /dev/null; then
|
||||
- if mkexfatfs -V > /dev/null; then
|
||||
- vtdebug "mkexfatfs test ok ..."
|
||||
- else
|
||||
- vtdebug "mkexfatfs test fail ..."
|
||||
|
|
@ -83,11 +83,10 @@ diff -Naur ventoy-1.1.10-old/tool/ventoy_lib.sh ventoy-1.1.10-new/tool/ventoy_li
|
|||
- return
|
||||
- fi
|
||||
-
|
||||
+
|
||||
vtdebug "tool check success ..."
|
||||
ventoy_true
|
||||
}
|
||||
@@ -315,7 +293,7 @@
|
||||
@@ -315,7 +292,7 @@
|
||||
else
|
||||
vtdebug "format disk by fdisk ..."
|
||||
|
||||
|
|
@ -96,9 +95,9 @@ diff -Naur ventoy-1.1.10-old/tool/ventoy_lib.sh ventoy-1.1.10-new/tool/ventoy_li
|
|||
o
|
||||
n
|
||||
p
|
||||
diff -Naur ventoy-1.1.10-old/tool/VentoyWorker.sh ventoy-1.1.10-new/tool/VentoyWorker.sh
|
||||
--- ventoy-1.1.10-old/tool/VentoyWorker.sh 2026-03-03 16:17:02.419287102 +0000
|
||||
+++ ventoy-1.1.10-new/tool/VentoyWorker.sh 2026-03-03 16:33:54.178992873 +0000
|
||||
diff --color -Naur ventoy-1.1.12-old/tool/VentoyWorker.sh ventoy-1.1.12-new/tool/VentoyWorker.sh
|
||||
--- ventoy-1.1.12-old/tool/VentoyWorker.sh 2026-04-24 18:49:51.407567635 +0100
|
||||
+++ ventoy-1.1.12-new/tool/VentoyWorker.sh 2026-04-24 19:07:55.381417420 +0100
|
||||
@@ -106,7 +106,7 @@
|
||||
if check_tool_work_ok; then
|
||||
vtdebug "check tool work ok"
|
||||
|
|
@ -162,10 +161,10 @@ diff -Naur ventoy-1.1.10-old/tool/VentoyWorker.sh ventoy-1.1.10-new/tool/VentoyW
|
|||
|
||||
check_umount_disk "$DISK"
|
||||
|
||||
diff -Naur ventoy-1.1.10-old/Ventoy2Disk.sh ventoy-1.1.10-new/Ventoy2Disk.sh
|
||||
--- ventoy-1.1.10-old/Ventoy2Disk.sh 2026-03-03 16:17:02.373290887 +0000
|
||||
+++ ventoy-1.1.10-new/Ventoy2Disk.sh 2026-03-03 16:35:41.510486932 +0000
|
||||
@@ -32,56 +32,4 @@
|
||||
diff --color -Naur ventoy-1.1.12-old/Ventoy2Disk.sh ventoy-1.1.12-new/Ventoy2Disk.sh
|
||||
--- ventoy-1.1.12-old/Ventoy2Disk.sh 2026-04-24 18:49:51.366082120 +0100
|
||||
+++ ventoy-1.1.12-new/Ventoy2Disk.sh 2026-04-24 20:19:55.219025537 +0100
|
||||
@@ -32,66 +32,4 @@
|
||||
echo '**********************************************'
|
||||
echo ''
|
||||
|
||||
|
|
@ -203,6 +202,16 @@ diff -Naur ventoy-1.1.10-old/Ventoy2Disk.sh ventoy-1.1.10-new/Ventoy2Disk.sh
|
|||
- if ldd --version 2>&1 | grep -qi musl; then
|
||||
- mv mkexfatfs mkexfatfs_shared
|
||||
- mv mkexfatfs_static mkexfatfs
|
||||
- else
|
||||
- if ./mkexfatfs -V > /dev/null 2>&1; then
|
||||
- echo "mkexfatfs can not run, check static version" >> ./log.txt
|
||||
- else
|
||||
- if ./mkexfatfs_static -V > /dev/null 2>&1; then
|
||||
- echo "Use static version of mkexfatfs" >> ./log.txt
|
||||
- mv mkexfatfs mkexfatfs_shared
|
||||
- mv mkexfatfs_static mkexfatfs
|
||||
- fi
|
||||
- fi
|
||||
- fi
|
||||
-fi
|
||||
-
|
||||
|
|
@ -223,9 +232,9 @@ diff -Naur ventoy-1.1.10-old/Ventoy2Disk.sh ventoy-1.1.10-new/Ventoy2Disk.sh
|
|||
- fi
|
||||
-fi
|
||||
+./tool/VentoyWorker.sh $*
|
||||
diff -Naur ventoy-1.1.10-old/VentoyPlugson.sh ventoy-1.1.10-new/VentoyPlugson.sh
|
||||
--- ventoy-1.1.10-old/VentoyPlugson.sh 2026-03-03 16:17:02.374195975 +0000
|
||||
+++ ventoy-1.1.10-new/VentoyPlugson.sh 2026-03-03 16:37:42.662416899 +0000
|
||||
diff --color -Naur ventoy-1.1.12-old/VentoyPlugson.sh ventoy-1.1.12-new/VentoyPlugson.sh
|
||||
--- ventoy-1.1.12-old/VentoyPlugson.sh 2026-04-24 18:49:51.367031295 +0100
|
||||
+++ ventoy-1.1.12-new/VentoyPlugson.sh 2026-04-24 19:08:41.624869288 +0100
|
||||
@@ -43,39 +43,6 @@
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -278,9 +287,9 @@ diff -Naur ventoy-1.1.10-old/VentoyPlugson.sh ventoy-1.1.10-new/VentoyPlugson.sh
|
|||
- cd "$OLDDIR"
|
||||
- fi
|
||||
-fi
|
||||
diff -Naur ventoy-1.1.10-old/VentoyWeb.sh ventoy-1.1.10-new/VentoyWeb.sh
|
||||
--- ventoy-1.1.10-old/VentoyWeb.sh 2026-03-03 16:17:02.374230398 +0000
|
||||
+++ ventoy-1.1.10-new/VentoyWeb.sh 2026-03-03 16:39:37.047028579 +0000
|
||||
diff --color -Naur ventoy-1.1.12-old/VentoyWeb.sh ventoy-1.1.12-new/VentoyWeb.sh
|
||||
--- ventoy-1.1.12-old/VentoyWeb.sh 2026-04-24 18:49:51.367070384 +0100
|
||||
+++ ventoy-1.1.12-new/VentoyWeb.sh 2026-04-24 19:09:55.231705458 +0100
|
||||
@@ -15,12 +15,6 @@
|
||||
echo ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,11 +59,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
"ventoy"
|
||||
+ optionalString (defaultGuiType == "gtk3") "-gtk3"
|
||||
+ optionalString (defaultGuiType == "qt5") "-qt5";
|
||||
version = "1.1.10";
|
||||
version = "1.1.12";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ventoy/Ventoy/releases/download/v${finalAttrs.version}/ventoy-${finalAttrs.version}-linux.tar.gz";
|
||||
hash = "sha256-EROr5uG7cSg0/ldKlmYhqRKFgAT0/v1wFmbsl8W+sgg=";
|
||||
hash = "sha256-BGILVGvMXu61lxdnWVs3E+495xWAqCRJBTxTp8sy/Nk=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@
|
|||
}:
|
||||
buildDotnetModule (finalAttrs: {
|
||||
pname = "vrcvideocacher";
|
||||
version = "2026.4.4";
|
||||
version = "2026.4.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "EllyVR";
|
||||
repo = "VRCVideoCacher";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-VollU7um18HYeIyXC8PzqcNbBYM3gd2JzxSql4VSFWw=";
|
||||
hash = "sha256-0jQK/VFbiMlX9txA/FuyCLe5AADH3IzvvIffZNU5Hes=";
|
||||
};
|
||||
|
||||
__structuredAttrs = true;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
python3Packages.buildPythonApplication (finalAttrs: {
|
||||
pname = "yutto";
|
||||
version = "2.1.1";
|
||||
version = "2.2.0";
|
||||
pyproject = true;
|
||||
|
||||
pythonRelaxDeps = true;
|
||||
|
|
@ -16,7 +16,7 @@ python3Packages.buildPythonApplication (finalAttrs: {
|
|||
owner = "yutto-dev";
|
||||
repo = "yutto";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-zolH3mf9YQLZLK98hhbHqUdDLRDodS/fChyfZ/xzVew=";
|
||||
hash = "sha256-5p0/a7cwmXqQVQP90cgwWHFpFaT+YDGDFbN+EGH89CA=";
|
||||
};
|
||||
|
||||
build-system = with python3Packages; [ uv-build ];
|
||||
|
|
@ -31,6 +31,7 @@ python3Packages.buildPythonApplication (finalAttrs: {
|
|||
typing-extensions
|
||||
pydantic
|
||||
returns
|
||||
segno
|
||||
]
|
||||
++ (with httpx.optional-dependencies; http2 ++ socks);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
jq,
|
||||
nix-prefetch-github,
|
||||
yarn,
|
||||
yarn2nix,
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
|
|
@ -29,7 +28,6 @@ stdenvNoCC.mkDerivation rec {
|
|||
jq
|
||||
nix-prefetch-github
|
||||
yarn
|
||||
yarn2nix
|
||||
];
|
||||
|
||||
meta = {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -10,14 +10,14 @@
|
|||
|
||||
buildPythonPackage (finalAttrs: {
|
||||
pname = "awsiotsdk";
|
||||
version = "1.28.2";
|
||||
version = "1.29.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "aws";
|
||||
repo = "aws-iot-device-sdk-python-v2";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-uhuKHn2aCqdJ1mN7Rp9/RNEuAv9STtgqpjF3Cjvw2pg=";
|
||||
hash = "sha256-YSBtViejJFlu3r38Kx1sn+TNkfq0+Zy/KfoBlJdj5Gg=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
|
|
|
|||
|
|
@ -20,14 +20,14 @@
|
|||
|
||||
buildPythonPackage (finalAttrs: {
|
||||
pname = "pydantic-ai-slim";
|
||||
version = "1.86.1";
|
||||
version = "1.87.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pydantic";
|
||||
repo = "pydantic-ai";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-4kDZzotCty40undBQoRXIzAFBufPIj3QSvhDjlG+Y6E=";
|
||||
hash = "sha256-Q5h+7XZ3SU1B9/kY2qBYraYrWFX3vcDFwQLld2oeQaA=";
|
||||
};
|
||||
|
||||
sourceRoot = "${finalAttrs.src.name}/pydantic_ai_slim";
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@
|
|||
|
||||
buildPythonPackage (finalAttrs: {
|
||||
pname = "pydantic-graph";
|
||||
version = "1.86.1";
|
||||
version = "1.87.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pydantic";
|
||||
repo = "pydantic-ai";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-4kDZzotCty40undBQoRXIzAFBufPIj3QSvhDjlG+Y6E=";
|
||||
hash = "sha256-Q5h+7XZ3SU1B9/kY2qBYraYrWFX3vcDFwQLld2oeQaA=";
|
||||
};
|
||||
|
||||
sourceRoot = "${finalAttrs.src.name}/pydantic_graph";
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
poetry-core,
|
||||
pytest-asyncio,
|
||||
pytestCheckHook,
|
||||
pythonAtLeast,
|
||||
typing-extensions,
|
||||
}:
|
||||
|
||||
|
|
@ -14,9 +14,6 @@ buildPythonPackage rec {
|
|||
version = "4.1.0";
|
||||
pyproject = true;
|
||||
|
||||
# https://github.com/ReactiveX/RxPY/issues/737
|
||||
disabled = pythonAtLeast "3.14";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ReactiveX";
|
||||
repo = "RxPY";
|
||||
|
|
@ -24,6 +21,15 @@ buildPythonPackage rec {
|
|||
hash = "sha256-napPfp72gqy43UmkPu1/erhjmJbZypHZQikmjIFVBqA=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Upstream PR: https://github.com/ReactiveX/RxPY/pull/728
|
||||
(fetchpatch {
|
||||
name = "python-3.14.patch";
|
||||
url = "https://github.com/ReactiveX/RxPY/commit/78f4a594ca2b0e27ad93ec0e1b1c0d56d5d6540d.patch";
|
||||
hash = "sha256-1GQm/4BTd5ZnIqfEUSb0Ja3w0y1R9EoFpzwua7gpIzo=";
|
||||
})
|
||||
];
|
||||
|
||||
build-system = [ poetry-core ];
|
||||
|
||||
dependencies = [ typing-extensions ];
|
||||
|
|
|
|||
|
|
@ -1,543 +0,0 @@
|
|||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
nodejs ? pkgs.nodejs,
|
||||
yarn ? pkgs.yarn,
|
||||
allowAliases ? pkgs.config.allowAliases,
|
||||
}@inputs:
|
||||
|
||||
let
|
||||
inherit (pkgs)
|
||||
stdenv
|
||||
lib
|
||||
callPackage
|
||||
git
|
||||
rsync
|
||||
runCommandLocal
|
||||
;
|
||||
|
||||
compose =
|
||||
f: g: x:
|
||||
f (g x);
|
||||
id = x: x;
|
||||
composeAll = builtins.foldl' compose id;
|
||||
|
||||
# https://docs.npmjs.com/files/package.json#license
|
||||
# TODO: support expression syntax (OR, AND, etc)
|
||||
getLicenseFromSpdxId =
|
||||
licstr: if licstr == "UNLICENSED" then lib.licenses.unfree else lib.getLicenseFromSpdxId licstr;
|
||||
in
|
||||
rec {
|
||||
# Export yarn again to make it easier to find out which yarn was used.
|
||||
inherit yarn;
|
||||
|
||||
# Re-export pkgs
|
||||
inherit pkgs;
|
||||
|
||||
unlessNull = item: alt: if item == null then alt else item;
|
||||
|
||||
reformatPackageName =
|
||||
pname:
|
||||
let
|
||||
# regex adapted from `validate-npm-package-name`
|
||||
# will produce 3 parts e.g.
|
||||
# "@someorg/somepackage" -> [ "@someorg/" "someorg" "somepackage" ]
|
||||
# "somepackage" -> [ null null "somepackage" ]
|
||||
parts = builtins.tail (builtins.match "^(@([^/]+)/)?([^/]+)$" pname);
|
||||
# if there is no organisation we need to filter out null values.
|
||||
non-null = builtins.filter (x: x != null) parts;
|
||||
in
|
||||
builtins.concatStringsSep "-" non-null;
|
||||
|
||||
inherit getLicenseFromSpdxId;
|
||||
|
||||
# Generates the yarn.nix from the yarn.lock file
|
||||
mkYarnNix =
|
||||
{
|
||||
yarnLock,
|
||||
flags ? [ ],
|
||||
}:
|
||||
pkgs.runCommand "yarn.nix" { }
|
||||
"${yarn2nix}/bin/yarn2nix --lockfile ${yarnLock} --no-patch --builtin-fetchgit ${lib.escapeShellArgs flags} > $out";
|
||||
|
||||
# Loads the generated offline cache. This will be used by yarn as
|
||||
# the package source.
|
||||
importOfflineCache =
|
||||
yarnNix:
|
||||
let
|
||||
pkg = callPackage yarnNix { };
|
||||
in
|
||||
pkg.offline_cache;
|
||||
|
||||
defaultYarnFlags = [
|
||||
"--offline"
|
||||
"--frozen-lockfile"
|
||||
"--ignore-engines"
|
||||
];
|
||||
|
||||
mkYarnModules =
|
||||
{
|
||||
name ? "${pname}-${version}", # safe name and version, e.g. testcompany-one-modules-1.0.0
|
||||
pname, # original name, e.g @testcompany/one
|
||||
version,
|
||||
packageJSON,
|
||||
yarnLock,
|
||||
yarnNix ? mkYarnNix { inherit yarnLock; },
|
||||
offlineCache ? importOfflineCache yarnNix,
|
||||
yarnFlags ? [ ],
|
||||
ignoreScripts ? true,
|
||||
nodejs ? inputs.nodejs,
|
||||
yarn ? inputs.yarn.override { inherit nodejs; },
|
||||
pkgConfig ? { },
|
||||
preBuild ? "",
|
||||
postBuild ? "",
|
||||
workspaceDependencies ? [ ], # List of yarn packages
|
||||
packageResolutions ? { },
|
||||
}:
|
||||
let
|
||||
extraNativeBuildInputs = lib.concatMap (key: pkgConfig.${key}.nativeBuildInputs or [ ]) (
|
||||
builtins.attrNames pkgConfig
|
||||
);
|
||||
extraBuildInputs = lib.concatMap (key: pkgConfig.${key}.buildInputs or [ ]) (
|
||||
builtins.attrNames pkgConfig
|
||||
);
|
||||
|
||||
postInstall = map (
|
||||
key:
|
||||
if (pkgConfig.${key} ? postInstall) then
|
||||
''
|
||||
for f in $(find -L -path '*/node_modules/${key}' -type d); do
|
||||
(cd "$f" && (${pkgConfig.${key}.postInstall}))
|
||||
done
|
||||
''
|
||||
else
|
||||
""
|
||||
) (builtins.attrNames pkgConfig);
|
||||
|
||||
# build-time JSON generation to avoid IFD
|
||||
# see https://wiki.nixos.org/wiki/Import_From_Derivation
|
||||
workspaceJSON =
|
||||
pkgs.runCommand "${name}-workspace-package.json"
|
||||
{
|
||||
nativeBuildInputs = [ pkgs.jq ];
|
||||
inherit packageJSON;
|
||||
passAsFile = [ "baseJSON" ];
|
||||
baseJSON = builtins.toJSON {
|
||||
private = true;
|
||||
workspaces = [ "deps/**" ];
|
||||
resolutions = packageResolutions;
|
||||
};
|
||||
}
|
||||
''
|
||||
jq --slurpfile packageJSON "$packageJSON" '.resolutions = $packageJSON[0].resolutions + .resolutions' <"$baseJSONPath" >$out
|
||||
'';
|
||||
|
||||
workspaceDependencyLinks = lib.concatMapStringsSep "\n" (dep: ''
|
||||
mkdir -p "deps/${dep.pname}"
|
||||
ln -sf ${dep.packageJSON} "deps/${dep.pname}/package.json"
|
||||
'') workspaceDependencies;
|
||||
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
inherit preBuild postBuild name;
|
||||
dontUnpack = true;
|
||||
dontInstall = true;
|
||||
nativeBuildInputs = [
|
||||
yarn
|
||||
nodejs
|
||||
git
|
||||
]
|
||||
++ extraNativeBuildInputs;
|
||||
buildInputs = extraBuildInputs;
|
||||
|
||||
configurePhase =
|
||||
lib.optionalString (offlineCache ? outputHash) ''
|
||||
if ! cmp -s ${yarnLock} ${offlineCache}/yarn.lock; then
|
||||
echo "yarn.lock changed, you need to update the fetchYarnDeps hash"
|
||||
exit 1
|
||||
fi
|
||||
''
|
||||
+ ''
|
||||
# Yarn writes cache directories etc to $HOME.
|
||||
export HOME=$PWD/yarn_home
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
mkdir -p "deps/${pname}"
|
||||
cp ${packageJSON} "deps/${pname}/package.json"
|
||||
cp ${workspaceJSON} ./package.json
|
||||
cp ${yarnLock} ./yarn.lock
|
||||
chmod +w ./yarn.lock
|
||||
|
||||
yarn config --offline set yarn-offline-mirror ${offlineCache}
|
||||
|
||||
# Do not look up in the registry, but in the offline cache.
|
||||
${fixup_yarn_lock}/bin/fixup_yarn_lock yarn.lock
|
||||
|
||||
${workspaceDependencyLinks}
|
||||
|
||||
yarn install ${
|
||||
lib.escapeShellArgs (defaultYarnFlags ++ lib.optional ignoreScripts "--ignore-scripts" ++ yarnFlags)
|
||||
}
|
||||
|
||||
${lib.concatStringsSep "\n" postInstall}
|
||||
|
||||
mkdir $out
|
||||
mv node_modules $out/
|
||||
mv deps $out/
|
||||
patchShebangs $out
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
dontCheckForBrokenSymlinks = true;
|
||||
};
|
||||
|
||||
# This can be used as a shellHook in mkYarnPackage. It brings the built node_modules into
|
||||
# the shell-hook environment.
|
||||
linkNodeModulesHook = ''
|
||||
if [[ -d node_modules || -L node_modules ]]; then
|
||||
echo "./node_modules is present. Replacing."
|
||||
rm -rf node_modules
|
||||
fi
|
||||
|
||||
ln -s "$node_modules" node_modules
|
||||
'';
|
||||
|
||||
mkYarnWorkspace =
|
||||
{
|
||||
src,
|
||||
packageJSON ? src + "/package.json",
|
||||
yarnLock ? src + "/yarn.lock",
|
||||
nodejs ? inputs.nodejs,
|
||||
yarn ? inputs.yarn.override { inherit nodejs; },
|
||||
packageOverrides ? { },
|
||||
...
|
||||
}@attrs:
|
||||
let
|
||||
package = lib.importJSON packageJSON;
|
||||
|
||||
packageGlobs =
|
||||
if lib.isList package.workspaces then package.workspaces else package.workspaces.packages;
|
||||
|
||||
packageResolutions = package.resolutions or { };
|
||||
|
||||
globElemToRegex = lib.replaceStrings [ "*" ] [ ".*" ];
|
||||
|
||||
# PathGlob -> [PathGlobElem]
|
||||
splitGlob = lib.splitString "/";
|
||||
|
||||
# Path -> [PathGlobElem] -> [Path]
|
||||
# Note: Only directories are included, everything else is filtered out
|
||||
expandGlobList =
|
||||
base: globElems:
|
||||
let
|
||||
elemRegex = globElemToRegex (lib.head globElems);
|
||||
rest = lib.tail globElems;
|
||||
children = lib.attrNames (
|
||||
lib.filterAttrs (name: type: type == "directory") (builtins.readDir base)
|
||||
);
|
||||
matchingChildren = lib.filter (child: builtins.match elemRegex child != null) children;
|
||||
in
|
||||
if globElems == [ ] then
|
||||
[ base ]
|
||||
else
|
||||
lib.concatMap (child: expandGlobList (base + ("/" + child)) rest) matchingChildren;
|
||||
|
||||
# Path -> PathGlob -> [Path]
|
||||
expandGlob = base: glob: expandGlobList base (splitGlob glob);
|
||||
|
||||
packagePaths = lib.concatMap (expandGlob src) packageGlobs;
|
||||
|
||||
packages = lib.listToAttrs (
|
||||
map (
|
||||
src:
|
||||
let
|
||||
packageJSON = src + "/package.json";
|
||||
|
||||
package = lib.importJSON packageJSON;
|
||||
|
||||
allDependencies = lib.foldl (a: b: a // b) { } (
|
||||
map (field: lib.attrByPath [ field ] { } package) [
|
||||
"dependencies"
|
||||
"devDependencies"
|
||||
]
|
||||
);
|
||||
|
||||
# { [name: String] : { pname : String, packageJSON : String, ... } } -> { [pname: String] : version } -> [{ pname : String, packageJSON : String, ... }]
|
||||
getWorkspaceDependencies =
|
||||
packages: allDependencies:
|
||||
let
|
||||
packageList = lib.attrValues packages;
|
||||
in
|
||||
composeAll [
|
||||
(lib.filter (x: x != null))
|
||||
(lib.mapAttrsToList (
|
||||
pname: _version: lib.findFirst (package: package.pname == pname) null packageList
|
||||
))
|
||||
] allDependencies;
|
||||
|
||||
workspaceDependencies = getWorkspaceDependencies packages allDependencies;
|
||||
|
||||
name = reformatPackageName package.name;
|
||||
in
|
||||
{
|
||||
inherit name;
|
||||
value = mkYarnPackage (
|
||||
removeAttrs attrs [ "packageOverrides" ]
|
||||
// {
|
||||
inherit
|
||||
src
|
||||
packageJSON
|
||||
yarnLock
|
||||
nodejs
|
||||
yarn
|
||||
packageResolutions
|
||||
workspaceDependencies
|
||||
;
|
||||
}
|
||||
// lib.attrByPath [ name ] { } packageOverrides
|
||||
);
|
||||
}
|
||||
) packagePaths
|
||||
);
|
||||
in
|
||||
packages;
|
||||
|
||||
mkYarnPackage =
|
||||
{
|
||||
name ? null,
|
||||
src,
|
||||
packageJSON ? src + "/package.json",
|
||||
yarnLock ? src + "/yarn.lock",
|
||||
yarnNix ? mkYarnNix { inherit yarnLock; },
|
||||
offlineCache ? importOfflineCache yarnNix,
|
||||
nodejs ? inputs.nodejs,
|
||||
yarn ? inputs.yarn.override { inherit nodejs; },
|
||||
yarnFlags ? [ ],
|
||||
yarnPreBuild ? "",
|
||||
yarnPostBuild ? "",
|
||||
pkgConfig ? { },
|
||||
extraBuildInputs ? [ ],
|
||||
publishBinsFor ? null,
|
||||
workspaceDependencies ? [ ], # List of yarnPackages
|
||||
packageResolutions ? { },
|
||||
...
|
||||
}@attrs:
|
||||
let
|
||||
package = lib.importJSON packageJSON;
|
||||
pname = attrs.pname or package.name;
|
||||
safeName = reformatPackageName package.name;
|
||||
version = attrs.version or package.version;
|
||||
baseName = unlessNull name "${safeName}-${version}";
|
||||
|
||||
workspaceDependenciesTransitive = lib.unique (
|
||||
(lib.flatten (map (dep: dep.workspaceDependencies) workspaceDependencies)) ++ workspaceDependencies
|
||||
);
|
||||
|
||||
deps = mkYarnModules {
|
||||
pname = package.name;
|
||||
name = "${safeName}-modules-${version}";
|
||||
preBuild = yarnPreBuild;
|
||||
postBuild = yarnPostBuild;
|
||||
workspaceDependencies = workspaceDependenciesTransitive;
|
||||
inherit
|
||||
packageJSON
|
||||
version
|
||||
yarnLock
|
||||
offlineCache
|
||||
nodejs
|
||||
yarn
|
||||
yarnFlags
|
||||
pkgConfig
|
||||
packageResolutions
|
||||
;
|
||||
};
|
||||
|
||||
publishBinsFor_ = unlessNull publishBinsFor [ package.name ];
|
||||
|
||||
linkDirFunction = ''
|
||||
linkDirToDirLinks() {
|
||||
target=$1
|
||||
if [ ! -f "$target" ]; then
|
||||
mkdir -p "$target"
|
||||
elif [ -L "$target" ]; then
|
||||
local new=$(mktemp -d)
|
||||
trueSource=$(realpath "$target")
|
||||
if [ "$(ls $trueSource | wc -l)" -gt 0 ]; then
|
||||
ln -s $trueSource/* $new/
|
||||
fi
|
||||
rm -r "$target"
|
||||
mv "$new" "$target"
|
||||
fi
|
||||
}
|
||||
'';
|
||||
|
||||
workspaceDependencyCopy = lib.concatMapStringsSep "\n" (dep: ''
|
||||
# ensure any existing scope directory is not a symlink
|
||||
linkDirToDirLinks "$(dirname node_modules/${dep.package.name})"
|
||||
mkdir -p "deps/${dep.package.name}"
|
||||
tar -xf "${dep}/tarballs/${dep.name}.tgz" --directory "deps/${dep.package.name}" --strip-components=1
|
||||
if [ ! -e "deps/${dep.package.name}/node_modules" ]; then
|
||||
ln -s "${deps}/deps/${dep.package.name}/node_modules" "deps/${dep.package.name}/node_modules"
|
||||
fi
|
||||
'') workspaceDependenciesTransitive;
|
||||
|
||||
in
|
||||
stdenv.mkDerivation (
|
||||
removeAttrs attrs [
|
||||
"yarnNix"
|
||||
"pkgConfig"
|
||||
"workspaceDependencies"
|
||||
"packageResolutions"
|
||||
]
|
||||
// {
|
||||
inherit pname version src;
|
||||
|
||||
name = baseName;
|
||||
|
||||
buildInputs = [
|
||||
yarn
|
||||
nodejs
|
||||
rsync
|
||||
]
|
||||
++ extraBuildInputs;
|
||||
|
||||
node_modules = deps + "/node_modules";
|
||||
|
||||
configurePhase =
|
||||
attrs.configurePhase or ''
|
||||
runHook preConfigure
|
||||
|
||||
for localDir in npm-packages-offline-cache node_modules; do
|
||||
if [[ -d $localDir || -L $localDir ]]; then
|
||||
echo "$localDir dir present. Removing."
|
||||
rm -rf $localDir
|
||||
fi
|
||||
done
|
||||
|
||||
# move convent of . to ./deps/${package.name}
|
||||
mv $PWD $NIX_BUILD_TOP/temp
|
||||
mkdir -p "$PWD/deps/${package.name}"
|
||||
rm -fd "$PWD/deps/${package.name}"
|
||||
mv $NIX_BUILD_TOP/temp "$PWD/deps/${package.name}"
|
||||
cd $PWD
|
||||
|
||||
ln -s ${deps}/deps/${package.name}/node_modules "deps/${package.name}/node_modules"
|
||||
|
||||
cp -r $node_modules node_modules
|
||||
chmod -R +w node_modules
|
||||
|
||||
${linkDirFunction}
|
||||
|
||||
linkDirToDirLinks "$(dirname node_modules/${package.name})"
|
||||
ln -s "deps/${package.name}" "node_modules/${package.name}"
|
||||
|
||||
${workspaceDependencyCopy}
|
||||
|
||||
# Help yarn commands run in other phases find the package
|
||||
echo "--cwd deps/${package.name}" > .yarnrc
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
# Replace this phase on frontend packages where only the generated
|
||||
# files are an interesting output.
|
||||
installPhase =
|
||||
attrs.installPhase or ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{bin,libexec/${package.name}}
|
||||
mv node_modules $out/libexec/${package.name}/node_modules
|
||||
mv deps $out/libexec/${package.name}/deps
|
||||
|
||||
node ${./internal/fixup_bin.js} $out/bin $out/libexec/${package.name}/node_modules ${lib.concatStringsSep " " publishBinsFor_}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
dontCheckForBrokenSymlinks = true;
|
||||
|
||||
doDist = attrs.doDist or true;
|
||||
|
||||
distPhase =
|
||||
attrs.distPhase or ''
|
||||
# pack command ignores cwd option
|
||||
rm -f .yarnrc
|
||||
cd $out/libexec/${package.name}/deps/${package.name}
|
||||
mkdir -p $out/tarballs/
|
||||
yarn pack --offline --ignore-scripts --filename $out/tarballs/${baseName}.tgz
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit package packageJSON deps;
|
||||
workspaceDependencies = workspaceDependenciesTransitive;
|
||||
}
|
||||
// (attrs.passthru or { });
|
||||
|
||||
meta = {
|
||||
inherit (nodejs.meta) platforms;
|
||||
}
|
||||
// lib.optionalAttrs (package ? description) { inherit (package) description; }
|
||||
// lib.optionalAttrs (package ? homepage) { inherit (package) homepage; }
|
||||
// lib.optionalAttrs (package ? license) { license = getLicenseFromSpdxId package.license; }
|
||||
// (attrs.meta or { });
|
||||
}
|
||||
);
|
||||
|
||||
yarn2nix = mkYarnPackage {
|
||||
src = ./yarn2nix;
|
||||
|
||||
# yarn2nix is the only package that requires the yarnNix option.
|
||||
# All the other projects can auto-generate that file.
|
||||
yarnNix = ./yarn.nix;
|
||||
|
||||
# Using the filter above and importing package.json from the filtered
|
||||
# source results in an error in restricted mode. To circumvent this,
|
||||
# we import package.json from the unfiltered source
|
||||
packageJSON = ./yarn2nix/package.json;
|
||||
|
||||
yarnFlags = defaultYarnFlags ++ [
|
||||
"--ignore-scripts"
|
||||
"--production=true"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
|
||||
buildPhase = ''
|
||||
source ${./nix/expectShFunctions.sh}
|
||||
|
||||
expectFilePresent ./node_modules/.yarn-integrity
|
||||
|
||||
# check dependencies are installed
|
||||
expectFilePresent ./node_modules/@yarnpkg/lockfile/package.json
|
||||
|
||||
# check devDependencies are not installed
|
||||
expectFileOrDirAbsent ./node_modules/.bin/eslint
|
||||
expectFileOrDirAbsent ./node_modules/eslint/package.json
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/yarn2nix --prefix PATH : "${pkgs.nix-prefetch-git}/bin"
|
||||
'';
|
||||
};
|
||||
|
||||
fixup_yarn_lock =
|
||||
runCommandLocal "fixup_yarn_lock"
|
||||
{
|
||||
buildInputs = [ nodejs ];
|
||||
}
|
||||
''
|
||||
mkdir -p $out/lib
|
||||
mkdir -p $out/bin
|
||||
|
||||
cp ${./yarn2nix/lib/urlToName.js} $out/lib/urlToName.js
|
||||
cp ${./internal/fixup_yarn_lock.js} $out/bin/fixup_yarn_lock
|
||||
|
||||
patchShebangs $out
|
||||
'';
|
||||
}
|
||||
// lib.optionalAttrs allowAliases {
|
||||
# Aliases
|
||||
spdxLicense = getLicenseFromSpdxId; # added 2021-12-01
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
/* Usage:
|
||||
* node fixup_bin.js <bin_dir> <modules_dir> [<bin_pkg_1>, <bin_pkg_2> ... ]
|
||||
*/
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const derivationBinPath = process.argv[2];
|
||||
const nodeModules = process.argv[3];
|
||||
const packagesToPublishBin = process.argv.slice(4);
|
||||
|
||||
function processPackage(name) {
|
||||
console.log("fixup_bin: Processing ", name);
|
||||
|
||||
const packagePath = `${nodeModules}/${name}`;
|
||||
const packageJsonPath = `${packagePath}/package.json`;
|
||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath));
|
||||
|
||||
if (!packageJson.bin) {
|
||||
console.log("fixup_bin: No binaries provided");
|
||||
return;
|
||||
}
|
||||
|
||||
// There are two alternative syntaxes for `bin`
|
||||
// a) just a plain string, in which case the name of the package is the name of the binary.
|
||||
// b) an object, where key is the name of the eventual binary, and the value the path to that binary.
|
||||
if (typeof packageJson.bin === "string") {
|
||||
const binName = packageJson.bin;
|
||||
packageJson.bin = {};
|
||||
packageJson.bin[packageJson.name] = binName;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax, guard-for-in
|
||||
for (const binName in packageJson.bin) {
|
||||
const binPath = packageJson.bin[binName];
|
||||
const normalizedBinName = binName.replace("@", "").replace("/", "-");
|
||||
|
||||
const targetPath = path.normalize(`${packagePath}/${binPath}`);
|
||||
const createdPath = `${derivationBinPath}/${normalizedBinName}`;
|
||||
|
||||
console.log(
|
||||
`fixup_bin: creating link ${createdPath} that points to ${targetPath}`
|
||||
);
|
||||
|
||||
fs.symlinkSync(targetPath, createdPath);
|
||||
}
|
||||
}
|
||||
|
||||
packagesToPublishBin.forEach(pkg => {
|
||||
processPackage(pkg);
|
||||
});
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
/* Usage:
|
||||
* node fixup_yarn_lock.js yarn.lock
|
||||
*/
|
||||
|
||||
const fs = require("fs");
|
||||
const readline = require("readline");
|
||||
|
||||
const urlToName = require("../lib/urlToName");
|
||||
|
||||
const yarnLockPath = process.argv[2];
|
||||
|
||||
const readFile = readline.createInterface({
|
||||
input: fs.createReadStream(yarnLockPath, { encoding: "utf8" }),
|
||||
|
||||
// Note: we use the crlfDelay option to recognize all instances of CR LF
|
||||
// ('\r\n') in input.txt as a single line break.
|
||||
crlfDelay: Infinity,
|
||||
|
||||
terminal: false // input and output should be treated like a TTY
|
||||
});
|
||||
|
||||
const result = [];
|
||||
|
||||
readFile
|
||||
.on("line", line => {
|
||||
const arr = line.match(/^ {2}resolved "([^#]+)(#[^"]+)?"$/);
|
||||
|
||||
if (arr !== null) {
|
||||
const [_, url, shaOrRev] = arr;
|
||||
|
||||
const fileName = urlToName(url);
|
||||
|
||||
result.push(` resolved "${fileName}${shaOrRev ?? ""}"`);
|
||||
} else {
|
||||
result.push(line);
|
||||
}
|
||||
})
|
||||
.on("close", () => {
|
||||
fs.writeFile(yarnLockPath, result.join("\n"), "utf8", err => {
|
||||
if (err) {
|
||||
console.error(
|
||||
"fixup_yarn_lock: fatal error when trying to write to yarn.lock",
|
||||
err
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
expectFilePresent () {
|
||||
if [ -f "$1" ]; then
|
||||
echo "Test passed: file is present - $1"
|
||||
else
|
||||
echo "Test failed: file is absent - $1"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
expectFileOrDirAbsent () {
|
||||
if [ ! -e "$1" ];
|
||||
then
|
||||
echo "Test passed: file or dir is absent - $1"
|
||||
else
|
||||
echo "Test failed: file or dir is present - $1"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
expectEqual () {
|
||||
if [ "$1" == "$2" ];
|
||||
then
|
||||
echo "Test passed: output is equal to expected_output"
|
||||
else
|
||||
echo "Test failed: output is not equal to expected_output:"
|
||||
echo " output - $1"
|
||||
echo " expected_output - $2"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1 +0,0 @@
|
|||
node_modules
|
||||
|
|
@ -1 +0,0 @@
|
|||
node_modules
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const fs = require("fs");
|
||||
const lockfile = require("@yarnpkg/lockfile");
|
||||
const { docopt } = require("docopt");
|
||||
const deepEqual = require("deep-equal");
|
||||
const R = require("ramda");
|
||||
|
||||
const fixPkgAddMissingSha1 = require("../lib/fixPkgAddMissingSha1");
|
||||
const mapObjIndexedReturnArray = require("../lib/mapObjIndexedReturnArray");
|
||||
const generateNix = require("../lib/generateNix");
|
||||
|
||||
const USAGE = `
|
||||
Usage: yarn2nix [options]
|
||||
|
||||
Options:
|
||||
-h --help Shows this help.
|
||||
--no-nix Hide the nix output
|
||||
--no-patch Don't patch the lockfile if hashes are missing
|
||||
--lockfile=FILE Specify path to the lockfile [default: ./yarn.lock].
|
||||
--builtin-fetchgit Use builtin fetchGit for git dependencies to support on-the-fly generation of yarn.nix without an internet connection
|
||||
`;
|
||||
|
||||
const options = docopt(USAGE);
|
||||
|
||||
const data = fs.readFileSync(options["--lockfile"], "utf8");
|
||||
|
||||
// json example:
|
||||
|
||||
// {
|
||||
// type:'success',
|
||||
// object:{
|
||||
// 'abbrev@1':{
|
||||
// version:'1.0.9',
|
||||
// resolved:'https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135'
|
||||
// },
|
||||
// 'shell-quote@git+https://github.com/srghma/node-shell-quote.git#without_unlicenced_jsonify':{
|
||||
// version:'1.6.0',
|
||||
// resolved:'git+https://github.com/srghma/node-shell-quote.git#0aa381896e0cd7409ead15fd444f225807a61e0a'
|
||||
// },
|
||||
// '@graphile/plugin-supporter@git+https://1234user:1234pass@git.graphile.com/git/users/1234user/postgraphile-supporter.git':{
|
||||
// version:'1.6.0',
|
||||
// resolved:'git+https://1234user:1234pass@git.graphile.com/git/users/1234user/postgraphile-supporter.git#1234commit'
|
||||
// },
|
||||
// }
|
||||
// }
|
||||
|
||||
const json = lockfile.parse(data);
|
||||
|
||||
if (json.type !== "success") {
|
||||
throw new Error("yarn.lock parse error");
|
||||
}
|
||||
|
||||
// Check for missing hashes in the yarn.lock and patch if necessary
|
||||
|
||||
let pkgs = R.pipe(
|
||||
mapObjIndexedReturnArray((value, key) => ({
|
||||
...value,
|
||||
nameWithVersion: key,
|
||||
})),
|
||||
R.uniqBy(R.prop("resolved")),
|
||||
)(json.object);
|
||||
|
||||
(async () => {
|
||||
if (!options["--no-patch"]) {
|
||||
pkgs = await Promise.all(R.map(fixPkgAddMissingSha1, pkgs));
|
||||
}
|
||||
|
||||
const origJson = lockfile.parse(data);
|
||||
|
||||
if (!deepEqual(origJson, json)) {
|
||||
console.error("found changes in the lockfile", options["--lockfile"]);
|
||||
|
||||
if (options["--no-patch"]) {
|
||||
console.error("...aborting");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
fs.writeFileSync(options["--lockfile"], lockfile.stringify(json.object));
|
||||
}
|
||||
|
||||
if (!options["--no-nix"]) {
|
||||
// print to stdout
|
||||
console.log(generateNix(pkgs, options["--builtin-fetchgit"]));
|
||||
}
|
||||
})().catch((error) => {
|
||||
console.error(error);
|
||||
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
import js from "@eslint/js";
|
||||
import globals from "globals";
|
||||
import { defineConfig } from "eslint/config";
|
||||
|
||||
|
||||
export default defineConfig([
|
||||
{ files: ["**/*.{js,mjs,cjs}"],
|
||||
plugins: { js },
|
||||
extends: ["js/recommended"],
|
||||
rules: {
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"argsIgnorePattern": "^_",
|
||||
"varsIgnorePattern": "^_",
|
||||
"caughtErrorsIgnorePattern": "^_",
|
||||
"destructuredArrayIgnorePattern": "^_"
|
||||
}
|
||||
]
|
||||
},
|
||||
},
|
||||
{ files: ["**/*.js"], languageOptions: { sourceType: "commonjs" } },
|
||||
{ files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: globals.node } },
|
||||
]);
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
const https = require("https");
|
||||
const crypto = require("crypto");
|
||||
|
||||
// TODO:
|
||||
// make test case where getSha1 function is used, i.e. the case when resolved is without sha1?
|
||||
// consider using https://github.com/request/request-promise-native
|
||||
|
||||
function getSha1(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
https.get(url, (res) => {
|
||||
const { statusCode } = res;
|
||||
const hash = crypto.createHash("sha1");
|
||||
|
||||
if (statusCode !== 200) {
|
||||
const err = new Error(`Request Failed.\nStatus Code: ${statusCode}`);
|
||||
|
||||
// consume response data to free up memory
|
||||
res.resume();
|
||||
|
||||
reject(err);
|
||||
}
|
||||
|
||||
res.on("data", (chunk) => {
|
||||
hash.update(chunk);
|
||||
});
|
||||
|
||||
res.on("end", () => {
|
||||
resolve(hash.digest("hex"));
|
||||
});
|
||||
|
||||
res.on("error", reject);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Object -> Object
|
||||
async function fixPkgAddMissingSha1(pkg) {
|
||||
// local dependency
|
||||
|
||||
if (!pkg.resolved) {
|
||||
console.error(
|
||||
`yarn2nix: can't find "resolved" field for package ${pkg.nameWithVersion}, you probably required it using "file:...", this feature is not supported, ignoring`,
|
||||
);
|
||||
return pkg;
|
||||
}
|
||||
|
||||
const [url, sha1] = pkg.resolved.split("#", 2);
|
||||
|
||||
if (sha1 || url.startsWith("https://codeload.github.com/")) {
|
||||
return pkg;
|
||||
}
|
||||
|
||||
// if there is no sha1 in resolved url
|
||||
// (this could happen if yarn.lock was generated by older version of yarn)
|
||||
// - request it from registry by https and add it to pkg
|
||||
const newSha1 = await getSha1(url);
|
||||
|
||||
return {
|
||||
...pkg,
|
||||
resolved: `${url}#${newSha1}`,
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = fixPkgAddMissingSha1;
|
||||
|
|
@ -1,179 +0,0 @@
|
|||
const R = require("ramda");
|
||||
const ssri = require("ssri");
|
||||
|
||||
const urlToName = require("./urlToName");
|
||||
const { execFileSync } = require("child_process");
|
||||
|
||||
// fetchgit transforms
|
||||
//
|
||||
// "shell-quote@git+https://github.com/srghma/node-shell-quote.git#without_unlicenced_jsonify":
|
||||
// version "1.6.0"
|
||||
// resolved "git+https://github.com/srghma/node-shell-quote.git#1234commit"
|
||||
//
|
||||
// to
|
||||
//
|
||||
// fetchGit {
|
||||
// url = "https://github.com/srghma/node-shell-quote.git";
|
||||
// ref = "without_unlicenced_jsonify";
|
||||
// rev = "1234commit";
|
||||
// }
|
||||
//
|
||||
// and transforms
|
||||
//
|
||||
// "@graphile/plugin-supporter@git+https://1234user:1234pass@git.graphile.com/git/users/1234user/postgraphile-supporter.git":
|
||||
// version "0.6.0"
|
||||
// resolved "git+https://1234user:1234pass@git.graphile.com/git/users/1234user/postgraphile-supporter.git#1234commit"
|
||||
//
|
||||
// to
|
||||
//
|
||||
// fetchGit {
|
||||
// url = "https://1234user:1234pass@git.graphile.com/git/users/1234user/postgraphile-supporter.git";
|
||||
// ref = "master";
|
||||
// rev = "1234commit";
|
||||
// }
|
||||
|
||||
function prefetchgit(url, rev) {
|
||||
return JSON.parse(
|
||||
execFileSync(
|
||||
"nix-prefetch-git",
|
||||
["--rev", rev, url, "--fetch-submodules"],
|
||||
{
|
||||
stdio: ["ignore", "pipe", "ignore"],
|
||||
timeout: 60000,
|
||||
},
|
||||
),
|
||||
).sha256;
|
||||
}
|
||||
|
||||
function fetchgit(fileName, url, rev, branch, builtinFetchGit) {
|
||||
const repo = builtinFetchGit
|
||||
? `fetchGit ({
|
||||
url = "${url}";
|
||||
ref = "${branch}";
|
||||
rev = "${rev}";
|
||||
} // (if builtins.compareVersions "2.4pre" builtins.nixVersion < 0 then {
|
||||
# workaround for https://github.com/NixOS/nix/issues/5128
|
||||
allRefs = true;
|
||||
} else {}))`
|
||||
: `fetchgit {
|
||||
url = "${url}";
|
||||
rev = "${rev}";
|
||||
sha256 = "${prefetchgit(url, rev)}";
|
||||
}`;
|
||||
|
||||
return ` {
|
||||
name = "${fileName}";
|
||||
path =
|
||||
let repo = ${repo};
|
||||
in runCommand "${fileName}" { buildInputs = [gnutar]; } ''
|
||||
# Set u+w because tar-fs can't unpack archives with read-only dirs
|
||||
# https://github.com/mafintosh/tar-fs/issues/79
|
||||
tar cf $out --mode u+w -C \${repo} .
|
||||
'';
|
||||
}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse an integrity hash out of an SSRI string.
|
||||
*
|
||||
* Provides a default and uses the "best" supported algorithm if there are multiple.
|
||||
*/
|
||||
function parseIntegrity(maybeIntegrity, fallbackHash) {
|
||||
if (!maybeIntegrity && fallbackHash) {
|
||||
return { algo: "sha1", hash: fallbackHash };
|
||||
}
|
||||
|
||||
const integrities = ssri.parse(maybeIntegrity);
|
||||
for (const key in integrities) {
|
||||
if (!/^sha(1|256|512)$/.test(key)) {
|
||||
delete integrities[key];
|
||||
}
|
||||
}
|
||||
|
||||
const algo = integrities.pickAlgorithm();
|
||||
const hash = integrities[algo][0].digest;
|
||||
return { algo, hash };
|
||||
}
|
||||
|
||||
function fetchLockedDep(builtinFetchGit) {
|
||||
return function (pkg) {
|
||||
const { integrity, nameWithVersion, resolved } = pkg;
|
||||
|
||||
if (!resolved) {
|
||||
console.error(
|
||||
`yarn2nix: can't find "resolved" field for package ${nameWithVersion}, you probably required it using "file:...", this feature is not supported, ignoring`,
|
||||
);
|
||||
return "";
|
||||
}
|
||||
|
||||
const [url, sha1OrRev] = resolved.split("#");
|
||||
|
||||
const fileName = urlToName(url);
|
||||
|
||||
if (resolved.startsWith("https://codeload.github.com/")) {
|
||||
const s = resolved.split("/");
|
||||
const githubUrl = `https://github.com/${s[3]}/${s[4]}.git`;
|
||||
const githubRev = s[6];
|
||||
|
||||
const [_, branch] = nameWithVersion.split("#");
|
||||
|
||||
return fetchgit(
|
||||
fileName,
|
||||
githubUrl,
|
||||
githubRev,
|
||||
branch || "master",
|
||||
builtinFetchGit,
|
||||
);
|
||||
}
|
||||
|
||||
if (url.startsWith("git+") || url.startsWith("git:")) {
|
||||
const rev = sha1OrRev;
|
||||
|
||||
const [_, branch] = nameWithVersion.split("#");
|
||||
|
||||
const urlForGit = url.replace(/^git\+/, "");
|
||||
|
||||
return fetchgit(
|
||||
fileName,
|
||||
urlForGit,
|
||||
rev,
|
||||
branch || "master",
|
||||
builtinFetchGit,
|
||||
);
|
||||
}
|
||||
|
||||
const { algo, hash } = parseIntegrity(integrity, sha1OrRev);
|
||||
|
||||
return ` {
|
||||
name = "${fileName}";
|
||||
path = fetchurl {
|
||||
name = "${fileName}";
|
||||
url = "${url}";
|
||||
${algo} = "${hash}";
|
||||
};
|
||||
}`;
|
||||
};
|
||||
}
|
||||
|
||||
const HEAD = `
|
||||
{ fetchurl, fetchgit, linkFarm, runCommand, gnutar }: rec {
|
||||
offline_cache = linkFarm "offline" packages;
|
||||
packages = [
|
||||
`.trim();
|
||||
|
||||
// Object -> String
|
||||
function generateNix(pkgs, builtinFetchGit) {
|
||||
const nameWithVersionAndPackageNix = R.map(
|
||||
fetchLockedDep(builtinFetchGit),
|
||||
pkgs,
|
||||
);
|
||||
|
||||
const packagesDefinition = R.join(
|
||||
"\n",
|
||||
R.values(nameWithVersionAndPackageNix),
|
||||
);
|
||||
|
||||
return R.join("\n", [HEAD, packagesDefinition, " ];", "}"]);
|
||||
}
|
||||
|
||||
module.exports = generateNix;
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
const _curry2 = require("ramda/src/internal/_curry2");
|
||||
const _map = require("ramda/src/internal/_map");
|
||||
const keys = require("ramda/src/keys");
|
||||
|
||||
// mapObjIndexed: ((v, k, {k: v}) → v') → {k: v} → {k: v'}
|
||||
// mapObjIndexedReturnArray: ((v, k, {k: v}) → v') → {k: v} → [v']
|
||||
|
||||
/*
|
||||
* @example
|
||||
*
|
||||
* const xyz = { x: 1, y: 2, z: 3 };
|
||||
* const prependKeyAndDouble = (num, key, obj) => key + (num * 2);
|
||||
*
|
||||
* mapObjIndexedReturnArray(prependKeyAndDouble, xyz); //=> ['x2', 'y4', 'z6']
|
||||
*/
|
||||
|
||||
const mapObjIndexedReturnArray = _curry2((fn, obj) =>
|
||||
_map((key) => fn(obj[key], key, obj), keys(obj)),
|
||||
);
|
||||
|
||||
module.exports = mapObjIndexedReturnArray;
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
const path = require("path");
|
||||
|
||||
// String -> String
|
||||
|
||||
// @url examples:
|
||||
// - https://registry.yarnpkg.com/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz
|
||||
// - https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz
|
||||
// - git+https://github.com/srghma/node-shell-quote.git
|
||||
// - git+https://1234user:1234pass@git.graphile.com/git/users/1234user/postgraphile-supporter.git
|
||||
// - https://codeload.github.com/Gargron/emoji-mart/tar.gz/934f314fd8322276765066e8a2a6be5bac61b1cf
|
||||
|
||||
function urlToName(url) {
|
||||
// Yarn generates `codeload.github.com` tarball URLs, where the final
|
||||
// path component (file name) is the git hash. See #111.
|
||||
// See also https://github.com/yarnpkg/yarn/blob/989a7406/src/resolvers/exotics/github-resolver.js#L24-L26
|
||||
let isCodeloadGitTarballUrl =
|
||||
url.startsWith("https://codeload.github.com/") && url.includes("/tar.gz/");
|
||||
|
||||
if (url.startsWith("git+") || isCodeloadGitTarballUrl) {
|
||||
return path.basename(url);
|
||||
}
|
||||
|
||||
return url
|
||||
.replace(/https:\/\/(.)*(.com)\//g, "") // prevents having long directory names
|
||||
.replace(/[@/%:-]/g, "_"); // replace @ and : and - and % characters with underscore
|
||||
}
|
||||
|
||||
module.exports = urlToName;
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
{
|
||||
"name": "yarn2nix",
|
||||
"version": "1.0.0",
|
||||
"description": "Convert packages.json and yarn.lock into a Nix expression that downloads all the dependencies",
|
||||
"main": "index.js",
|
||||
"repository": ".",
|
||||
"author": "Maarten Hoogendoorn <maarten@moretea.nl>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"yarn2nix": "bin/yarn2nix.js",
|
||||
"format": "prettier-eslint --write './**/*.{js,jsx,json}'",
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"bin": {
|
||||
"yarn2nix": "bin/yarn2nix.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yarnpkg/lockfile": "^1.1.0",
|
||||
"deep-equal": "^2.2.3",
|
||||
"docopt": "^0.6.2",
|
||||
"ramda": "^0.32",
|
||||
"ssri": "^13.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.1",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-config-standard": "^17.1.0",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.1.2",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^7.2.1",
|
||||
"eslint-plugin-react": "^7.12.2",
|
||||
"globals": "^16.5.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.2.7",
|
||||
"prettier-eslint-cli": "^8.0.1"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -172,6 +172,13 @@ let
|
|||
# outdated snapshot
|
||||
"tests/components/hypontech/test_sensor.py::test_sensors"
|
||||
];
|
||||
influxdb = [
|
||||
# These tests fail because they check for the number of warnings in the
|
||||
# logs and there is an extra warning in the logs:
|
||||
# `WARNING:aiohttp_fast_zlib:zlib_ng and isal are not available, falling back to zlib, performance will be degraded.`
|
||||
"tests/components/influxdb/test_sensor.py::test_state_for_no_results"
|
||||
"tests/components/influxdb/test_sensor.py::test_state_matches_first_query_result_for_multiple_return"
|
||||
];
|
||||
jellyfin = [
|
||||
# AssertionError: assert 'audio/x-flac' == 'audio/flac'
|
||||
"tests/components/jellyfin/test_media_source.py::test_resolve"
|
||||
|
|
|
|||
|
|
@ -712,6 +712,7 @@ mapAliases {
|
|||
firmwareLinuxNonfree = throw "'firmwareLinuxNonfree' has been renamed to/replaced by 'linux-firmware'"; # Converted to throw 2025-10-27
|
||||
fishfight = throw "'fishfight' has been renamed to/replaced by 'jumpy'"; # Converted to throw 2025-10-27
|
||||
fit-trackee = throw "'fit-trackee' has been renamed to/replaced by 'fittrackee'"; # Converted to throw 2025-10-27
|
||||
fixup_yarn_lock = throw "`fixup_yarn_lock` has been removed, please use `fixup-yarn-lock` instead."; # Added 2026-04-25
|
||||
flashrom-stable = throw "'flashrom-stable' has been renamed to/replaced by 'flashprog'"; # Converted to throw 2025-10-27
|
||||
flatbuffers_2_0 = throw "'flatbuffers_2_0' has been renamed to/replaced by 'flatbuffers'"; # Converted to throw 2025-10-27
|
||||
flattenReferencesGraph = warnAlias "'flattenReferencesGraph' has been renamed to 'flatten-references-graph'" flatten-references-graph; # Added 2026-02-08
|
||||
|
|
@ -1372,6 +1373,8 @@ mapAliases {
|
|||
minizincide = warnAlias "'minizincide' has been renamed to 'minizinc-ide'" minizinc-ide; # Added 2026-01-03
|
||||
minizip2 = throw "'minizip2' has been renamed to/replaced by 'minizip-ng'"; # Converted to throw 2025-10-27
|
||||
miru = throw "'miru' has been removed due to lack maintenance"; # Added 2025-08-21
|
||||
mkYarnModules = throw "'yarn2nix' and its tooling has been removed as it was unusable within nodePackages. Use the standard yarn v1 hooks available in nixpkgs instead."; # Added 2026-04-25
|
||||
mkYarnPackage = throw "'yarn2nix' and its tooling has been removed as it was unusable within nodePackages. Use the standard yarn v1 hooks available in nixpkgs instead."; # Added 2026-04-25
|
||||
mlir_16 = throw "mlir_16 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
|
||||
mlir_17 = throw "mlir_17 has been removed, as it is unmaintained and obsolete"; # Added 2025-08-09
|
||||
MMA = mma; # Added 2026-02-08
|
||||
|
|
@ -2497,6 +2500,8 @@ mapAliases {
|
|||
yaml-cpp_0_3 = throw "yaml-cpp_0_3 has been removed, as it was unused"; # Added 2025-09-16
|
||||
yamlpath = throw "'yamlpath' has been removed because it has been marked as broken since at least November 2024."; # Added 2025-10-01
|
||||
yarGen = warnAlias "'yarGen' has been renamed to 'yargen'" yargen; # Added 2026-02-12
|
||||
yarn2nix = throw "'yarn2nix' and its tooling has been removed as it was unusable within nodePackages. Use the standard yarn v1 hooks available in nixpkgs instead."; # Added 2026-04-25
|
||||
yarn2nix-moretea = throw "'yarn2nix' and its tooling has been removed as it was unusable within nodePackages. Use the standard yarn v1 hooks available in nixpkgs instead."; # Added 2026-04-25
|
||||
yeahwm = throw "'yeahwm' has been removed, as it was broken and unmaintained upstream."; # Added 2025-06-12
|
||||
yosys-synlig = throw "yosys-synlig has been removed because it is unmaintained upstream and incompatible with current Yosys versions."; # Added 2026-01-06
|
||||
youtube-music = lib.warnOnInstantiate "'youtube-music' has been renamed to 'pear-desktop'" pear-desktop; # Added 2025-12-23
|
||||
|
|
|
|||
|
|
@ -3569,15 +3569,6 @@ with pkgs;
|
|||
yarn-berry = yarn-berry_3;
|
||||
};
|
||||
|
||||
yarn2nix-moretea = callPackage ../development/tools/yarn2nix-moretea { };
|
||||
|
||||
inherit (yarn2nix-moretea)
|
||||
yarn2nix
|
||||
mkYarnPackage
|
||||
mkYarnModules
|
||||
fixup_yarn_lock
|
||||
;
|
||||
|
||||
yamllint = with python3Packages; toPythonApplication yamllint;
|
||||
|
||||
# To expose more packages for Yi, override the extraPackages arg.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue