diff --git a/.github/workflows/periodic-merge-24h.yml b/.github/workflows/periodic-merge-24h.yml
index e8ec13496025..44892f926eb7 100644
--- a/.github/workflows/periodic-merge-24h.yml
+++ b/.github/workflows/periodic-merge-24h.yml
@@ -34,6 +34,10 @@ jobs:
pairs:
- from: master
into: haskell-updates
+ - from: release-22.11
+ into: staging-next-22.11
+ - from: staging-next-22.11
+ into: staging-22.11
- from: release-22.05
into: staging-next-22.05
- from: staging-next-22.05
diff --git a/.version b/.version
index f07cdfac44f1..f8c860969712 100644
--- a/.version
+++ b/.version
@@ -1 +1 @@
-22.11
\ No newline at end of file
+23.05
diff --git a/doc/builders/fetchers.chapter.md b/doc/builders/fetchers.chapter.md
index 12d8a5d887fd..43aead0ad5e4 100644
--- a/doc/builders/fetchers.chapter.md
+++ b/doc/builders/fetchers.chapter.md
@@ -100,10 +100,10 @@ stdenv.mkDerivation {
name = "hello";
src = fetchgit {
url = "https://...";
- sparseCheckout = ''
- directory/to/be/included
- another/directory
- '';
+ sparseCheckout = [
+ "directory/to/be/included"
+ "another/directory"
+ ];
sha256 = "0000000000000000000000000000000000000000000000000000";
};
}
diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md
index 490daf991588..fa10747dacc4 100644
--- a/doc/languages-frameworks/javascript.section.md
+++ b/doc/languages-frameworks/javascript.section.md
@@ -196,7 +196,7 @@ buildNpmPackage rec {
* `makeCacheWritable`: Whether to make the cache writable prior to installing dependencies. Don't set this unless npm tries to write to the cache directory, as it can slow down the build.
* `npmBuildScript`: The script to run to build the project. Defaults to `"build"`.
* `npmFlags`: Flags to pass to all npm commands.
-* `npmInstallFlags`: Flags to pass to `npm ci`.
+* `npmInstallFlags`: Flags to pass to `npm ci` and `npm prune`.
* `npmBuildFlags`: Flags to pass to `npm run ${npmBuildScript}`.
* `npmPackFlags`: Flags to pass to `npm pack`.
diff --git a/lib/trivial.nix b/lib/trivial.nix
index 142ed32c9e5a..70bc53016456 100644
--- a/lib/trivial.nix
+++ b/lib/trivial.nix
@@ -195,7 +195,7 @@ rec {
On each release the first letter is bumped and a new animal is chosen
starting with that new letter.
*/
- codeName = "Raccoon";
+ codeName = "Stoat";
/* Returns the current nixpkgs version suffix as string. */
versionSuffix =
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index 0941b2516cd3..ee2014d6525b 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -14287,6 +14287,12 @@
githubId = 32751441;
name = "urlordjames";
};
+ ursi = {
+ email = "masondeanm@aol.com";
+ github = "ursi";
+ githubId = 17836748;
+ name = "Mason Mackaman";
+ };
uskudnik = {
email = "urban.skudnik@gmail.com";
github = "uskudnik";
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
index 8e97e58f81a6..3ab35fe84bbf 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
@@ -580,6 +580,15 @@
future Git update without notice.
+
+
+ The fetchgit fetcher supports sparse
+ checkouts via the sparseCheckout option.
+ This used to accept a multi-line string with
+ directories/patterns to check out, but now requires a list of
+ strings.
+
+
openssh was updated to version 9.1,
@@ -1392,6 +1401,26 @@ services.github-runner.serviceOverrides.SupplementaryGroups = [
if you intend to add packages to /bin.
+
+
+ The proxmox.qemuConf.bios option was added,
+ it corresponds to Hardware->BIOS field
+ in Proxmox web interface. Use
+ "ovmf" value to build UEFI image,
+ default value remains "bios". New
+ option proxmox.partitionTableType defaults
+ to either "legacy" or
+ "efi", depending on the
+ bios value. Setting
+ partitionTableType to
+ "hybrid" results in an image,
+ which supports both methods
+ ("bios" and
+ "ovmf"), thereby remaining
+ bootable after change to Proxmox
+ Hardware->BIOS field.
+
+
memtest86+ was updated from 5.00-coreboot-002 to 6.00-beta2.
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
new file mode 100644
index 000000000000..51dafd38c1ac
--- /dev/null
+++ b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
@@ -0,0 +1,51 @@
+
+ Release 23.05 (“Stoat”, 2023.05/??)
+
+ Support is planned until the end of December 2023, handing over to
+ 23.11.
+
+
+ Highlights
+
+ In addition to numerous new and upgraded packages, this release
+ has the following highlights:
+
+
+
+
+ Create the first release note entry in this section!
+
+
+
+
+
+ New Services
+
+
+
+ Create the first release note entry in this section!
+
+
+
+
+
+ Backward Incompatibilities
+
+
+
+ Create the first release note entry in this section!
+
+
+
+
+
+ Other Notable Changes
+
+
+
+ Create the first release note entry in this section!
+
+
+
+
+
diff --git a/nixos/doc/manual/release-notes/release-notes.xml b/nixos/doc/manual/release-notes/release-notes.xml
index ee5009faf6f4..bb5cc677afb8 100644
--- a/nixos/doc/manual/release-notes/release-notes.xml
+++ b/nixos/doc/manual/release-notes/release-notes.xml
@@ -8,6 +8,7 @@
This section lists the release notes for each stable version of NixOS and
current unstable revision.
+
diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md
index ecfba7215c8b..81aef68a716f 100644
--- a/nixos/doc/manual/release-notes/rl-2211.section.md
+++ b/nixos/doc/manual/release-notes/rl-2211.section.md
@@ -191,6 +191,8 @@ Available as [services.patroni](options.html#opt-services.patroni.enable).
- The `fetchgit` fetcher now uses [cone mode](https://www.git-scm.com/docs/git-sparse-checkout/2.37.0#_internalscone_mode_handling) by default for sparse checkouts. [Non-cone mode](https://www.git-scm.com/docs/git-sparse-checkout/2.37.0#_internalsnon_cone_problems) can be enabled by passing `nonConeMode = true`, but note that non-cone mode is deprecated and this option may be removed alongside a future Git update without notice.
+- The `fetchgit` fetcher supports sparse checkouts via the `sparseCheckout` option. This used to accept a multi-line string with directories/patterns to check out, but now requires a list of strings.
+
- `openssh` was updated to version 9.1, disabling the generation of DSA keys when using `ssh-keygen -A` as they are insecure. Also, `SetEnv` directives in `ssh_config` and `sshd_config` are now first-match-wins
- `bsp-layout` no longer uses the command `cycle` to switch to other window layouts, as it got replaced by the commands `previous` and `next`.
@@ -451,6 +453,8 @@ Available as [services.patroni](options.html#opt-services.patroni.enable).
- `dockerTools.buildImage` deprecates the misunderstood `contents` parameter, in favor of `copyToRoot`.
Use `copyToRoot = buildEnv { ... };` or similar if you intend to add packages to `/bin`.
+- The `proxmox.qemuConf.bios` option was added, it corresponds to `Hardware->BIOS` field in Proxmox web interface. Use `"ovmf"` value to build UEFI image, default value remains `"bios"`. New option `proxmox.partitionTableType` defaults to either `"legacy"` or `"efi"`, depending on the `bios` value. Setting `partitionTableType` to `"hybrid"` results in an image, which supports both methods (`"bios"` and `"ovmf"`), thereby remaining bootable after change to Proxmox `Hardware->BIOS` field.
+
- memtest86+ was updated from 5.00-coreboot-002 to 6.00-beta2. It is now the upstream version from https://www.memtest.org/, as coreboot's fork is no longer available.
- Option descriptions, examples, and defaults writting in DocBook are now deprecated. Using CommonMark is preferred and will become the default in a future release.
diff --git a/nixos/doc/manual/release-notes/rl-2305.section.md b/nixos/doc/manual/release-notes/rl-2305.section.md
new file mode 100644
index 000000000000..5bc6c8614895
--- /dev/null
+++ b/nixos/doc/manual/release-notes/rl-2305.section.md
@@ -0,0 +1,29 @@
+# Release 23.05 (“Stoat”, 2023.05/??) {#sec-release-23.05}
+
+Support is planned until the end of December 2023, handing over to 23.11.
+
+## Highlights {#sec-release-23.05-highlights}
+
+In addition to numerous new and upgraded packages, this release has the following highlights:
+
+
+
+- Create the first release note entry in this section!
+
+## New Services {#sec-release-23.05-new-services}
+
+
+
+- Create the first release note entry in this section!
+
+## Backward Incompatibilities {#sec-release-23.05-incompatibilities}
+
+
+
+- Create the first release note entry in this section!
+
+## Other Notable Changes {#sec-release-23.05-notable-changes}
+
+
+
+- Create the first release note entry in this section!
diff --git a/nixos/modules/services/databases/redis.nix b/nixos/modules/services/databases/redis.nix
index 1f143f9c66f6..95c0afb8f835 100644
--- a/nixos/modules/services/databases/redis.nix
+++ b/nixos/modules/services/databases/redis.nix
@@ -361,8 +361,10 @@ in {
fi
echo 'include "${redisConfStore}"' > "${redisConfRun}"
${optionalString (conf.requirePassFile != null) ''
- {echo -n "requirepass "
- cat ${escapeShellArg conf.requirePassFile}} >> "${redisConfRun}"
+ {
+ echo -n "requirepass "
+ cat ${escapeShellArg conf.requirePassFile}
+ } >> "${redisConfRun}"
''}
'');
Type = "notify";
diff --git a/nixos/modules/services/web-apps/outline.nix b/nixos/modules/services/web-apps/outline.nix
index 8a312d79584e..701930393f01 100644
--- a/nixos/modules/services/web-apps/outline.nix
+++ b/nixos/modules/services/web-apps/outline.nix
@@ -6,10 +6,10 @@ let
in
{
# See here for a reference of all the options:
- # https://github.com/outline/outline/blob/v0.65.2/.env.sample
- # https://github.com/outline/outline/blob/v0.65.2/app.json
- # https://github.com/outline/outline/blob/v0.65.2/server/env.ts
- # https://github.com/outline/outline/blob/v0.65.2/shared/types.ts
+ # https://github.com/outline/outline/blob/v0.67.0/.env.sample
+ # https://github.com/outline/outline/blob/v0.67.0/app.json
+ # https://github.com/outline/outline/blob/v0.67.0/server/env.ts
+ # https://github.com/outline/outline/blob/v0.67.0/shared/types.ts
# The order is kept the same here to make updating easier.
options.services.outline = {
enable = lib.mkEnableOption (lib.mdDoc "outline");
@@ -123,7 +123,7 @@ in
description = lib.mdDoc ''
To support uploading of images for avatars and document attachments an
s3-compatible storage must be provided. AWS S3 is recommended for
- redundency however if you want to keep all file storage local an
+ redundancy however if you want to keep all file storage local an
alternative such as [minio](https://github.com/minio/minio)
can be used.
@@ -435,6 +435,16 @@ in
'';
};
+ sentryTunnel = lib.mkOption {
+ type = lib.types.nullOr lib.types.str;
+ default = null;
+ description = lib.mdDoc ''
+ Optionally add a
+ [Sentry proxy tunnel](https://docs.sentry.io/platforms/javascript/troubleshooting/#using-the-tunnel-option)
+ for bypassing ad blockers in the UI.
+ '';
+ };
+
logo = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
@@ -621,6 +631,7 @@ in
DEBUG = cfg.debugOutput;
GOOGLE_ANALYTICS_ID = lib.optionalString (cfg.googleAnalyticsId != null) cfg.googleAnalyticsId;
SENTRY_DSN = lib.optionalString (cfg.sentryDsn != null) cfg.sentryDsn;
+ SENTRY_TUNNEL = lib.optionalString (cfg.sentryTunnel != null) cfg.sentryTunnel;
TEAM_LOGO = lib.optionalString (cfg.logo != null) cfg.logo;
DEFAULT_LANGUAGE = cfg.defaultLanguage;
diff --git a/nixos/modules/virtualisation/proxmox-image.nix b/nixos/modules/virtualisation/proxmox-image.nix
index 4fca8ce9e7eb..42c52c12edf0 100644
--- a/nixos/modules/virtualisation/proxmox-image.nix
+++ b/nixos/modules/virtualisation/proxmox-image.nix
@@ -53,6 +53,13 @@ with lib;
Guest memory in MB
'';
};
+ bios = mkOption {
+ type = types.enum [ "seabios" "ovmf" ];
+ default = "seabios";
+ description = ''
+ Select BIOS implementation (seabios = Legacy BIOS, ovmf = UEFI).
+ '';
+ };
# optional configs
name = mkOption {
@@ -99,6 +106,17 @@ with lib;
Additional options appended to qemu-server.conf
'';
};
+ partitionTableType = mkOption {
+ type = types.enum [ "efi" "hybrid" "legacy" "legacy+gpt" ];
+ description = ''
+ Partition table type to use. See make-disk-image.nix partitionTableType for details.
+ Defaults to 'legacy' for 'proxmox.qemuConf.bios="seabios"' (default), other bios values defaults to 'efi'.
+ Use 'hybrid' to build grub-based hybrid bios+efi images.
+ '';
+ default = if config.proxmox.qemuConf.bios == "seabios" then "legacy" else "efi";
+ defaultText = lib.literalExpression ''if config.proxmox.qemuConf.bios == "seabios" then "legacy" else "efi"'';
+ example = "hybrid";
+ };
filenameSuffix = mkOption {
type = types.str;
default = config.proxmox.qemuConf.name;
@@ -122,9 +140,33 @@ with lib;
${lib.concatStrings (lib.mapAttrsToList cfgLine properties)}
#qmdump#map:virtio0:drive-virtio0:local-lvm:raw:
'';
+ inherit (cfg) partitionTableType;
+ supportEfi = partitionTableType == "efi" || partitionTableType == "hybrid";
+ supportBios = partitionTableType == "legacy" || partitionTableType == "hybrid" || partitionTableType == "legacy+gpt";
+ hasBootPartition = partitionTableType == "efi" || partitionTableType == "hybrid";
+ hasNoFsPartition = partitionTableType == "hybrid" || partitionTableType == "legacy+gpt";
in {
+ assertions = [
+ {
+ assertion = config.boot.loader.systemd-boot.enable -> config.proxmox.qemuConf.bios == "ovmf";
+ message = "systemd-boot requires 'ovmf' bios";
+ }
+ {
+ assertion = partitionTableType == "efi" -> config.proxmox.qemuConf.bios == "ovmf";
+ message = "'efi' disk partitioning requires 'ovmf' bios";
+ }
+ {
+ assertion = partitionTableType == "legacy" -> config.proxmox.qemuConf.bios == "seabios";
+ message = "'legacy' disk partitioning requires 'seabios' bios";
+ }
+ {
+ assertion = partitionTableType == "legacy+gpt" -> config.proxmox.qemuConf.bios == "seabios";
+ message = "'legacy+gpt' disk partitioning requires 'seabios' bios";
+ }
+ ];
system.build.VMA = import ../../lib/make-disk-image.nix {
name = "proxmox-${cfg.filenameSuffix}";
+ inherit partitionTableType;
postVM = let
# Build qemu with PVE's patch that adds support for the VMA format
vma = (pkgs.qemu_kvm.override {
@@ -181,7 +223,18 @@ with lib;
boot = {
growPartition = true;
kernelParams = [ "console=ttyS0" ];
- loader.grub.device = lib.mkDefault "/dev/vda";
+ loader.grub = {
+ device = lib.mkDefault (if (hasNoFsPartition || supportBios) then
+ # Even if there is a separate no-fs partition ("/dev/disk/by-partlabel/no-fs" i.e. "/dev/vda2"),
+ # which will be used the bootloader, do not set it as loader.grub.device.
+ # GRUB installation fails, unless the whole disk is selected.
+ "/dev/vda"
+ else
+ "nodev");
+ efiSupport = lib.mkDefault supportEfi;
+ efiInstallAsRemovable = lib.mkDefault supportEfi;
+ };
+
loader.timeout = 0;
initrd.availableKernelModules = [ "uas" "virtio_blk" "virtio_pci" ];
};
@@ -191,6 +244,10 @@ with lib;
autoResize = true;
fsType = "ext4";
};
+ fileSystems."/boot" = lib.mkIf hasBootPartition {
+ device = "/dev/disk/by-label/ESP";
+ fsType = "vfat";
+ };
services.qemuGuest.enable = lib.mkDefault true;
};
diff --git a/pkgs/applications/audio/open-stage-control/default.nix b/pkgs/applications/audio/open-stage-control/default.nix
index 11b5f26ee035..015265774507 100644
--- a/pkgs/applications/audio/open-stage-control/default.nix
+++ b/pkgs/applications/audio/open-stage-control/default.nix
@@ -16,7 +16,7 @@ buildNpmPackage rec {
./package-lock.json.patch
];
- npmDepsHash = "sha256-UF3pZ+SlrgDLqntciXRNbWfpPMtQw1DXl41x9r37QN4=";
+ npmDepsHash = "sha256-SGLcFjPnmhFoeXtP4gfGr4Qa1dTaXwSnzkweEvYW/1k=";
nativeBuildInputs = [
copyDesktopItems
diff --git a/pkgs/applications/audio/whipper/default.nix b/pkgs/applications/audio/whipper/default.nix
index dfe540f04e65..e3c4b4522489 100644
--- a/pkgs/applications/audio/whipper/default.nix
+++ b/pkgs/applications/audio/whipper/default.nix
@@ -2,6 +2,7 @@
, python3
, fetchFromGitHub
, fetchpatch
+, installShellFiles
, libcdio-paranoia
, cdrdao
, libsndfile
@@ -35,6 +36,8 @@ in python3.pkgs.buildPythonApplication rec {
];
nativeBuildInputs = with python3.pkgs; [
+ installShellFiles
+
setuptools-scm
docutils
setuptoolsCheckHook
@@ -65,6 +68,11 @@ in python3.pkgs.buildPythonApplication rec {
export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
'';
+ outputs = [ "out" "man" ];
+ postBuild = ''
+ make -C man
+ '';
+
preCheck = ''
# disable tests that require internet access
# https://github.com/JoeLametta/whipper/issues/291
@@ -73,6 +81,10 @@ in python3.pkgs.buildPythonApplication rec {
export HOME=$TMPDIR
'';
+ postInstall = ''
+ installManPage man/*.1
+ '';
+
passthru.tests.version = testers.testVersion {
package = whipper;
command = "HOME=$TMPDIR whipper --version";
diff --git a/pkgs/applications/editors/vim/plugins/nvim-treesitter/overrides.nix b/pkgs/applications/editors/vim/plugins/nvim-treesitter/overrides.nix
index f4e0c99115f3..f1c72991a506 100644
--- a/pkgs/applications/editors/vim/plugins/nvim-treesitter/overrides.nix
+++ b/pkgs/applications/editors/vim/plugins/nvim-treesitter/overrides.nix
@@ -62,6 +62,10 @@ let
in
{
+ postPatch = ''
+ rm -r parser
+ '';
+
passthru = {
inherit builtGrammars allGrammars withPlugins withAllGrammars;
diff --git a/pkgs/applications/misc/bottles/default.nix b/pkgs/applications/misc/bottles/default.nix
index e5d846606a71..3ac928a3d36f 100644
--- a/pkgs/applications/misc/bottles/default.nix
+++ b/pkgs/applications/misc/bottles/default.nix
@@ -1,10 +1,28 @@
-{ lib, fetchFromGitHub, gitUpdater
-, meson, ninja, pkg-config, wrapGAppsHook
-, desktop-file-utils, gsettings-desktop-schemas, libnotify, libhandy, webkitgtk
-, python3Packages, gettext
-, appstream-glib, gdk-pixbuf, glib, gobject-introspection, gspell, gtk3, gtksourceview4, gnome
-, steam, xdg-utils, pciutils, cabextract
-, freetype, p7zip, gamemode, mangohud
+{ lib
+, fetchFromGitHub
+, fetchFromGitLab
+, gitUpdater
+, python3Packages
+, blueprint-compiler
+, meson
+, ninja
+, pkg-config
+, wrapGAppsHook4
+, appstream-glib
+, desktop-file-utils
+, librsvg
+, gtk4
+, gtksourceview5
+, libadwaita
+, steam
+, cabextract
+, p7zip
+, xdpyinfo
+, imagemagick
+, procps
+, gamescope
+, mangohud
+, vmtouch
, wine
, bottlesExtraLibraries ? pkgs: [ ] # extra packages to add to steam.run multiPkgs
, bottlesExtraPkgs ? pkgs: [ ] # extra packages to add to steam.run targetPkgs
@@ -21,75 +39,77 @@ let
in
python3Packages.buildPythonApplication rec {
pname = "bottles";
- version = "2022.5.28-trento-3";
+ version = "2022.10.14.1";
src = fetchFromGitHub {
owner = "bottlesdevs";
repo = pname;
rev = version;
- sha256 = "sha256-KIDLRqDLFTsVAczRpTchnUtKJfVHqbYzf8MhIR5UdYY=";
+ sha256 = "sha256-FO91GSGlc2f3TSLrlmRDPi5p933/Y16tdEpX4RcKhL0=";
};
+ patches = [ ./vulkan_icd.patch ];
+
postPatch = ''
chmod +x build-aux/meson/postinstall.py
patchShebangs build-aux/meson/postinstall.py
- substituteInPlace src/backend/wine/winecommand.py \
+ substituteInPlace bottles/backend/wine/winecommand.py \
--replace \
- 'self.__get_runner()' \
- '(lambda r: (f"${steam-run}/bin/steam-run {r}", r)[r == "wine" or r == "wine64"])(self.__get_runner())'
- '';
+ "command = f\"{runner} {command}\"" \
+ "command = f\"{''' if runner == 'wine' or runner == 'wine64' else '${steam-run}/bin/steam-run '}{runner} {command}\"" \
+ --replace \
+ "command = f\"{_picked['entry_point']} {command}\"" \
+ "command = f\"${steam-run}/bin/steam-run {_picked['entry_point']} {command}\""
+ '';
nativeBuildInputs = [
+ blueprint-compiler
meson
ninja
pkg-config
- wrapGAppsHook
- gettext
+ wrapGAppsHook4
+ gtk4 # gtk4-update-icon-cache
appstream-glib
desktop-file-utils
];
buildInputs = [
- gdk-pixbuf
- glib
- gobject-introspection
- gsettings-desktop-schemas
- gspell
- gtk3
- gtksourceview4
- libhandy
- libnotify
- webkitgtk
- gnome.adwaita-icon-theme
+ librsvg
+ gtk4
+ gtksourceview5
+ libadwaita
];
propagatedBuildInputs = with python3Packages; [
pyyaml
- pytoml
requests
- pycairo
pygobject3
- lxml
- dbus-python
- gst-python
- liblarch
patool
markdown
+ fvs
+ pefile
+ urllib3
+ chardet
+ certifi
+ idna
+ pillow
+ orjson
+ icoextract
] ++ [
- steam-run
- xdg-utils
- pciutils
cabextract
- wine
- freetype
p7zip
- gamemode # programs.gamemode.enable
+ xdpyinfo
+ imagemagick
+ procps
+
+ gamescope
mangohud
+ vmtouch
+ wine
];
format = "other";
- strictDeps = false; # broken with gobject-introspection setup hook, see https://github.com/NixOS/nixpkgs/issues/56943
dontWrapGApps = true; # prevent double wrapping
preFixup = ''
diff --git a/pkgs/applications/misc/bottles/vulkan_icd.patch b/pkgs/applications/misc/bottles/vulkan_icd.patch
new file mode 100644
index 000000000000..d638917151ea
--- /dev/null
+++ b/pkgs/applications/misc/bottles/vulkan_icd.patch
@@ -0,0 +1,13 @@
+diff --git a/bottles/backend/utils/vulkan.py b/bottles/backend/utils/vulkan.py
+index 6673493..07f70d1 100644
+--- a/bottles/backend/utils/vulkan.py
++++ b/bottles/backend/utils/vulkan.py
+@@ -29,6 +29,8 @@ class VulkanUtils:
+ "/etc/vulkan",
+ "/usr/local/share/vulkan",
+ "/usr/local/etc/vulkan"
++ "/run/opengl-driver/share/vulkan/",
++ "/run/opengl-driver-32/share/vulkan/",
+ ]
+ if "FLATPAK_ID" in os.environ:
+ __vk_icd_dirs += [
diff --git a/pkgs/applications/misc/keepmenu/default.nix b/pkgs/applications/misc/keepmenu/default.nix
new file mode 100644
index 000000000000..d169e19a19a5
--- /dev/null
+++ b/pkgs/applications/misc/keepmenu/default.nix
@@ -0,0 +1,36 @@
+{ lib, python3Packages, python3, xvfb-run }:
+
+python3Packages.buildPythonApplication rec {
+ pname = "keepmenu";
+ version = "1.2.2";
+
+ src = python3Packages.fetchPypi {
+ inherit pname version;
+ sha256 = "SeVNtONH1bn2hb2pBOVM3Oafrb+jARgfvRe7vUu6Gto=";
+ };
+
+ preConfigure = ''
+ export HOME=$TMPDIR
+ mkdir -p $HOME/.config/keepmenu
+ cp config.ini.example $HOME/.config/keepmenu/config.ini
+ '';
+
+ propagatedBuildInputs = with python3Packages; [
+ pykeepass
+ pynput
+ ];
+
+ checkInputs = [ xvfb-run ];
+ checkPhase = ''
+ xvfb-run python setup.py test
+ '';
+
+ pythonImportsCheck = [ "keepmenu" ];
+
+ meta = with lib; {
+ homepage = "https://github.com/firecat53/keepmenu";
+ description = "Dmenu/Rofi frontend for Keepass databases";
+ license = licenses.gpl3Only;
+ maintainers = with maintainers; [ elliot ];
+ };
+}
diff --git a/pkgs/applications/misc/nerd-font-patcher/default.nix b/pkgs/applications/misc/nerd-font-patcher/default.nix
index e865479f8da0..21c77316c1ab 100644
--- a/pkgs/applications/misc/nerd-font-patcher/default.nix
+++ b/pkgs/applications/misc/nerd-font-patcher/default.nix
@@ -9,10 +9,10 @@ python3Packages.buildPythonApplication rec {
owner = "ryanoasis";
repo = "nerd-fonts";
rev = "v${version}";
- sparseCheckout = ''
- font-patcher
- /src/glyphs
- '';
+ sparseCheckout = [
+ "font-patcher"
+ "/src/glyphs"
+ ];
sha256 = "sha256-boZUd1PM8puc9BTgOwCJpkfk6VMdXLsIyp+fQmW/ZqI=";
};
diff --git a/pkgs/applications/networking/gns3/default.nix b/pkgs/applications/networking/gns3/default.nix
index 44c9477c1c43..b17986daf588 100644
--- a/pkgs/applications/networking/gns3/default.nix
+++ b/pkgs/applications/networking/gns3/default.nix
@@ -3,7 +3,7 @@
}:
let
- stableVersion = "2.2.34";
+ stableVersion = "2.2.35.1";
previewVersion = stableVersion;
addVersion = args:
let version = if args.stable then stableVersion else previewVersion;
@@ -12,23 +12,18 @@ let
extraArgs = rec {
mkOverride = attrname: version: sha256:
self: super: {
- ${attrname} = super.${attrname}.overridePythonAttrs (oldAttrs: {
+ "${attrname}" = super."${attrname}".overridePythonAttrs (oldAttrs: {
inherit version;
src = oldAttrs.src.override {
inherit version sha256;
};
});
};
- commonOverrides = [
- (self: super: {
- jsonschema = super.jsonschema_3;
- })
- ];
};
mkGui = args: libsForQt5.callPackage (import ./gui.nix (addVersion args // extraArgs)) { };
mkServer = args: callPackage (import ./server.nix (addVersion args // extraArgs)) { };
- guiSrcHash = "sha256-1YsVMrUYI46lJZbPjf3jnOFDr9Hp54m8DVMz9y4dvVc=";
- serverSrcHash = "sha256-h4d9s+QvqN/EFV97rPRhQiyC06wkZ9C2af9gx1Z/x/8=";
+ guiSrcHash = "sha256-iVvADwIp01HeZoDayvH1dilYRHRkRBTBR3Fh395JBq0=";
+ serverSrcHash = "sha256-41dbiSjvmsDNYr9/rRkeQVOnPSVND34xx1SNknCgHfc=";
in {
guiStable = mkGui {
diff --git a/pkgs/applications/networking/gns3/gui.nix b/pkgs/applications/networking/gns3/gui.nix
index be08fe4f4c76..756cbd7c8b97 100644
--- a/pkgs/applications/networking/gns3/gui.nix
+++ b/pkgs/applications/networking/gns3/gui.nix
@@ -3,25 +3,15 @@
, version
, sha256Hash
, mkOverride
-, commonOverrides
}:
{ lib
, python3
, fetchFromGitHub
, wrapQtAppsHook
-, packageOverrides ? self: super: {}
}:
-let
- defaultOverrides = commonOverrides ++ [
- ];
-
- python = python3.override {
- packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) ([ packageOverrides ] ++ defaultOverrides);
- };
-
-in python.pkgs.buildPythonPackage rec {
+python3.pkgs.buildPythonPackage rec {
pname = "gns3-gui";
inherit version;
@@ -36,7 +26,7 @@ in python.pkgs.buildPythonPackage rec {
wrapQtAppsHook
];
- propagatedBuildInputs = with python.pkgs; [
+ propagatedBuildInputs = with python3.pkgs; [
distro
jsonschema
psutil
@@ -55,10 +45,8 @@ in python.pkgs.buildPythonPackage rec {
postPatch = ''
substituteInPlace requirements.txt \
- --replace "sentry-sdk==" "sentry-sdk>=" \
--replace "psutil==" "psutil>=" \
- --replace "distro==" "distro>=" \
- --replace "setuptools==" "setuptools>="
+ --replace "jsonschema>=4.17.0,<4.18" "jsonschema"
'';
meta = with lib; {
diff --git a/pkgs/applications/networking/gns3/server.nix b/pkgs/applications/networking/gns3/server.nix
index a07409810c01..5eee199d6915 100644
--- a/pkgs/applications/networking/gns3/server.nix
+++ b/pkgs/applications/networking/gns3/server.nix
@@ -3,24 +3,14 @@
, version
, sha256Hash
, mkOverride
-, commonOverrides
}:
{ lib
, python3
, fetchFromGitHub
-, packageOverrides ? self: super: {}
}:
-let
- defaultOverrides = commonOverrides ++ [
- ];
-
- python = python3.override {
- packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) ([ packageOverrides ] ++ defaultOverrides);
- };
-
-in python.pkgs.buildPythonApplication {
+python3.pkgs.buildPythonApplication {
pname = "gns3-server";
inherit version;
@@ -33,23 +23,17 @@ in python.pkgs.buildPythonApplication {
postPatch = ''
substituteInPlace requirements.txt \
- --replace "aiohttp==" "aiohttp>=" \
- --replace "aiofiles==" "aiofiles>=" \
- --replace "Jinja2==" "Jinja2>=" \
- --replace "sentry-sdk==" "sentry-sdk>=" \
- --replace "async-timeout==" "async-timeout>=" \
--replace "psutil==" "psutil>=" \
- --replace "distro==" "distro>=" \
- --replace "py-cpuinfo==" "py-cpuinfo>=" \
- --replace "setuptools==" "setuptools>="
+ --replace "jsonschema>=4.17.0,<4.18" "jsonschema"
'';
- propagatedBuildInputs = with python.pkgs; [
+ propagatedBuildInputs = with python3.pkgs; [
aiofiles
aiohttp
aiohttp-cors
async_generator
distro
+ importlib-resources
jinja2
jsonschema
multidict
diff --git a/pkgs/applications/video/jellyfin-mpv-shim/default.nix b/pkgs/applications/video/jellyfin-mpv-shim/default.nix
index da75adab7b51..69248dc75301 100644
--- a/pkgs/applications/video/jellyfin-mpv-shim/default.nix
+++ b/pkgs/applications/video/jellyfin-mpv-shim/default.nix
@@ -1,6 +1,7 @@
{ lib
, buildPythonApplication
, fetchPypi
+, gobject-introspection
, jellyfin-apiclient-python
, jinja2
, mpv
@@ -9,6 +10,7 @@
, python-mpv-jsonipc
, pywebview
, tkinter
+, wrapGAppsHook
}:
buildPythonApplication rec {
@@ -20,6 +22,11 @@ buildPythonApplication rec {
sha256 = "sha256-JiSC6WjrLsWk3/m/EHq7KNXaJ6rqT2fG9TT1jPvYlK0=";
};
+ nativeBuildInputs = [
+ wrapGAppsHook
+ gobject-introspection
+ ];
+
propagatedBuildInputs = [
jellyfin-apiclient-python
mpv
@@ -52,6 +59,12 @@ buildPythonApplication rec {
--replace "notify_updates: bool = True" "notify_updates: bool = False"
'';
+ # needed for pystray to access appindicator using GI
+ preFixup = ''
+ makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
+ '';
+ dontWrapGApps = true;
+
# no tests
doCheck = false;
pythonImportsCheck = [ "jellyfin_mpv_shim" ];
diff --git a/pkgs/applications/video/plex-mpv-shim/default.nix b/pkgs/applications/video/plex-mpv-shim/default.nix
index 2d0643c4ddb9..b7a5f2ce38c1 100644
--- a/pkgs/applications/video/plex-mpv-shim/default.nix
+++ b/pkgs/applications/video/plex-mpv-shim/default.nix
@@ -1,4 +1,5 @@
-{ lib, buildPythonApplication, fetchFromGitHub, mpv, requests, python-mpv-jsonipc, pystray, tkinter }:
+{ lib, buildPythonApplication, fetchFromGitHub, mpv, requests, python-mpv-jsonipc, pystray, tkinter
+, wrapGAppsHook, gobject-introspection }:
buildPythonApplication rec {
pname = "plex-mpv-shim";
@@ -11,8 +12,19 @@ buildPythonApplication rec {
sha256 = "0hgv9g17dkrh3zbsx27n80yvkgix9j2x0rgg6d3qsf7hp5j3xw4r";
};
+ nativeBuildInputs = [
+ wrapGAppsHook
+ gobject-introspection
+ ];
+
propagatedBuildInputs = [ mpv requests python-mpv-jsonipc pystray tkinter ];
+ # needed for pystray to access appindicator using GI
+ preFixup = ''
+ makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
+ '';
+ dontWrapGApps = true;
+
# does not contain tests
doCheck = false;
diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix
index a3145e504f23..6b07865928e6 100644
--- a/pkgs/build-support/docker/default.nix
+++ b/pkgs/build-support/docker/default.nix
@@ -547,10 +547,14 @@ rec {
pure = writeText "${baseName}-config.json" (builtins.toJSON {
inherit created config;
architecture = defaultArch;
+ preferLocalBuild = true;
os = "linux";
});
impure = runCommand "${baseName}-config.json"
- { nativeBuildInputs = [ jq ]; }
+ {
+ nativeBuildInputs = [ jq ];
+ preferLocalBuild = true;
+ }
''
jq ".created = \"$(TZ=utc date --iso-8601="seconds")\"" ${pure} > $out
'';
@@ -925,6 +929,7 @@ rec {
{
inherit fromImage maxLayers created;
imageName = lib.toLower name;
+ preferLocalBuild = true;
passthru.imageTag =
if tag != null
then tag
@@ -1015,6 +1020,7 @@ rec {
result = runCommand "stream-${baseName}"
{
inherit (conf) imageName;
+ preferLocalBuild = true;
passthru = passthru // {
inherit (conf) imageTag;
diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix
index f516c3d5a03b..1fec0c887474 100644
--- a/pkgs/build-support/fetchgit/default.nix
+++ b/pkgs/build-support/fetchgit/default.nix
@@ -15,7 +15,7 @@ in
{ url, rev ? "HEAD", md5 ? "", sha256 ? "", hash ? "", leaveDotGit ? deepClone
, fetchSubmodules ? true, deepClone ? false
, branchName ? null
-, sparseCheckout ? ""
+, sparseCheckout ? []
, nonConeMode ? false
, name ? urlToName url rev
, # Shell code executed after the file has been fetched
@@ -55,13 +55,16 @@ in
*/
assert deepClone -> leaveDotGit;
-assert nonConeMode -> (sparseCheckout != "");
+assert nonConeMode -> !(sparseCheckout == "" || sparseCheckout == []);
if md5 != "" then
throw "fetchgit does not support md5 anymore, please use sha256"
else if hash != "" && sha256 != "" then
throw "Only one of sha256 or hash can be set"
else
+# Added 2022-11-12
+lib.warnIf (builtins.isString sparseCheckout)
+ "Please provide directories/patterns for sparse checkout as a list of strings. Support for passing a (multi-line) string is deprecated and will be removed in the next release."
stdenvNoCC.mkDerivation {
inherit name;
builder = ./builder.sh;
@@ -79,7 +82,12 @@ stdenvNoCC.mkDerivation {
else
lib.fakeSha256;
- inherit url rev leaveDotGit fetchLFS fetchSubmodules deepClone branchName sparseCheckout nonConeMode postFetch;
+ # git-sparse-checkout(1) says:
+ # > When the --stdin option is provided, the directories or patterns are read
+ # > from standard in as a newline-delimited list instead of from the arguments.
+ sparseCheckout = if builtins.isString sparseCheckout then sparseCheckout else builtins.concatStringsSep "\n" sparseCheckout;
+
+ inherit url rev leaveDotGit fetchLFS fetchSubmodules deepClone branchName nonConeMode postFetch;
postHook = if netrcPhase == null then null else ''
${netrcPhase}
diff --git a/pkgs/build-support/fetchgit/tests.nix b/pkgs/build-support/fetchgit/tests.nix
index 62fe3f77bbdd..a18be65327b5 100644
--- a/pkgs/build-support/fetchgit/tests.nix
+++ b/pkgs/build-support/fetchgit/tests.nix
@@ -12,10 +12,10 @@
name = "nix-source";
url = "https://github.com/NixOS/nix";
rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a";
- sparseCheckout = ''
- src
- tests
- '';
+ sparseCheckout = [
+ "src"
+ "tests"
+ ];
sha256 = "sha256-g1PHGTWgAcd/+sXHo1o6AjVWCvC6HiocOfMbMh873LQ=";
};
@@ -23,10 +23,10 @@
name = "nix-source";
url = "https://github.com/NixOS/nix";
rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a";
- sparseCheckout = ''
- src
- tests
- '';
+ sparseCheckout = [
+ "src"
+ "tests"
+ ];
nonConeMode = true;
sha256 = "sha256-FknO6C/PSnMPfhUqObD4vsW4PhkwdmPa9blNzcNvJQ4=";
};
diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix
index cfb6a6ca7cd8..fcde7447cbd3 100644
--- a/pkgs/build-support/fetchgithub/default.nix
+++ b/pkgs/build-support/fetchgithub/default.nix
@@ -3,7 +3,7 @@
{ owner, repo, rev, name ? "source"
, fetchSubmodules ? false, leaveDotGit ? null
, deepClone ? false, private ? false, forceFetchGit ? false
-, sparseCheckout ? ""
+, sparseCheckout ? []
, githubBase ? "github.com", varPrefix ? null
, meta ? { }
, ... # For hash agility
@@ -24,7 +24,7 @@ let
};
passthruAttrs = removeAttrs args [ "owner" "repo" "rev" "fetchSubmodules" "forceFetchGit" "private" "githubBase" "varPrefix" ];
varBase = "NIX${if varPrefix == null then "" else "_${varPrefix}"}_GITHUB_PRIVATE_";
- useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone || forceFetchGit || (sparseCheckout != "");
+ useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone || forceFetchGit || !(sparseCheckout == "" || sparseCheckout == []);
# We prefer fetchzip in cases we don't need submodules as the hash
# is more stable in that case.
fetcher = if useFetchGit then fetchgit else fetchzip;
diff --git a/pkgs/build-support/node/build-npm-package/default.nix b/pkgs/build-support/node/build-npm-package/default.nix
index 1038bb2abcb4..5ab86996e56b 100644
--- a/pkgs/build-support/node/build-npm-package/default.nix
+++ b/pkgs/build-support/node/build-npm-package/default.nix
@@ -17,7 +17,7 @@
, npmBuildScript ? "build"
# Flags to pass to all npm commands.
, npmFlags ? [ ]
- # Flags to pass to `npm ci`.
+ # Flags to pass to `npm ci` and `npm prune`.
, npmInstallFlags ? [ ]
# Flags to pass to `npm rebuild`.
, npmRebuildFlags ? [ ]
diff --git a/pkgs/build-support/node/build-npm-package/hooks/default.nix b/pkgs/build-support/node/build-npm-package/hooks/default.nix
index 4ac981af916c..ff0930426d4e 100644
--- a/pkgs/build-support/node/build-npm-package/hooks/default.nix
+++ b/pkgs/build-support/node/build-npm-package/hooks/default.nix
@@ -7,10 +7,11 @@
substitutions = {
nodeSrc = srcOnly nodejs;
- # Specify the stdenv's `diff` and `jq` by abspath to ensure that the user's build
+ # Specify `diff`, `jq`, and `prefetch-npm-deps` by abspath to ensure that the user's build
# inputs do not cause us to find the wrong binaries.
diff = "${buildPackages.diffutils}/bin/diff";
jq = "${buildPackages.jq}/bin/jq";
+ prefetchNpmDeps = "${buildPackages.prefetch-npm-deps}/bin/prefetch-npm-deps";
nodeVersion = nodejs.version;
nodeVersionMajor = lib.versions.major nodejs.version;
diff --git a/pkgs/build-support/node/build-npm-package/hooks/npm-build-hook.sh b/pkgs/build-support/node/build-npm-package/hooks/npm-build-hook.sh
index b99c9d94faff..7f601512c7e7 100644
--- a/pkgs/build-support/node/build-npm-package/hooks/npm-build-hook.sh
+++ b/pkgs/build-support/node/build-npm-package/hooks/npm-build-hook.sh
@@ -20,6 +20,7 @@ npmBuildHook() {
echo
echo "Here are a few things you can try, depending on the error:"
echo "1. Make sure your build script ($npmBuildScript) exists"
+ echo " If there is none, set `dontNpmBuild = true`."
echo '2. If the error being thrown is something similar to "error:0308010C:digital envelope routines::unsupported", add `NODE_OPTIONS = "--openssl-legacy-provider"` to your derivation'
echo " See https://github.com/webpack/webpack/issues/14532 for more information."
echo
diff --git a/pkgs/build-support/node/build-npm-package/hooks/npm-config-hook.sh b/pkgs/build-support/node/build-npm-package/hooks/npm-config-hook.sh
index 723d8c1a4643..6fa6a0f940b1 100644
--- a/pkgs/build-support/node/build-npm-package/hooks/npm-config-hook.sh
+++ b/pkgs/build-support/node/build-npm-package/hooks/npm-config-hook.sh
@@ -5,9 +5,18 @@ npmConfigHook() {
echo "Configuring npm"
- export HOME=$TMPDIR
+ export HOME="$TMPDIR"
export npm_config_nodedir="@nodeSrc@"
+ if [ -z "${npmDeps-}" ]; then
+ echo
+ echo "ERROR: no dependencies were specified"
+ echo 'Hint: set `npmDeps` if using these hooks individually. If this is happening with `buildNpmPackage`, please open an issue.'
+ echo
+
+ exit 1
+ fi
+
local -r cacheLockfile="$npmDeps/package-lock.json"
local -r srcLockfile="$PWD/package-lock.json"
@@ -47,15 +56,17 @@ npmConfigHook() {
exit 1
fi
+ @prefetchNpmDeps@ --fixup-lockfile "$srcLockfile"
+
local cachePath
if [ -z "${makeCacheWritable-}" ]; then
- cachePath=$npmDeps
+ cachePath="$npmDeps"
else
echo "Making cache writable"
cp -r "$npmDeps" "$TMPDIR/cache"
chmod -R 700 "$TMPDIR/cache"
- cachePath=$TMPDIR/cache
+ cachePath="$TMPDIR/cache"
fi
npm config set cache "$cachePath"
@@ -71,7 +82,7 @@ npmConfigHook() {
echo "Here are a few things you can try, depending on the error:"
echo '1. Set `makeCacheWritable = true`'
echo " Note that this won't help if npm is complaining about not being able to write to the logs directory -- look above that for the actual error."
- echo '2. Set `npmInstallFlags = [ "--legacy-peer-deps" ]`'
+ echo '2. Set `npmFlags = [ "--legacy-peer-deps" ]`'
echo
exit 1
@@ -96,6 +107,8 @@ npmConfigHook() {
rm node_modules/.meow
fi
+ patchShebangs node_modules
+
echo "Finished npmConfigHook"
}
diff --git a/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh b/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
index 4a222de26bbf..c3983e289568 100644
--- a/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
+++ b/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
@@ -27,7 +27,7 @@ npmInstallHook() {
local -r nodeModulesPath="$packageOut/node_modules"
if [ ! -d "$nodeModulesPath" ]; then
- npm prune --omit dev
+ npm prune --omit dev $npmInstallFlags "${npmInstallFlagsArray[@]}" $npmFlags "${npmFlagsArray[@]}"
find node_modules -maxdepth 1 -type d -empty -delete
cp -r node_modules "$nodeModulesPath"
diff --git a/pkgs/build-support/node/fetch-npm-deps/default.nix b/pkgs/build-support/node/fetch-npm-deps/default.nix
index d6ee0124d285..7d5ea7cbfbe8 100644
--- a/pkgs/build-support/node/fetch-npm-deps/default.nix
+++ b/pkgs/build-support/node/fetch-npm-deps/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenvNoCC, rustPlatform, Security, testers, fetchurl, prefetch-npm-deps, fetchNpmDeps }:
+{ lib, stdenvNoCC, rustPlatform, makeWrapper, Security, gnutar, gzip, testers, fetchurl, prefetch-npm-deps, fetchNpmDeps }:
{
prefetch-npm-deps = rustPlatform.buildRustPackage {
@@ -16,8 +16,13 @@
cargoLock.lockFile = ./Cargo.lock;
+ nativeBuildInputs = [ makeWrapper ];
buildInputs = lib.optional stdenvNoCC.isDarwin Security;
+ postInstall = ''
+ wrapProgram "$out/bin/prefetch-npm-deps" --prefix PATH : ${lib.makeBinPath [ gnutar gzip ]}
+ '';
+
passthru.tests =
let
makeTestSrc = { name, src }: stdenvNoCC.mkDerivation {
@@ -46,7 +51,7 @@
hash = "sha256-uQmc+S+V1co1Rfc4d82PpeXjmd1UqdsG492ADQFcZGA=";
};
- hash = "sha256-fk7L9vn8EHJsGJNMAjYZg9h0PT6dAwiahdiEeXVrMB8=";
+ hash = "sha256-wca1QvxUw3OrLStfYN9Co6oVBR1LbfcNUKlDqvObps4=";
};
lockfileV2 = makeTest {
@@ -57,7 +62,7 @@
hash = "sha256-qS29tq5QPnGxV+PU40VgMAtdwVLtLyyhG2z9GMeYtC4=";
};
- hash = "sha256-s8SpZY/1tKZVd3vt7sA9vsqHvEaNORQBMrSyhWpj048=";
+ hash = "sha256-tuEfyePwlOy2/mOPdXbqJskO6IowvAP4DWg8xSZwbJw=";
};
hashPrecedence = makeTest {
@@ -68,7 +73,7 @@
hash = "sha256-1+0AQw9EmbHiMPA/H8OP8XenhrkhLRYBRhmd1cNPFjk=";
};
- hash = "sha256-KRxwrEij3bpZ5hbQhX67KYpnY2cRS7u2EVZIWO1FBPM=";
+ hash = "sha256-oItUls7AXcCECuyA+crQO6B0kv4toIr8pBubNwB7kAM=";
};
hostedGitDeps = makeTest {
@@ -79,7 +84,30 @@
hash = "sha256-X9mCwPqV5yP0S2GonNvpYnLSLJMd/SUIked+hMRxDpA=";
};
- hash = "sha256-oIM05TGHstX1D4k2K4TJ+SHB7H/tNKzxzssqf0GJwvY=";
+ hash = "sha256-5Mg7KDJLMM5e/7BCHGinGAnBRft2ySQzvKW06p3u/0o=";
+ };
+
+ linkDependencies = makeTest {
+ name = "link-dependencies";
+
+ src = fetchurl {
+ url = "https://raw.githubusercontent.com/evcc-io/evcc/0.106.3/package-lock.json";
+ hash = "sha256-6ZTBMyuyPP/63gpQugggHhKVup6OB4hZ2rmSvPJ0yEs=";
+ };
+
+ hash = "sha256-VzQhArHoznYSXUT7l9HkJV4yoSOmoP8eYTLel1QwmB4=";
+ };
+
+ # This package contains both hosted Git shorthand, and a bundled dependency that happens to override an existing one.
+ etherpadLite1818 = makeTest {
+ name = "etherpad-lite-1.8.18";
+
+ src = fetchurl {
+ url = "https://raw.githubusercontent.com/ether/etherpad-lite/1.8.18/src/package-lock.json";
+ hash = "sha256-1fGNxYJi1I4cXK/jinNG+Y6tPEOhP3QAqWOBEQttS9E=";
+ };
+
+ hash = "sha256-8xF8F74nHwL9KPN2QLsxnfvsk0rNCKOZniYJQCD5u/I=";
};
};
diff --git a/pkgs/build-support/node/fetch-npm-deps/src/cacache.rs b/pkgs/build-support/node/fetch-npm-deps/src/cacache.rs
index 865a320954b5..715e115e7235 100644
--- a/pkgs/build-support/node/fetch-npm-deps/src/cacache.rs
+++ b/pkgs/build-support/node/fetch-npm-deps/src/cacache.rs
@@ -109,7 +109,7 @@ impl Cache {
let mut file = File::options().append(true).create(true).open(index_path)?;
- write!(file, "\n{:x}\t{data}", Sha1::new().chain(&data).finalize())?;
+ write!(file, "{:x}\t{data}", Sha1::new().chain(&data).finalize())?;
Ok(())
}
diff --git a/pkgs/build-support/node/fetch-npm-deps/src/main.rs b/pkgs/build-support/node/fetch-npm-deps/src/main.rs
index 097148fef82a..cf9651d42d64 100644
--- a/pkgs/build-support/node/fetch-npm-deps/src/main.rs
+++ b/pkgs/build-support/node/fetch-npm-deps/src/main.rs
@@ -1,19 +1,22 @@
#![warn(clippy::pedantic)]
use crate::cacache::Cache;
-use anyhow::anyhow;
+use anyhow::{anyhow, Context};
use rayon::prelude::*;
use serde::Deserialize;
+use serde_json::{Map, Value};
use std::{
- collections::HashMap,
- env, fs,
+ collections::{HashMap, HashSet},
+ env, fmt, fs, io,
path::Path,
- process::{self, Command},
+ process::{self, Command, Stdio},
};
use tempfile::tempdir;
use url::Url;
mod cacache;
+#[cfg(test)]
+mod tests;
#[derive(Deserialize)]
struct PackageLock {
@@ -25,38 +28,93 @@ struct PackageLock {
#[derive(Deserialize)]
struct OldPackage {
- version: String,
- resolved: Option,
+ version: UrlOrString,
+ #[serde(default)]
+ bundled: bool,
+ resolved: Option,
integrity: Option,
dependencies: Option>,
}
-#[derive(Deserialize)]
+#[derive(Debug, Deserialize, PartialEq, Eq)]
struct Package {
- resolved: Option,
+ resolved: Option,
integrity: Option,
}
+#[derive(Debug, Deserialize, PartialEq, Eq)]
+#[serde(untagged)]
+enum UrlOrString {
+ Url(Url),
+ String(String),
+}
+
+impl fmt::Display for UrlOrString {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ match self {
+ UrlOrString::Url(url) => url.fmt(f),
+ UrlOrString::String(string) => string.fmt(f),
+ }
+ }
+}
+
+#[allow(clippy::case_sensitive_file_extension_comparisons)]
fn to_new_packages(
old_packages: HashMap,
+ initial_url: &Url,
) -> anyhow::Result> {
let mut new = HashMap::new();
- for (name, package) in old_packages {
+ for (name, mut package) in old_packages {
+ // In some cases, a bundled dependency happens to have the same version as a non-bundled one, causing
+ // the bundled one without a URL to override the entry for the non-bundled instance, which prevents the
+ // dependency from being downloaded.
+ if package.bundled {
+ continue;
+ }
+
+ if let UrlOrString::Url(v) = &package.version {
+ for (scheme, host) in [
+ ("github", "github.com"),
+ ("bitbucket", "bitbucket.org"),
+ ("gitlab", "gitlab.com"),
+ ] {
+ if v.scheme() == scheme {
+ package.version = {
+ let mut new_url = initial_url.clone();
+
+ new_url.set_host(Some(host))?;
+
+ if v.path().ends_with(".git") {
+ new_url.set_path(v.path());
+ } else {
+ new_url.set_path(&format!("{}.git", v.path()));
+ }
+
+ new_url.set_fragment(v.fragment());
+
+ UrlOrString::Url(new_url)
+ };
+
+ break;
+ }
+ }
+ }
+
new.insert(
format!("{name}-{}", package.version),
Package {
- resolved: if let Ok(url) = Url::parse(&package.version) {
- Some(url)
+ resolved: if matches!(package.version, UrlOrString::Url(_)) {
+ Some(package.version)
} else {
- package.resolved.as_deref().map(Url::parse).transpose()?
+ package.resolved
},
integrity: package.integrity,
},
);
if let Some(dependencies) = package.dependencies {
- new.extend(to_new_packages(dependencies)?);
+ new.extend(to_new_packages(dependencies, initial_url)?);
}
}
@@ -184,6 +242,59 @@ fn get_ideal_hash(integrity: &str) -> anyhow::Result<&str> {
}
}
+fn get_initial_url() -> anyhow::Result {
+ Url::parse("git+ssh://git@a.b").context("initial url should be valid")
+}
+
+/// `fixup_lockfile` removes the `integrity` field from Git dependencies.
+///
+/// Git dependencies from specific providers can be retrieved from those providers' automatic tarball features.
+/// When these dependencies are specified with a commit identifier, npm generates a tarball, and inserts the integrity hash of that
+/// tarball into the lockfile.
+///
+/// Thus, we remove this hash, to replace it with our own determinstic copies of dependencies from hosted Git providers.
+fn fixup_lockfile(mut lock: Map) -> anyhow::Result