Merge master into staging-next

This commit is contained in:
github-actions[bot] 2022-04-01 18:01:22 +00:00 committed by GitHub
commit 27e49cc5a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 4663 additions and 2478 deletions

View file

@ -32,6 +32,20 @@ type of this option should represent the format. The most common formats
have a predefined type and string generator already declared under
`pkgs.formats`:
`pkgs.formats.javaProperties` { *`comment`* ? `"Generated with Nix"` }
: A function taking an attribute set with values
`comment`
: A string to put at the start of the
file in a comment. It can have multiple
lines.
It returns the `type`: `attrsOf str` and a function
`generate` to build a Java `.properties` file, taking
care of the correct escaping, etc.
`pkgs.formats.json` { }
: A function taking an empty attribute set (for future extensibility)

View file

@ -53,6 +53,38 @@
<literal>pkgs.formats</literal>:
</para>
<variablelist>
<varlistentry>
<term>
<literal>pkgs.formats.javaProperties</literal> {
<emphasis><literal>comment</literal></emphasis> ?
<literal>&quot;Generated with Nix&quot;</literal> }
</term>
<listitem>
<para>
A function taking an attribute set with values
</para>
<variablelist>
<varlistentry>
<term>
<literal>comment</literal>
</term>
<listitem>
<para>
A string to put at the start of the file in a comment.
It can have multiple lines.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
It returns the <literal>type</literal>:
<literal>attrsOf str</literal> and a function
<literal>generate</literal> to build a Java
<literal>.properties</literal> file, taking care of the
correct escaping, etc.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>pkgs.formats.json</literal> { }

View file

@ -977,6 +977,7 @@
./services/security/shibboleth-sp.nix
./services/security/sks.nix
./services/security/sshguard.nix
./services/security/sslmate-agent.nix
./services/security/step-ca.nix
./services/security/tor.nix
./services/security/torify.nix

View file

@ -302,6 +302,7 @@ in
environment.systemPackages = with pkgs.pantheon; [
contractor
file-roller-contract
gnome-bluetooth-contract
];
environment.pathsToLink = [

View file

@ -13,10 +13,10 @@ let
archive_fmt = if system == "x86_64-darwin" then "zip" else "tar.gz";
sha256 = {
x86_64-linux = "1sh2f7hwhilwmlgy11kl0s2n3phpcir15wyl2fkyhsr2kdj4jz9r";
x86_64-darwin = "1s04d91f08982wi8hb4dw0j57d6zqrdgns16ihrgsvahrzksgq4b";
aarch64-linux = "1a97lk1qz2lz0lk5lpja32zy07iwdbskp6baf429iz7fz232rshm";
armv7l-linux = "0vjqxqcr7fq3ncx1nl6ny7qcqm4vlsn33c074hhcg5292blg2a0p";
x86_64-linux = "0dv28i8mxf45n7xj4gzgh4gsx76875nxs4yfqswxij8kzz72vqfn";
x86_64-darwin = "0xs4f1ffqcbvzw1v64f9l8i7rflz7h1j5xgjxdz6l0hw0j4aalb2";
aarch64-linux = "1fa7g531apigp8k7fxkp2ijmhz5axx7ixzdhlwgbsb80rb2mqhi0";
armv7l-linux = "1ry9qm6rk46s0jn7hl30jbjdhi3fshzcs0x9krd9qin7by18hhz3";
}.${system};
sourceRoot = {
@ -31,7 +31,7 @@ in
# Please backport all compatible updates to the stable release.
# This is important for the extension ecosystem.
version = "1.65.2";
version = "1.66.0";
pname = "vscodium";
executableName = "codium";

View file

@ -0,0 +1,8 @@
{ lib
, newScope
}:
lib.makeScope newScope (self: {
libwg = self.callPackage ./libwg.nix { };
mullvad = self.callPackage ./mullvad.nix { };
openvpn-mullvad = self.callPackage ./openvpn.nix { };
})

View file

@ -0,0 +1,35 @@
{ lib
, buildGoModule
, fetchFromGitHub
, mullvad
}:
buildGoModule {
pname = "libwg";
inherit (mullvad)
version
src
;
sourceRoot = "source/wireguard/libwg";
vendorSha256 = "qvymWCdJ+GY90W/Fpdp+r1+mTq6O4LyN2Yw/PjKdFm0=";
# XXX: hack to make the ar archive go to the correct place
# This is necessary because passing `-o ...` to `ldflags` does not work
# (this doesn't get communicated everywhere in the chain, apparently, so
# `go` complains that it can't find an `a.out` file).
GOBIN = "${placeholder "out"}/lib";
ldflags = [ "-s" "-w" "-buildmode=c-archive" ];
postInstall = ''
mv $out/lib/libwg{,.a}
'';
meta = with lib; {
description = "A tiny wrapper around wireguard-go";
homepage = "https://github.com/mullvad/mullvadvpn-app/tree/master/wireguard/libwg";
license = licenses.gpl3Only;
maintainers = with maintainers; [ cole-h ];
};
}

View file

@ -0,0 +1,107 @@
{ lib
, stdenv
, writeText
, rustPlatform
, fetchFromGitHub
, pkg-config
, protobuf
, makeWrapper
, dbus
, libnftnl
, libmnl
, libwg
, openvpn-mullvad
, shadowsocks-rust
}:
let
# result of running address_cache as of 02 Mar 2022
bootstrap-address-cache = writeText "api-ip-address.txt" ''
193.138.218.78:443
193.138.218.71:444
185.65.134.66:444
185.65.135.117:444
217.138.254.130:444
91.90.44.10:444
'';
in
rustPlatform.buildRustPackage rec {
pname = "mullvad";
version = "2022.1";
src = fetchFromGitHub {
owner = "mullvad";
repo = "mullvadvpn-app";
rev = version;
hash = "sha256-bLwuM3Qy2iStbXIvDEWp31vuiihSQThOej297XKo5Xc=";
};
cargoHash = "sha256-CBbm8cJHTjyvvzCFQfKmsE5d9N7azEm8nI6KeWLVaa8=";
nativeBuildInputs = [
pkg-config
protobuf
makeWrapper
];
buildInputs = [
dbus.dev
libnftnl
libmnl
];
# talpid-core wants libwg.a in build/lib/{triple}
preBuild = ''
dest=build/lib/${stdenv.targetPlatform.config}
mkdir -p $dest
ln -s ${libwg}/lib/libwg.a $dest
'';
postFixup =
# Place all binaries in the 'mullvad-' namespace, even though these
# specific binaries aren't used in the lifetime of the program.
# `address_cache` is used to generate the `api-ip-address.txt` file, which
# contains list of Mullvad API servers -- though we provide a "backup" of
# the output of this command, it could change at any time, so we want
# users to be able to regenerate the list at any time. (The daemon will
# refuse to start without this file.)
''
for bin in address_cache relay_list translations-converter; do
mv "$out/bin/$bin" "$out/bin/mullvad-$bin"
done
'' +
# Put distributed assets in-place -- specifically, the
# bootstrap-address-cache is necessary; otherwise, the user will have to run
# the `address_cache` binary and move the contents into place at
# `/var/cache/mullvad-vpn/api-ip-address.txt` manually.
''
mkdir -p $out/share/mullvad
ln -s ${bootstrap-address-cache} $out/share/mullvad/api-ip-address.txt
'' +
# Files necessary for OpenVPN tunnels to work.
''
cp dist-assets/ca.crt $out/share/mullvad
ln -s ${openvpn-mullvad}/bin/openvpn $out/share/mullvad
ln -s ${shadowsocks-rust}/bin/sslocal $out/share/mullvad
ln -s $out/lib/libtalpid_openvpn_plugin.so $out/share/mullvad
'' +
# Set the directory where Mullvad will look for its resources by default to
# `$out/share`, so that we can avoid putting the files in `$out/bin` --
# Mullvad defaults to looking inside the directory its binary is located in
# for its resources.
''
wrapProgram $out/bin/mullvad-daemon \
--set-default MULLVAD_RESOURCE_DIR "$out/share/mullvad"
'';
passthru = {
inherit libwg;
inherit openvpn-mullvad;
};
meta = with lib; {
description = "Mullvad VPN command-line client tools";
homepage = "https://github.com/mullvad/mullvadvpn-app";
license = licenses.gpl3Only;
maintainers = with maintainers; [ cole-h ];
};
}

View file

@ -0,0 +1,87 @@
{ lib
, openvpn
, fetchpatch
, fetchurl
, iproute2
, autoconf
, automake
}:
openvpn.overrideAttrs (oldAttrs:
let
fetchMullvadPatch = { commit, sha256 }: fetchpatch {
url = "https://github.com/mullvad/openvpn/commit/${commit}.patch";
inherit sha256;
};
in
rec {
pname = "openvpn-mullvad";
version = "2.5.3";
src = fetchurl {
url = "https://swupdate.openvpn.net/community/releases/openvpn-${version}.tar.gz";
sha256 = "sha256-dfAETfRJQwVVynuZWit3qyTylG/cNmgwG47cI5hqX34=";
};
buildInputs = oldAttrs.buildInputs or [ ] ++ [
iproute2
];
configureFlags = oldAttrs.configureFlags or [ ] ++ [
"--enable-iproute2"
"IPROUTE=${iproute2}/sbin/ip"
];
nativeBuildInputs = oldAttrs.nativeBuildInputs or [ ] ++ [
autoconf
automake
];
patches = oldAttrs.patches or [ ] ++ [
# look at compare to find the relevant commits
# https://github.com/OpenVPN/openvpn/compare/release/2.5...mullvad:mullvad-patches
# used openvpn version is the latest tag ending with -mullvad
# https://github.com/mullvad/openvpn/tags
(fetchMullvadPatch {
# "Reduce PUSH_REQUEST_INTERVAL to one second"
commit = "41e44158fc71bb6cc8cc6edb6ada3307765a12e8";
sha256 = "sha256-UoH0V6gTPdEuybFkWxdaB4zomt7rZeEUyXs9hVPbLb4=";
})
(fetchMullvadPatch {
# "Allow auth plugins to set a failure reason"
commit = "f51781c601e8c72ae107deaf25bf66f7c193e9cd";
sha256 = "sha256-+kwG0YElL16T0e+avHlI8gNQdAxneRS6fylv7QXvC1s=";
})
(fetchMullvadPatch {
# "Send an event to any plugins when authentication fails"
commit = "c2f810f966f2ffd68564d940b5b8946ea6007d5a";
sha256 = "sha256-PsKIxYwpLD66YaIpntXJM8OGcObyWBSAJsQ60ojvj30=";
})
(fetchMullvadPatch {
# "Shutdown when STDIN is closed"
commit = "879d6a3c0288b5443bbe1b94261655c329fc2e0e";
sha256 = "sha256-pRFY4r+b91/xAKXx6u5GLzouQySXuO5gH0kMGm77a3c=";
})
(fetchMullvadPatch {
# "Update TAP hardware ID"
commit = "7f71b37a3b25bec0b33a0e29780c222aef869e9d";
sha256 = "sha256-RF/GvD/ZvhLdt34wDdUT/yxa+IVWx0eY6WRdNWXxXeQ=";
})
(fetchMullvadPatch {
# "Undo dependency on Python docutils"
commit = "abd3c6214529d9f4143cc92dd874d8743abea17c";
sha256 = "sha256-SC2RlpWHUDMAEKap1t60dC4hmalk3vok6xY+/xhC2U0=";
})
(fetchMullvadPatch {
# "Prevent signal when stdin is closed from being cleared (#10)"
commit = "b45b090c81e7b4f2dc938642af7a1e12f699f5c5";
sha256 = "sha256-KPTFmbuJhMI+AvaRuu30CPPLQAXiE/VApxlUCqbZFls=";
})
];
meta = oldAttrs.meta or { } // {
description = "OpenVPN with Mullvad-specific patches applied";
homepage = "https://github.com/mullvad/openvpn";
maintainers = with lib; [ maintainers.cole-h ];
};
})

View file

@ -1,5 +1,5 @@
{ lib
, stdenv
{ stdenv
, lib
, fetchurl
, fetchpatch
, gnome
@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "1a9ynlwwkb3wpg293ym517vmrkk63y809mmcv9a21k5yr199x53c";
sha256 = "bJSeUsi+zCBU2qzWBJAfZs5c9wml+pHEu3ysyTm1Pqk=";
};
patches = [
@ -82,7 +82,8 @@ stdenv.mkDerivation rec {
passthru = {
updateScript = gnome.updateScript {
packageName = pname;
attrPath = "gnome.${pname}";
attrPath = "gnome.gnome-bluetooth_1_0";
freeze = true;
};
};

View file

@ -48,6 +48,8 @@ lib.makeScope pkgs.newScope (self: with self; {
gnome-bluetooth = callPackage ./core/gnome-bluetooth { };
gnome-bluetooth_1_0 = callPackage ./core/gnome-bluetooth/1.0 { };
gnome-color-manager = callPackage ./core/gnome-color-manager { };
gnome-contacts = callPackage ./core/gnome-contacts { };

View file

@ -1,9 +1,10 @@
{ lib, stdenv
{ stdenv
, lib
, autoreconfHook
, fetchurl
, gettext
, glib
, gnome-bluetooth
, gnome-bluetooth_1_0
, gnome-desktop
, gnome-panel
, gnome-session
@ -94,7 +95,7 @@ let
buildInputs = [
glib
gnome-bluetooth
gnome-bluetooth_1_0
gnome-desktop
gsettings-desktop-schemas
gtk3

View file

@ -1,9 +1,12 @@
{ lib, stdenv
{ stdenv
, lib
, fetchurl
, fetchpatch
, autoreconfHook
, dconf
, evolution-data-server
, gdm
, geocode-glib
, gettext
, glib
, gnome-desktop
@ -37,6 +40,13 @@ stdenv.mkDerivation rec {
# instead of gnome-panels libdir so that the NixOS module can make gnome-panel
# load modules from other packages as well.
./modulesdir-env-var.patch
# Add missing geocode-glib-1.0 dependency
# https://gitlab.gnome.org/GNOME/gnome-panel/-/merge_requests/49
(fetchpatch {
url = "https://gitlab.gnome.org/GNOME/gnome-panel/-/commit/f58a43ec4649a25f1a762b36e1401b81cd2b214b.patch";
sha256 = "sha256-DFqaNUjkLh4xd81qgQpl+568eUZeWyF8LxdZoTgMfCQ=";
})
];
# make .desktop Exec absolute
@ -69,6 +79,7 @@ stdenv.mkDerivation rec {
dconf
evolution-data-server
gdm
geocode-glib
glib
gnome-desktop
gnome-menus

View file

@ -68,6 +68,14 @@ stdenv.mkDerivation rec {
pango
];
postInstall = ''
# elementary/dock/master is missing a Meson post
# install script that does this. This has been
# resolved after the dock rewrite (the `main` branch).
# https://github.com/elementary/default-settings/issues/267
glib-compile-schemas $out/share/glib-2.0/schemas
'';
meta = with lib; {
description = "Elegant, simple, clean dock";
homepage = "https://github.com/elementary/dock";

View file

@ -108,7 +108,7 @@ lib.makeScope pkgs.newScope (self: with self; {
gala = callPackage ./desktop/gala { };
gnome-bluetooth-contract = callPackage ./desktop/gnome-bluetooth-contract {
inherit (gnome) gnome-bluetooth;
inherit (gnome) gnome-bluetooth_1_0;
};
wingpanel = callPackage ./desktop/wingpanel { };

View file

@ -3,7 +3,7 @@
, fetchFromGitHub
, unstableGitUpdater
, substituteAll
, gnome-bluetooth
, gnome-bluetooth_1_0
}:
stdenv.mkDerivation rec {
@ -20,7 +20,9 @@ stdenv.mkDerivation rec {
patches = [
(substituteAll {
src = ./exec-path.patch;
gnome_bluetooth = gnome-bluetooth;
# sendto device selection is removed in gnome-bluetooth 42
# https://github.com/elementary/gnome-bluetooth-contract/issues/1
gnome_bluetooth = gnome-bluetooth_1_0;
})
];
@ -49,8 +51,5 @@ stdenv.mkDerivation rec {
license = licenses.gpl3Plus;
maintainers = teams.pantheon.members;
platforms = platforms.linux;
# sendto device selection is removed in gnome-bluetooth 42
# https://github.com/elementary/gnome-bluetooth-contract/issues/1
broken = true;
};
}

View file

@ -7,7 +7,7 @@
buildPythonPackage rec {
pname = "aioairzone";
version = "0.2.1";
version = "0.3.1";
format = "setuptools";
disabled = pythonOlder "3.8";
@ -16,7 +16,7 @@ buildPythonPackage rec {
owner = "Noltari";
repo = pname;
rev = version;
hash = "sha256-R5OK/B7fq15lpt8nKECiHMmfK9xmiLPtoKC65C7H/7c=";
hash = "sha256-iu0pX12GmP5u6G8uY+6FODj732dD6JPxkrpWXw41/6Q=";
};
propagatedBuildInputs = [

View file

@ -21,7 +21,7 @@
buildPythonPackage rec {
pname = "ansible-later";
version = "2.0.8";
version = "2.0.9";
format = "pyproject";
disabled = pythonOlder "3.8";
@ -30,7 +30,7 @@ buildPythonPackage rec {
owner = "thegeeklab";
repo = pname;
rev = "v${version}";
hash = "sha256-oPlm9uxyN3hyf4gFv37YWEn/HOkg0QQ1Ya3tjLd53rQ=";
hash = "sha256-g7/RClQB+6HsDbe/VjjKka97LcwRTKO0OD0RlCG9lWY=";
};
nativeBuildInputs = [

View file

@ -8,7 +8,7 @@
buildPythonPackage rec {
pname = "fastcore";
version = "1.4.0";
version = "1.4.1";
format = "setuptools";
disabled = pythonOlder "3.8";
@ -17,7 +17,7 @@ buildPythonPackage rec {
owner = "fastai";
repo = pname;
rev = version;
sha256 = "sha256-U7tZkqfBbl5IVZlC2/JBIx7Bm5iIiXTMSm0QHmzNiys=";
sha256 = "sha256-qZsCsMwZxJsnznQ/C1SUPexkquv0tIyCkNYL5f2k0FU=";
};
propagatedBuildInputs = [

View file

@ -15,7 +15,7 @@
buildPythonPackage rec {
pname = "glean-parser";
version = "5.1.0";
version = "5.1.1";
format = "setuptools";
disabled = pythonOlder "3.6";
@ -23,7 +23,7 @@ buildPythonPackage rec {
src = fetchPypi {
pname = "glean_parser";
inherit version;
hash = "sha256-8oMbaGsW5Lkw9OluNsXXe2IBNbjeoIb9vDjVOt+uHR0=";
hash = "sha256-zUiF0buHBe0BaaeIRJcRoT/g+NhWv6XTuhCZ6WPrris=";
};
nativeBuildInputs = [

View file

@ -14,7 +14,7 @@
buildPythonPackage rec {
pname = "hahomematic";
version = "1.0.3";
version = "1.0.4";
format = "setuptools";
disabled = pythonOlder "3.9";
@ -23,7 +23,7 @@ buildPythonPackage rec {
owner = "danielperna84";
repo = pname;
rev = version;
sha256 = "sha256-WteSLhO/Ei+467tXT7Y1S6bYNNFUILbP5Pm4ZhBYaeg=";
sha256 = "sha256-YpsZKhuK3IzUZFNmBToBOuUacaDgbMC/N7pZDjuSzbE=";
};
propagatedBuildInputs = [

View file

@ -7,7 +7,7 @@
buildPythonPackage rec {
pname = "meilisearch";
version = "0.18.1";
version = "0.18.2";
format = "setuptools";
disabled = pythonOlder "3.7";
@ -16,7 +16,7 @@ buildPythonPackage rec {
owner = "meilisearch";
repo = "meilisearch-python";
rev = "v${version}";
hash = "sha256-Rd2GmomNzW0+oI2QEGcPY4g8H+4FN7eLKY1ljcibsLw=";
hash = "sha256-U9fdMcxPdtLiUStgTez99SPRh93WLZNVn8uIj4lNWh4=";
};
propagatedBuildInputs = [

View file

@ -16,7 +16,7 @@
buildPythonPackage rec {
pname = "mypy-boto3-builder";
version = "7.5.4";
version = "7.5.5";
format = "pyproject";
disabled = pythonOlder "3.10";
@ -25,7 +25,7 @@ buildPythonPackage rec {
owner = "vemel";
repo = "mypy_boto3_builder";
rev = version;
hash = "sha256-NS8lFetL/8hcvCnIHw+GDtdEKFsN81MPybEA4PGaP/Q=";
hash = "sha256-rv0c0QoXOd7aSOLhGDGfq4v0bnGBOJhGhZVNhS5hgOs=";
};
nativeBuildInputs = [

View file

@ -13,7 +13,7 @@
buildPythonPackage rec {
pname = "pontos";
version = "22.2.4";
version = "22.4.0";
format = "pyproject";
disabled = pythonOlder "3.7";
@ -22,7 +22,7 @@ buildPythonPackage rec {
owner = "greenbone";
repo = pname;
rev = "v${version}";
hash = "sha256-RmMlwnAJlCTDnTyim0MdAeW3NA8r2IiqrE0YeWgxUk4=";
hash = "sha256-W+l5QIpum1uTsx/mxZGkRoJAZaC1viURVYg4Kvjv32Y=";
};
nativeBuildInputs = [

View file

@ -7,7 +7,7 @@
buildPythonPackage rec {
pname = "pynetgear";
version = "0.9.1";
version = "0.9.2";
format = "setuptools";
disabled = pythonOlder "3.7";
@ -16,7 +16,7 @@ buildPythonPackage rec {
owner = "MatMaul";
repo = pname;
rev = version;
sha256 = "sha256-sLGr8I0LcLPrmQZ6dI+hwRAiNCrnLtr2WU04rPoG4x4=";
sha256 = "sha256-/aPyx+jNOCW6bzeYAEBP1yfIJfQwJjo1i6WaRvAz0oU=";
};
propagatedBuildInputs = [

View file

@ -14,13 +14,13 @@
buildGoModule rec {
pname = "buildah";
version = "1.24.2";
version = "1.25.1";
src = fetchFromGitHub {
owner = "containers";
repo = "buildah";
rev = "v${version}";
sha256 = "sha256-gBO+H26YGmOtP3CUHZjynAaOb0h+MJbJnWqxOZdif6w=";
sha256 = "sha256-NQ+Tv3KUrvX+MWM1ZFmsJ4JKoSIpSBjGNiruJkRd6rE=";
};
outputs = [ "out" "man" ];

View file

@ -29,7 +29,7 @@ let
maintainers = with maintainers; [ travisbhartwell manveru prusnak ];
platforms = [ "x86_64-darwin" "x86_64-linux" "i686-linux" "armv7l-linux" "aarch64-linux" ]
++ optionals (versionAtLeast version "11.0.0") [ "aarch64-darwin" ];
knownVulnerabilities = optional (versionOlder version "14.0.0") "Electron version ${version} is EOL";
knownVulnerabilities = optional (versionOlder version "15.0.0") "Electron version ${version} is EOL";
};
fetcher = vers: tag: hash: fetchurl {

View file

@ -2,18 +2,18 @@
buildGraalvmNativeImage rec {
pname = "clojure-lsp";
version = "2022.03.26-18.47.08";
version = "2022.03.31-20.00.20";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = version;
sha256 = "sha256-tlI4h9/DTc3JwqCM58YC5x4FDpuPm7Qeik3PJe64nVA=";
sha256 = "sha256-UQA/BXf6hTTxZ504e1faPdS8mKYS8WrY5L/zgaGCxpU=";
};
jar = fetchurl {
url = "https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/clojure-lsp-standalone.jar";
sha256 = "4973f5cf45f0b8120206d057d88d6a7fca03e071c8ad1ecd7229db46a0604ed2";
sha256 = "e66689326c39ae74f0e8d9f5a8229c7ebebe010849870a47faf88e81cbaa37e0";
};
extraNativeImageBuildArgs = [

View file

@ -5,17 +5,10 @@
}:
let
# Poetry2nix version
version = "1.26.0";
version = "1.27.1";
inherit (poetryLib) isCompatible readTOML moduleName;
/* The default list of poetry2nix override overlays */
mkEvalPep508 = import ./pep508.nix {
inherit lib poetryLib;
stdenv = pkgs.stdenv;
};
getFunctorFn = fn: if builtins.typeOf fn == "set" then fn.__functor else fn;
# Map SPDX identifiers to license names
spdxLicenses = lib.listToAttrs (lib.filter (pair: pair.name != null) (builtins.map (v: { name = if lib.hasAttr "spdxId" v then v.spdxId else null; value = v; }) (lib.attrValues lib.licenses)));
# Get license by id falling back to input string
@ -121,10 +114,16 @@ lib.makeScope pkgs.newScope (self: {
, preferWheels ? false
# Example: { my-app = ./src; }
, editablePackageSources ? { }
, __isBootstrap ? false # Hack: Always add Poetry as a build input unless bootstrapping
, pyProject ? readTOML pyproject
}@attrs:
let
/* The default list of poetry2nix override overlays */
mkEvalPep508 = import ./pep508.nix {
inherit lib poetryLib;
inherit (python) stdenv;
};
getFunctorFn = fn: if builtins.typeOf fn == "set" then fn.__functor else fn;
poetryPkg = poetry.override { inherit python; };
scripts = pyProject.tool.poetry.scripts or { };
@ -180,7 +179,6 @@ lib.makeScope pkgs.newScope (self: {
value = self.mkPoetryDep (
pkgMeta // {
inherit pwd preferWheels;
inherit __isBootstrap;
source = pkgMeta.source or null;
files = lockFiles.${name};
pythonPackages = self;
@ -207,12 +205,12 @@ lib.makeScope pkgs.newScope (self: {
in
{
mkPoetryDep = self.callPackage ./mk-poetry-dep.nix {
inherit pkgs lib python poetryLib evalPep508;
inherit lib python poetryLib evalPep508;
};
# Use poetry-core from the poetry build (pep517/518 build-system)
poetry-core = if __isBootstrap then null else poetryPkg.passthru.python.pkgs.poetry-core;
poetry = if __isBootstrap then null else poetryPkg;
# # Use poetry-core from the poetry build (pep517/518 build-system)
poetry-core = poetryPkg.passthru.python.pkgs.poetry-core;
poetry = poetryPkg;
__toPluginAble = toPluginAble self;
@ -222,10 +220,21 @@ lib.makeScope pkgs.newScope (self: {
setuptools-scm = super.setuptools_scm;
}
)
# Fix infinite recursion in a lot of packages because of checkInputs
(self: super: lib.mapAttrs
(name: value: (
if lib.isDerivation value && lib.hasAttr "overridePythonAttrs" value
then value.overridePythonAttrs (_: { doCheck = false; })
else value
))
super)
# Null out any filtered packages, we don't want python.pkgs from nixpkgs
(self: super: builtins.listToAttrs (builtins.map (x: { name = moduleName x.name; value = null; }) incompatible))
# Create poetry2nix layer
baseOverlay
] ++ # User provided overrides
(if builtins.typeOf overrides == "list" then overrides else [ overrides ])
);
@ -318,12 +327,11 @@ lib.makeScope pkgs.newScope (self: {
, python ? pkgs.python3
, pwd ? projectDir
, preferWheels ? false
, __isBootstrap ? false # Hack: Always add Poetry as a build input unless bootstrapping
, ...
}@attrs:
let
poetryPython = self.mkPoetryPackages {
inherit pyproject poetrylock overrides python pwd preferWheels __isBootstrap;
inherit pyproject poetrylock overrides python pwd preferWheels;
};
py = poetryPython.python;
@ -429,7 +437,7 @@ lib.makeScope pkgs.newScope (self: {
Can be overriden by calling defaultPoetryOverrides.overrideOverlay which takes an overlay function
*/
defaultPoetryOverrides = self.mkDefaultPoetryOverrides (import ./overrides.nix { inherit pkgs lib; });
defaultPoetryOverrides = self.mkDefaultPoetryOverrides (import ./overrides { inherit pkgs lib; });
/*
Convenience functions for specifying overlays with or without the poerty2nix default overrides

View file

@ -67,6 +67,13 @@ in
{
name = "fixup-hook.sh";
deps = [ ];
substitutions = {
inherit pythonSitePackages;
filenames = builtins.concatStringsSep " " [
"pyproject.toml"
"README.md"
];
};
} ./fixup-hook.sh
)
{ };

View file

@ -1,8 +1,20 @@
poetry2nix-fixup-hook() {
# Including tests in the output is a common mistake
if [ -z "${dontFixupTests-}" ]; then
rm -rf $out/lib/python3.7/site-packages/tests
rm -rf $out/@pythonSitePackages@/tests
fi
# Including files in site-packages is a common packaging mistake
#
# While we cannot remove all normal files dumped in site-packages
# we can clean up some common mistakes
if [ -z "${dontFixupSitePackages-}" ]; then
for f in @filenames@; do
rm -f $out/@pythonSitePackages@/$f
done
fi
}
postFixupHooks+=(poetry2nix-fixup-hook)

View file

@ -5,14 +5,6 @@ pipBuildPhase() {
echo "Executing pipBuildPhase"
runHook preBuild
# Prefer using setup.py to avoid build-system dependencies if we have a setup.py
if [ -z "${dontPreferSetupPy-}" ]; then
if test -e setup.py && test -e pyproject.toml; then
echo "Removing pyproject.toml..."
rm -f pyproject.toml
fi
fi
mkdir -p dist
echo "Creating a wheel..."
@pythonInterpreter@ -m pip wheel --verbose --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist .

View file

@ -79,6 +79,7 @@ let
if lib.strings.hasInfix "manylinux1" f then { pkg = [ ml.manylinux1 ]; str = "1"; }
else if lib.strings.hasInfix "manylinux2010" f then { pkg = [ ml.manylinux2010 ]; str = "2010"; }
else if lib.strings.hasInfix "manylinux2014" f then { pkg = [ ml.manylinux2014 ]; str = "2014"; }
else if lib.strings.hasInfix "manylinux_" f then { pkg = [ ml.manylinux2014 ]; str = "pep600"; }
else { pkg = [ ]; str = null; };
# Predict URL from the PyPI index.
@ -110,8 +111,8 @@ let
(pkgs.stdenvNoCC.mkDerivation {
name = file;
nativeBuildInputs = [
pkgs.curl
pkgs.jq
pkgs.buildPackages.curl
pkgs.buildPackages.jq
];
isWheel = lib.strings.hasSuffix "whl" file;
system = "builtin";
@ -219,7 +220,8 @@ let
};
# Machine tag for our target platform (if available)
targetMachine = manyLinuxTargetMachines.${stdenv.targetPlatform.parsed.cpu.name} or null;
getTargetMachine = stdenv: manyLinuxTargetMachines.${stdenv.targetPlatform.parsed.cpu.name} or null;
in
{
inherit
@ -233,6 +235,6 @@ in
cleanPythonSources
moduleName
getPythonVersion
targetMachine
getTargetMachine
;
}

View file

@ -1,5 +1,4 @@
{ autoPatchelfHook
, pkgs
, lib
, python
, buildPythonPackage
@ -17,7 +16,6 @@
, sourceSpec
, supportedExtensions ? lib.importJSON ./extensions.json
, preferWheels ? false
, __isBootstrap ? false # Hack: Always add Poetry as a build input unless bootstrapping
, ...
}:
@ -27,12 +25,11 @@ pythonPackages.callPackage
, ...
}@args:
let
inherit (pkgs) stdenv;
inherit (python) stdenv;
inherit (poetryLib) isCompatible getManyLinuxDeps fetchFromLegacy fetchFromPypi moduleName;
inherit (import ./pep425.nix {
inherit lib poetryLib python;
inherit (pkgs) stdenv;
inherit lib poetryLib python stdenv;
}) selectWheel
;
fileCandidates =
@ -97,6 +94,7 @@ pythonPackages.callPackage
"setuptools-scm"
"toml" # Toml is an extra for setuptools-scm
"tomli" # tomli is an extra for later versions of setuptools-scm
"flit-core"
"packaging"
"six"
"pyparsing"
@ -129,7 +127,6 @@ pythonPackages.callPackage
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) pythonPackages.setuptools
++ lib.optional (!isSource) (getManyLinuxDeps fileInfo.name).pkg
++ lib.optional isDirectory buildSystemPkgs
++ lib.optional (!__isBootstrap) pythonPackages.poetry
);
propagatedBuildInputs =
@ -169,11 +166,18 @@ pythonPackages.callPackage
src =
if isGit then
(
builtins.fetchGit {
builtins.fetchGit ({
inherit (source) url;
rev = source.resolved_reference or source.reference;
ref = sourceSpec.branch or sourceSpec.rev or (if sourceSpec?tag then "refs/tags/${sourceSpec.tag}" else "HEAD");
}
ref = sourceSpec.branch or (if sourceSpec ? tag then "refs/tags/${sourceSpec.tag}" else "HEAD");
} // (
let
nixVersion = builtins.substring 0 3 builtins.nixVersion;
in
lib.optionalAttrs ((sourceSpec ? rev) && (lib.versionAtLeast nixVersion "2.4")) {
allRefs = true;
}
))
)
else if isUrl then
builtins.fetchTarball

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
{ lib, stdenv, poetryLib, python, isLinux ? stdenv.isLinux }:
let
inherit (lib.strings) hasSuffix hasInfix splitString removeSuffix;
inherit (poetryLib) targetMachine;
inherit (lib.strings) escapeRegex hasPrefix hasSuffix hasInfix splitString removePrefix removeSuffix;
targetMachine = poetryLib.getTargetMachine stdenv;
# The 'cpxy" as determined by `python.version`
#
@ -52,10 +52,10 @@ let
# x = "cpXX" | "py2" | "py3" | "py2.py3"
isPyVersionCompatible = pyver: x:
let
normalize = y: ''cp${lib.strings.removePrefix "cp" (lib.strings.removePrefix "py" y)}'';
isCompat = p: x: lib.strings.hasPrefix (normalize x) p;
normalize = y: ''cp${removePrefix "cp" (removePrefix "py" y)}'';
isCompat = p: x: hasPrefix (normalize x) p;
in
lib.lists.any (isCompat pyver) (lib.strings.splitString "." x);
lib.lists.any (isCompat pyver) (splitString "." x);
#
# Selects the best matching wheel file from a list of files
@ -63,7 +63,7 @@ let
selectWheel = files:
let
filesWithoutSources = (builtins.filter (x: hasSuffix ".whl" x.file) files);
isPyAbiCompatible = pyabi: x: x == "none" || lib.hasPrefix pyabi x || lib.hasPrefix x pyabi || (
isPyAbiCompatible = pyabi: x: x == "none" || hasPrefix pyabi x || hasPrefix x pyabi || (
# The CPython stable ABI is abi3 as in the shared library suffix.
python.passthru.implementation == "cpython" &&
builtins.elemAt (lib.splitString "." python.version) 0 == "3" &&
@ -75,32 +75,30 @@ let
then
if targetMachine != null
then
(
x: x.platform == "any" || lib.lists.any (e: hasInfix e x.platform) [
"manylinux1_${targetMachine}"
"manylinux2010_${targetMachine}"
"manylinux2014_${targetMachine}"
]
# See PEP 600 for details.
(p:
builtins.match "any|manylinux(1|2010|2014)_${escapeRegex targetMachine}|manylinux_[0-9]+_[0-9]+_${escapeRegex targetMachine}" p != null
)
else
(x: x.platform == "any")
(p: p == "any")
else
if stdenv.isDarwin
then
if stdenv.targetPlatform.isAarch64
then (x: x.platform == "any" || (hasInfix "macosx" x.platform && lib.lists.any (e: hasSuffix e x.platform) [ "arm64" "aarch64" ]))
else (x: x.platform == "any" || (hasInfix "macosx" x.platform && hasSuffix "x86_64" x.platform))
else (x: x.platform == "any");
then (p: p == "any" || (hasInfix "macosx" p && lib.lists.any (e: hasSuffix e p) [ "arm64" "aarch64" ]))
else (p: p == "any" || (hasInfix "macosx" p && hasSuffix "x86_64" p))
else (p: p == "any");
withPlatforms = x: lib.lists.any withPlatform (splitString "." x.platform);
filterWheel = x:
let
f = toWheelAttrs x.file;
in
(withPython pythonTag abiTag f) && (withPlatform f);
(withPython pythonTag abiTag f) && (withPlatforms f);
filtered = builtins.filter filterWheel filesWithoutSources;
choose = files:
let
osxMatches = [ "12_0" "11_0" "10_12" "10_11" "10_10" "10_9" "10_8" "10_7" "any" ];
linuxMatches = [ "manylinux1_" "manylinux2010_" "manylinux2014_" "any" ];
linuxMatches = [ "manylinux1_" "manylinux2010_" "manylinux2014_" "manylinux_" "any" ];
chooseLinux = x: lib.take 1 (findBestMatches linuxMatches x);
chooseOSX = x: lib.take 1 (findBestMatches osxMatches x);
in

View file

@ -1,6 +1,8 @@
{ lib, stdenv, poetryLib }: python:
let
inherit (poetryLib) ireplace targetMachine;
inherit (poetryLib) ireplace;
targetMachine = poetryLib.getTargetMachine stdenv;
# Like builtins.substring but with stop being offset instead of length
substr = start: stop: s: builtins.substring start (stop - start) s;

View file

@ -14,9 +14,6 @@ poetry2nix.mkPoetryApplication {
inherit projectDir pyproject poetrylock;
# Don't include poetry in inputs
__isBootstrap = true;
src = fetchFromGitHub (lib.importJSON ./src.json);
# "Vendor" dependencies (for build-system support)

View file

@ -8,32 +8,17 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
[[package]]
name = "attrs"
version = "21.2.0"
version = "21.4.0"
description = "Classes Without Boilerplate"
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
[package.extras]
dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit"]
dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"]
docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"]
tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"]
tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"]
[[package]]
name = "backports.entry-points-selectable"
version = "1.1.1"
description = "Compatibility shim providing selectable entry points for older implementations"
category = "main"
optional = false
python-versions = ">=2.7"
[package.dependencies]
importlib-metadata = {version = "*", markers = "python_version < \"3.8\""}
[package.extras]
docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"]
testing = ["pytest", "pytest-flake8", "pytest-cov", "pytest-black (>=0.3.7)", "pytest-mypy", "pytest-checkdocs (>=2.4)", "pytest-enabler (>=1.0.1)"]
tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "cloudpickle"]
tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "cloudpickle"]
[[package]]
name = "backports.functools-lru-cache"
@ -245,7 +230,7 @@ test = ["pytest (>=3.6.0,!=3.9.0,!=3.9.1,!=3.9.2)", "pretend", "iso8601", "pytz"
[[package]]
name = "cryptography"
version = "36.0.1"
version = "36.0.2"
description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers."
category = "main"
optional = false
@ -364,7 +349,7 @@ six = "*"
[[package]]
name = "identify"
version = "2.4.0"
version = "2.4.4"
description = "File identification library for Python"
category = "dev"
optional = false
@ -417,6 +402,14 @@ zipp = {version = ">=0.4", markers = "python_version < \"3.8\""}
[package.extras]
docs = ["sphinx", "rst.linker", "jaraco.packaging"]
[[package]]
name = "iniconfig"
version = "1.1.1"
description = "iniconfig: brain-dead simple config-ini parsing"
category = "dev"
optional = false
python-versions = "*"
[[package]]
name = "ipaddress"
version = "1.0.23"
@ -484,7 +477,7 @@ testing = ["pytest (>=3.5,!=3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake
[[package]]
name = "keyring"
version = "21.8.0"
version = "22.3.0"
description = "Store and access your passwords safely."
category = "main"
optional = false
@ -498,7 +491,7 @@ SecretStorage = {version = ">=3.2", markers = "sys_platform == \"linux\""}
[package.extras]
docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"]
testing = ["pytest (>=3.5,!=3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "jaraco.test (>=3.2.0)", "pytest-black (>=0.3.7)", "pytest-mypy"]
testing = ["pytest (>=4.6)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "pytest-enabler", "pytest-black (>=0.3.7)", "pytest-mypy"]
[[package]]
name = "lockfile"
@ -589,7 +582,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
[[package]]
name = "pathlib2"
version = "2.3.6"
version = "2.3.7.post1"
description = "Object-oriented filesystem paths"
category = "main"
optional = false
@ -598,6 +591,7 @@ python-versions = "*"
[package.dependencies]
scandir = {version = "*", markers = "python_version < \"3.5\""}
six = "*"
typing = {version = "*", markers = "python_version < \"3.5\""}
[[package]]
name = "pexpect"
@ -645,7 +639,7 @@ dev = ["pre-commit", "tox"]
[[package]]
name = "poetry-core"
version = "1.0.7"
version = "1.0.8"
description = "Poetry PEP 517 Build Backend"
category = "main"
optional = false
@ -660,7 +654,7 @@ typing = {version = ">=3.7.4.1,<4.0.0.0", markers = "python_version >= \"2.7\" a
[[package]]
name = "pre-commit"
version = "2.16.0"
version = "2.17.0"
description = "A framework for managing and maintaining multi-language pre-commit hooks."
category = "dev"
optional = false
@ -768,6 +762,28 @@ wcwidth = "*"
checkqa-mypy = ["mypy (==v0.761)"]
testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"]
[[package]]
name = "pytest"
version = "6.2.5"
description = "pytest: simple powerful testing with Python"
category = "dev"
optional = false
python-versions = ">=3.6"
[package.dependencies]
atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""}
attrs = ">=19.2.0"
colorama = {version = "*", markers = "sys_platform == \"win32\""}
importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""}
iniconfig = "*"
packaging = "*"
pluggy = ">=0.12,<2.0"
py = ">=1.8.2"
toml = "*"
[package.extras]
testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"]
[[package]]
name = "pytest-cov"
version = "2.12.1"
@ -973,7 +989,7 @@ typing = {version = ">=3.6,<4.0", markers = "python_version >= \"2.7\" and pytho
[[package]]
name = "tox"
version = "3.24.4"
version = "3.24.5"
description = "tox is a generic virtualenv management and test command line tool"
category = "dev"
optional = false
@ -992,7 +1008,7 @@ virtualenv = ">=16.0.0,<20.0.0 || >20.0.0,<20.0.1 || >20.0.1,<20.0.2 || >20.0.2,
[package.extras]
docs = ["pygments-github-lexers (>=0.0.5)", "sphinx (>=2.0.0)", "sphinxcontrib-autoprogram (>=0.1.5)", "towncrier (>=18.5.0)"]
testing = ["flaky (>=3.4.0)", "freezegun (>=0.3.11)", "psutil (>=5.6.1)", "pytest (>=4.0.0)", "pytest-cov (>=2.5.1)", "pytest-mock (>=1.10.0)", "pytest-randomly (>=1.0.0)", "pytest-xdist (>=1.22.2)", "pathlib2 (>=2.3.3)"]
testing = ["flaky (>=3.4.0)", "freezegun (>=0.3.11)", "pytest (>=4.0.0)", "pytest-cov (>=2.5.1)", "pytest-mock (>=1.10.0)", "pytest-randomly (>=1.0.0)", "psutil (>=5.6.1)", "pathlib2 (>=2.3.3)"]
[[package]]
name = "typing"
@ -1025,14 +1041,13 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"]
[[package]]
name = "virtualenv"
version = "20.10.0"
version = "20.14.0"
description = "Virtual Python Environment builder"
category = "main"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
[package.dependencies]
"backports.entry-points-selectable" = ">=1.0.4"
distlib = ">=0.3.1,<1"
filelock = ">=3.2,<4"
importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""}
@ -1082,7 +1097,7 @@ testing = ["pathlib2", "unittest2", "jaraco.itertools", "func-timeout"]
[metadata]
lock-version = "1.1"
python-versions = "~2.7 || ^3.5"
content-hash = "290e530f0cdd81360dd6cb93f3182ac8e8b18a46238198d25de11c26f6b0c356"
content-hash = "3de9a28e5a2f53d26b75a9aa3eb333b360eb04470769675fb435183ab871798c"
[metadata.files]
atomicwrites = [
@ -1090,12 +1105,8 @@ atomicwrites = [
{file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"},
]
attrs = [
{file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"},
{file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"},
]
"backports.entry-points-selectable" = [
{file = "backports.entry_points_selectable-1.1.1-py2.py3-none-any.whl", hash = "sha256:7fceed9532a7aa2bd888654a7314f864a3c16a4e710b34a58cfc0f08114c663b"},
{file = "backports.entry_points_selectable-1.1.1.tar.gz", hash = "sha256:914b21a479fde881635f7af5adc7f6e38d6b274be32269070c53b698c60d5386"},
{file = "attrs-21.4.0-py2.py3-none-any.whl", hash = "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4"},
{file = "attrs-21.4.0.tar.gz", hash = "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd"},
]
"backports.functools-lru-cache" = [
{file = "backports.functools_lru_cache-1.6.4-py2.py3-none-any.whl", hash = "sha256:dbead04b9daa817909ec64e8d2855fb78feafe0b901d4568758e3a60559d8978"},
@ -1290,26 +1301,26 @@ cryptography = [
{file = "cryptography-3.3.2-cp36-abi3-win32.whl", hash = "sha256:3c284fc1e504e88e51c428db9c9274f2da9f73fdf5d7e13a36b8ecb039af6e6c"},
{file = "cryptography-3.3.2-cp36-abi3-win_amd64.whl", hash = "sha256:7951a966613c4211b6612b0352f5bf29989955ee592c4a885d8c7d0f830d0433"},
{file = "cryptography-3.3.2.tar.gz", hash = "sha256:5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed"},
{file = "cryptography-36.0.1-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:73bc2d3f2444bcfeac67dd130ff2ea598ea5f20b40e36d19821b4df8c9c5037b"},
{file = "cryptography-36.0.1-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:2d87cdcb378d3cfed944dac30596da1968f88fb96d7fc34fdae30a99054b2e31"},
{file = "cryptography-36.0.1-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:74d6c7e80609c0f4c2434b97b80c7f8fdfaa072ca4baab7e239a15d6d70ed73a"},
{file = "cryptography-36.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:6c0c021f35b421ebf5976abf2daacc47e235f8b6082d3396a2fe3ccd537ab173"},
{file = "cryptography-36.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d59a9d55027a8b88fd9fd2826c4392bd487d74bf628bb9d39beecc62a644c12"},
{file = "cryptography-36.0.1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0a817b961b46894c5ca8a66b599c745b9a3d9f822725221f0e0fe49dc043a3a3"},
{file = "cryptography-36.0.1-cp36-abi3-manylinux_2_24_x86_64.whl", hash = "sha256:94ae132f0e40fe48f310bba63f477f14a43116f05ddb69d6fa31e93f05848ae2"},
{file = "cryptography-36.0.1-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:7be0eec337359c155df191d6ae00a5e8bbb63933883f4f5dffc439dac5348c3f"},
{file = "cryptography-36.0.1-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:e0344c14c9cb89e76eb6a060e67980c9e35b3f36691e15e1b7a9e58a0a6c6dc3"},
{file = "cryptography-36.0.1-cp36-abi3-win32.whl", hash = "sha256:4caa4b893d8fad33cf1964d3e51842cd78ba87401ab1d2e44556826df849a8ca"},
{file = "cryptography-36.0.1-cp36-abi3-win_amd64.whl", hash = "sha256:391432971a66cfaf94b21c24ab465a4cc3e8bf4a939c1ca5c3e3a6e0abebdbcf"},
{file = "cryptography-36.0.1-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:bb5829d027ff82aa872d76158919045a7c1e91fbf241aec32cb07956e9ebd3c9"},
{file = "cryptography-36.0.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ebc15b1c22e55c4d5566e3ca4db8689470a0ca2babef8e3a9ee057a8b82ce4b1"},
{file = "cryptography-36.0.1-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:596f3cd67e1b950bc372c33f1a28a0692080625592ea6392987dba7f09f17a94"},
{file = "cryptography-36.0.1-pp38-pypy38_pp73-macosx_10_10_x86_64.whl", hash = "sha256:30ee1eb3ebe1644d1c3f183d115a8c04e4e603ed6ce8e394ed39eea4a98469ac"},
{file = "cryptography-36.0.1-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ec63da4e7e4a5f924b90af42eddf20b698a70e58d86a72d943857c4c6045b3ee"},
{file = "cryptography-36.0.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ca238ceb7ba0bdf6ce88c1b74a87bffcee5afbfa1e41e173b1ceb095b39add46"},
{file = "cryptography-36.0.1-pp38-pypy38_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:ca28641954f767f9822c24e927ad894d45d5a1e501767599647259cbf030b903"},
{file = "cryptography-36.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:39bdf8e70eee6b1c7b289ec6e5d84d49a6bfa11f8b8646b5b3dfe41219153316"},
{file = "cryptography-36.0.1.tar.gz", hash = "sha256:53e5c1dc3d7a953de055d77bef2ff607ceef7a2aac0353b5d630ab67f7423638"},
{file = "cryptography-36.0.2-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:4e2dddd38a5ba733be6a025a1475a9f45e4e41139d1321f412c6b360b19070b6"},
{file = "cryptography-36.0.2-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:4881d09298cd0b669bb15b9cfe6166f16fc1277b4ed0d04a22f3d6430cb30f1d"},
{file = "cryptography-36.0.2-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ea634401ca02367c1567f012317502ef3437522e2fc44a3ea1844de028fa4b84"},
{file = "cryptography-36.0.2-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:7be666cc4599b415f320839e36367b273db8501127b38316f3b9f22f17a0b815"},
{file = "cryptography-36.0.2-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8241cac0aae90b82d6b5c443b853723bcc66963970c67e56e71a2609dc4b5eaf"},
{file = "cryptography-36.0.2-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7b2d54e787a884ffc6e187262823b6feb06c338084bbe80d45166a1cb1c6c5bf"},
{file = "cryptography-36.0.2-cp36-abi3-manylinux_2_24_x86_64.whl", hash = "sha256:c2c5250ff0d36fd58550252f54915776940e4e866f38f3a7866d92b32a654b86"},
{file = "cryptography-36.0.2-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:ec6597aa85ce03f3e507566b8bcdf9da2227ec86c4266bd5e6ab4d9e0cc8dab2"},
{file = "cryptography-36.0.2-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:ca9f686517ec2c4a4ce930207f75c00bf03d94e5063cbc00a1dc42531511b7eb"},
{file = "cryptography-36.0.2-cp36-abi3-win32.whl", hash = "sha256:f64b232348ee82f13aac22856515ce0195837f6968aeaa94a3d0353ea2ec06a6"},
{file = "cryptography-36.0.2-cp36-abi3-win_amd64.whl", hash = "sha256:53e0285b49fd0ab6e604f4c5d9c5ddd98de77018542e88366923f152dbeb3c29"},
{file = "cryptography-36.0.2-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:32db5cc49c73f39aac27574522cecd0a4bb7384e71198bc65a0d23f901e89bb7"},
{file = "cryptography-36.0.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b3d199647468d410994dbeb8cec5816fb74feb9368aedf300af709ef507e3e"},
{file = "cryptography-36.0.2-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:da73d095f8590ad437cd5e9faf6628a218aa7c387e1fdf67b888b47ba56a17f0"},
{file = "cryptography-36.0.2-pp38-pypy38_pp73-macosx_10_10_x86_64.whl", hash = "sha256:0a3bf09bb0b7a2c93ce7b98cb107e9170a90c51a0162a20af1c61c765b90e60b"},
{file = "cryptography-36.0.2-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:8897b7b7ec077c819187a123174b645eb680c13df68354ed99f9b40a50898f77"},
{file = "cryptography-36.0.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:82740818f2f240a5da8dfb8943b360e4f24022b093207160c77cadade47d7c85"},
{file = "cryptography-36.0.2-pp38-pypy38_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:1f64a62b3b75e4005df19d3b5235abd43fa6358d5516cfc43d87aeba8d08dd51"},
{file = "cryptography-36.0.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:e167b6b710c7f7bc54e67ef593f8731e1f45aa35f8a8a7b72d6e42ec76afd4b3"},
{file = "cryptography-36.0.2.tar.gz", hash = "sha256:70f8f4f7bb2ac9f340655cbac89d68c527af5bb4387522a8413e841e3e6628c9"},
]
distlib = [
{file = "distlib-0.3.4-py2.py3-none-any.whl", hash = "sha256:6564fe0a8f51e734df6333d08b8b94d4ea8ee6b99b5ed50613f731fd4089f34b"},
@ -1351,8 +1362,8 @@ httpretty = [
{file = "httpretty-0.9.7.tar.gz", hash = "sha256:66216f26b9d2c52e81808f3e674a6fb65d4bf719721394a1a9be926177e55fbe"},
]
identify = [
{file = "identify-2.4.0-py2.py3-none-any.whl", hash = "sha256:eba31ca80258de6bb51453084bff4a923187cd2193b9c13710f2516ab30732cc"},
{file = "identify-2.4.0.tar.gz", hash = "sha256:a33ae873287e81651c7800ca309dc1f84679b763c9c8b30680e16fbfa82f0107"},
{file = "identify-2.4.4-py2.py3-none-any.whl", hash = "sha256:aa68609c7454dbcaae60a01ff6b8df1de9b39fe6e50b1f6107ec81dcda624aa6"},
{file = "identify-2.4.4.tar.gz", hash = "sha256:6b4b5031f69c48bf93a646b90de9b381c6b5f560df4cbe0ed3cf7650ae741e4d"},
]
idna = [
{file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"},
@ -1366,6 +1377,10 @@ importlib-resources = [
{file = "importlib_resources-3.2.1-py2.py3-none-any.whl", hash = "sha256:e2860cf0c4bc999947228d18be154fa3779c5dde0b882bd2d7b3f4d25e698bd6"},
{file = "importlib_resources-3.2.1.tar.gz", hash = "sha256:a9fe213ab6452708ec1b3f4ec6f2881b8ab3645cb4e5efb7fea2bbf05a91db3b"},
]
iniconfig = [
{file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"},
{file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"},
]
ipaddress = [
{file = "ipaddress-1.0.23-py2.py3-none-any.whl", hash = "sha256:6e0f4a39e66cb5bb9a137b00276a2eff74f93b71dcbdad6f10ff7df9d3557fcc"},
{file = "ipaddress-1.0.23.tar.gz", hash = "sha256:b7f8e0369580bb4a24d5ba1d7cc29660a4a6987763faf1d8a8046830e020e7e2"},
@ -1381,8 +1396,8 @@ keyring = [
{file = "keyring-18.0.1.tar.gz", hash = "sha256:67d6cc0132bd77922725fae9f18366bb314fd8f95ff4d323a4df41890a96a838"},
{file = "keyring-20.0.1-py2.py3-none-any.whl", hash = "sha256:c674f032424b4bffc62abeac5523ec49cc84aed07a480c3233e0baf618efc15c"},
{file = "keyring-20.0.1.tar.gz", hash = "sha256:963bfa7f090269d30bdc5e25589e5fd9dad2cf2a7c6f176a7f2386910e5d0d8d"},
{file = "keyring-21.8.0-py3-none-any.whl", hash = "sha256:4be9cbaaaf83e61d6399f733d113ede7d1c73bc75cb6aeb64eee0f6ac39b30ea"},
{file = "keyring-21.8.0.tar.gz", hash = "sha256:1746d3ac913d449a090caf11e9e4af00e26c3f7f7e81027872192b2398b98675"},
{file = "keyring-22.3.0-py3-none-any.whl", hash = "sha256:2bc8363ebdd63886126a012057a85c8cb6e143877afa02619ac7dbc9f38a207b"},
{file = "keyring-22.3.0.tar.gz", hash = "sha256:16927a444b2c73f983520a48dec79ddab49fe76429ea05b8d528d778c8339522"},
]
lockfile = [
{file = "lockfile-0.12.2-py2.py3-none-any.whl", hash = "sha256:6c3cb24f344923d30b2785d5ad75182c8ea7ac1b6171b08657258ec7429d50fa"},
@ -1450,8 +1465,8 @@ pastel = [
{file = "pastel-0.2.1.tar.gz", hash = "sha256:e6581ac04e973cac858828c6202c1e1e81fee1dc7de7683f3e1ffe0bfd8a573d"},
]
pathlib2 = [
{file = "pathlib2-2.3.6-py2.py3-none-any.whl", hash = "sha256:3a130b266b3a36134dcc79c17b3c7ac9634f083825ca6ea9d8f557ee6195c9c8"},
{file = "pathlib2-2.3.6.tar.gz", hash = "sha256:7d8bcb5555003cdf4a8d2872c538faa3a0f5d20630cb360e518ca3b981795e5f"},
{file = "pathlib2-2.3.7.post1-py2.py3-none-any.whl", hash = "sha256:5266a0fd000452f1b3467d782f079a4343c63aaa119221fbdc4e39577489ca5b"},
{file = "pathlib2-2.3.7.post1.tar.gz", hash = "sha256:9fe0edad898b83c0c3e199c842b27ed216645d2e177757b2dd67384d4113c641"},
]
pexpect = [
{file = "pexpect-4.8.0-py2.py3-none-any.whl", hash = "sha256:0b48a55dcb3c05f3329815901ea4fc1537514d6ba867a152b581d69ae3710937"},
@ -1470,12 +1485,12 @@ pluggy = [
{file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"},
]
poetry-core = [
{file = "poetry-core-1.0.7.tar.gz", hash = "sha256:98c11c755a16ef6c5673c22ca94a3802a7df4746a0853a70b6fae8b9f5cac206"},
{file = "poetry_core-1.0.7-py2.py3-none-any.whl", hash = "sha256:4f8a7f5390d772f42c4c4c3f188e6424b802cb4b57466c6633a1b9ac36f18a43"},
{file = "poetry-core-1.0.8.tar.gz", hash = "sha256:951fc7c1f8d710a94cb49019ee3742125039fc659675912ea614ac2aa405b118"},
{file = "poetry_core-1.0.8-py2.py3-none-any.whl", hash = "sha256:54b0fab6f7b313886e547a52f8bf52b8cf43e65b2633c65117f8755289061924"},
]
pre-commit = [
{file = "pre_commit-2.16.0-py2.py3-none-any.whl", hash = "sha256:758d1dc9b62c2ed8881585c254976d66eae0889919ab9b859064fc2fe3c7743e"},
{file = "pre_commit-2.16.0.tar.gz", hash = "sha256:fe9897cac830aa7164dbd02a4e7b90cae49630451ce88464bca73db486ba9f65"},
{file = "pre_commit-2.17.0-py2.py3-none-any.whl", hash = "sha256:725fa7459782d7bec5ead072810e47351de01709be838c2ce1726b9591dad616"},
{file = "pre_commit-2.17.0.tar.gz", hash = "sha256:c1a8040ff15ad3d648c70cc3e55b93e4d2d5b687320955505587fd79bbaed06a"},
]
ptyprocess = [
{file = "ptyprocess-0.7.0-py2.py3-none-any.whl", hash = "sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35"},
@ -1502,6 +1517,8 @@ pytest = [
{file = "pytest-4.6.11.tar.gz", hash = "sha256:50fa82392f2120cc3ec2ca0a75ee615be4c479e66669789771f1758332be4353"},
{file = "pytest-5.4.3-py3-none-any.whl", hash = "sha256:5c0db86b698e8f170ba4582a492248919255fcd4c79b1ee64ace34301fb589a1"},
{file = "pytest-5.4.3.tar.gz", hash = "sha256:7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8"},
{file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"},
{file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"},
]
pytest-cov = [
{file = "pytest-cov-2.12.1.tar.gz", hash = "sha256:261ceeb8c227b726249b376b8526b600f38667ee314f910353fa318caa01f4d7"},
@ -1610,8 +1627,8 @@ tomlkit = [
{file = "tomlkit-0.7.2.tar.gz", hash = "sha256:d7a454f319a7e9bd2e249f239168729327e4dd2d27b17dc68be264ad1ce36754"},
]
tox = [
{file = "tox-3.24.4-py2.py3-none-any.whl", hash = "sha256:5e274227a53dc9ef856767c21867377ba395992549f02ce55eb549f9fb9a8d10"},
{file = "tox-3.24.4.tar.gz", hash = "sha256:c30b57fa2477f1fb7c36aa1d83292d5c2336cd0018119e1b1c17340e2c2708ca"},
{file = "tox-3.24.5-py2.py3-none-any.whl", hash = "sha256:be3362472a33094bce26727f5f771ca0facf6dafa217f65875314e9a6600c95c"},
{file = "tox-3.24.5.tar.gz", hash = "sha256:67e0e32c90e278251fea45b696d0fef3879089ccbe979b0c556d35d5a70e2993"},
]
typing = [
{file = "typing-3.10.0.0-py2-none-any.whl", hash = "sha256:c7219ef20c5fbf413b4567092adfc46fa6203cb8454eda33c3fc1afe1398a308"},
@ -1628,8 +1645,8 @@ urllib3 = [
{file = "urllib3-1.25.11.tar.gz", hash = "sha256:8d7eaa5a82a1cac232164990f04874c594c9453ec55eef02eab885aa02fc17a2"},
]
virtualenv = [
{file = "virtualenv-20.10.0-py2.py3-none-any.whl", hash = "sha256:4b02e52a624336eece99c96e3ab7111f469c24ba226a53ec474e8e787b365814"},
{file = "virtualenv-20.10.0.tar.gz", hash = "sha256:576d05b46eace16a9c348085f7d0dc8ef28713a2cabaa1cf0aea41e8f12c9218"},
{file = "virtualenv-20.14.0-py2.py3-none-any.whl", hash = "sha256:1e8588f35e8b42c6ec6841a13c5e88239de1e6e4e4cedfd3916b306dc826ec66"},
{file = "virtualenv-20.14.0.tar.gz", hash = "sha256:8e5b402037287126e81ccde9432b95a8be5b19d36584f64957060a3488c11ca8"},
]
wcwidth = [
{file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"},

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "poetry"
version = "1.1.12"
version = "1.1.13"
description = "Python dependency management and packaging made easy."
authors = [
"Sébastien Eustace <sebastien@eustace.io>"
@ -57,7 +57,7 @@ functools32 = { version = "^3.2.3", python = "~2.7" }
keyring = [
{ version = "^18.0.1", python = "~2.7" },
{ version = "^20.0.1", python = "~3.5" },
{ version = "^21.2.0", python = "^3.6" }
{ version = ">=21.2.0", python = "^3.6" }
]
# Use subprocess32 for Python 2.7
subprocess32 = { version = "^3.5", python = "~2.7" }
@ -66,7 +66,8 @@ importlib-metadata = {version = "^1.6.0", python = "<3.8"}
[tool.poetry.dev-dependencies]
pytest = [
{version = "^4.1", python = "<3.5"},
{version = "^5.4.3", python = ">=3.5"}
{version = "^5.4.3", python = "~3.5"},
{version = "^6.2.5", python = ">=3.6"}
]
pytest-cov = "^2.5"
pytest-mock = "^1.9"

View file

@ -1,7 +1,7 @@
{
"owner": "python-poetry",
"repo": "poetry",
"rev": "020fb336e6da11d3a9909f30bd908437a69f13b3",
"sha256": "1fm4yj6wxr24v7b77gmf63j7xsgszhbhzw2i9fvlfi0p9l0q34pm",
"fetchSubmodules": true
"owner": "python-poetry",
"repo": "poetry",
"rev": "1.1.13",
"sha256": "0zm73wcxjfad3841wl1xpx20drhynrqlxsjh1d1gsh618b7ldpib",
"fetchSubmodules": true
}

View file

@ -1,11 +0,0 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p curl nix-prefetch-github jq
rev=$(curl -s https://api.github.com/repos/python-poetry/poetry/releases/latest | jq -r '.name')
nix-prefetch-github --rev "$rev" python-poetry poetry > src.json
echo >> src.json
src=$(nix-build --no-out-link --expr 'with import <nixpkgs> {}; fetchFromGitHub (lib.importJSON ./src.json)')
cp $src/pyproject.toml $src/poetry.lock .
nix-shell -p poetry --run 'poetry lock'
nix-build --expr '(import <nixpkgs> { overlays = [ (import ../../overlay.nix) ]; }).poetry'

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
pwd=$(pwd)
workdir=$(mktemp -d)
@ -15,8 +16,8 @@ mv poetry2nix-master/* .
mkdir build
cp *.* build/
cp -r pkgs hooks bin build/
rm build/shell.nix build/generate.py build/overlay.nix build/flake.* build/check-fmt.nix
cp -r overrides pkgs hooks bin build/
rm build/shell.nix build/generate.py build/overlay.nix build/flake.* build/check-fmt.nix build/pkgs/poetry/update*
cat > build/README.md << EOF
Dont change these files here, they are maintained at https://github.com/nix-community/poetry2nix

View file

@ -31,6 +31,9 @@ rec {
*/
inherit (import ./formats/java-properties/default.nix { inherit lib pkgs; })
javaProperties;
json = {}: {
type = with lib.types; let

View file

@ -0,0 +1,90 @@
{ lib, pkgs }:
{
javaProperties = { comment ? "Generated with Nix" }: {
type = lib.types.attrsOf lib.types.str;
generate = name: value:
pkgs.runCommandLocal name
{
# Requirements
# ============
#
# 1. Strings in Nix carry over to the same
# strings in Java => need proper escapes
# 2. Generate files quickly
# - A JVM would have to match the app's
# JVM to avoid build closure bloat
# - Even then, JVM startup would slow
# down config generation.
#
#
# Implementation
# ==============
#
# Escaping has two steps
#
# 1. jq
# Escape known separators, in order not
# to break up the keys and values.
# This handles typical whitespace correctly,
# but may produce garbage for other control
# characters.
#
# 2. iconv
# Escape >ascii code points to java escapes,
# as .properties files are supposed to be
# encoded in ISO 8859-1. It's an old format.
# UTF-8 behavior may exist in some apps and
# libraries, but we can't rely on this in
# general.
passAsFile = [ "value" ];
value = builtins.toJSON value;
nativeBuildInputs = [
pkgs.jq
pkgs.libiconvReal
];
jqCode =
let
main = ''
to_entries
| .[]
| "\(
.key
| ${commonEscapes}
| gsub(" "; "\\ ")
| gsub("="; "\\=")
) = \(
.value
| ${commonEscapes}
| gsub("^ "; "\\ ")
| gsub("\\n "; "\n\\ ")
)"
'';
# Most escapes are equal for both keys and values.
commonEscapes = ''
gsub("\\\\"; "\\\\")
| gsub("\\n"; "\\n\\\n")
| gsub("#"; "\\#")
| gsub("!"; "\\!")
| gsub("\\t"; "\\t")
| gsub("\r"; "\\r")
'';
in
main;
inputEncoding = "UTF-8";
inherit comment;
} ''
(
echo "$comment" | while read -r ln; do echo "# $ln"; done
echo
jq -r --arg hash '#' "$jqCode" "$valuePath" \
| iconv --from-code "$inputEncoding" --to-code JAVA \
) > "$out"
'';
};
}

View file

@ -0,0 +1,27 @@
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
import java.util.SortedSet;
import java.util.TreeSet;
class Main {
public static void main (String args[]) {
try {
InputStream input = new FileInputStream(args[0]);
Properties prop = new Properties();
prop.load(input);
SortedSet<String> keySet = new TreeSet(prop.keySet());
for (String key : keySet) {
System.out.println("KEY");
System.out.println(key);
System.out.println("VALUE");
System.out.println(prop.get(key));
System.out.println("");
}
} catch (Exception e) {
e.printStackTrace();
System.err.println(e.toString());
System.exit(1);
}
}
}

View file

@ -0,0 +1,85 @@
{ fetchurl
, formats
, glibcLocales
, jdk
, lib
, stdenv
}:
let
inherit (lib) concatStrings attrValues mapAttrs;
javaProperties = formats.javaProperties { };
input = {
foo = "bar";
"empty value" = "";
"typical.dot.syntax" = "com.sun.awt";
"" = "empty key's value";
"1" = "2 3";
"#" = "not a comment # still not";
"!" = "not a comment!";
"!a" = "still not! a comment";
"!b" = "still not ! a comment";
"dos paths" = "C:\\Program Files\\Nix For Windows\\nix.exe";
"a \t\nb" = " c";
"angry \t\nkey" = ''
multi
${"\tline\r"}
space-
indented
trailing-space${" "}
trailing-space${" "}
value
'';
"this=not" = "bad";
"nor = this" = "bad";
"all stuff" = "foo = bar";
"unicode big brain" = "e = mc";
"ütf-8" = "dûh";
# NB: Some editors (vscode) show this _whole_ line in right-to-left order
"الجبر" = "أكثر من مجرد أرقام";
};
in
stdenv.mkDerivation {
name = "pkgs.formats.javaProperties-test-${jdk.name}";
nativeBuildInputs = [
jdk
glibcLocales
];
# technically should go through the type.merge first, but that's tested
# in tests/formats.nix.
properties = javaProperties.generate "example.properties" input;
# Expected output as printed by Main.java
passAsFile = [ "expected" ];
expected = concatStrings (attrValues (
mapAttrs
(key: value:
''
KEY
${key}
VALUE
${value}
''
)
input
));
src = lib.sourceByRegex ./. [
".*\.java"
];
LANG = "C.UTF-8";
buildPhase = ''
javac Main.java
'';
doCheck = true;
checkPhase = ''
cat -v $properties
java Main $properties >actual
diff -U3 $expectedPath actual
'';
installPhase = "touch $out";
}

View file

@ -1,7 +1,45 @@
# Call nix-build on this file to run all tests in this directory
{ pkgs ? import ../../.. {} }:
# This produces a link farm derivation with the original attrs
# merged on top of it.
# You can run parts of the "hierarchy" with for example:
# nix-build -A java-properties
# See `structured` below.
{ pkgs ? import ../../.. { } }:
let
formats = import ./formats.nix { inherit pkgs; };
in pkgs.linkFarm "nixpkgs-pkgs-lib-tests" [
{ name = "formats"; path = import ./formats.nix { inherit pkgs; }; }
]
inherit (pkgs.lib) mapAttrs mapAttrsToList isDerivation mergeAttrs foldl' attrValues recurseIntoAttrs;
structured = {
formats = import ./formats.nix { inherit pkgs; };
java-properties = recurseIntoAttrs {
jdk8 = pkgs.callPackage ../formats/java-properties/test { jdk = pkgs.jdk8; };
jdk11 = pkgs.callPackage ../formats/java-properties/test { jdk = pkgs.jdk11_headless; };
jdk17 = pkgs.callPackage ../formats/java-properties/test { jdk = pkgs.jdk17_headless; };
};
};
flatten = prefix: as:
foldl'
mergeAttrs
{ }
(attrValues
(mapAttrs
(k: v:
if isDerivation v
then { "${prefix}${k}" = v; }
else if v?recurseForDerivations
then flatten "${prefix}${k}-" (removeAttrs v [ "recurseForDerivations" ])
else builtins.trace v throw "expected derivation or recurseIntoAttrs")
as
)
);
in
# It has to be a link farm for inclusion in the hydra unstable jobset.
pkgs.linkFarm "pkgs-lib-formats-tests"
(mapAttrsToList
(k: v: { name = k; path = v; })
(flatten "" structured)
)
// structured

View file

@ -168,4 +168,23 @@ in runBuildTests {
level4 = "deep"
'';
};
# See also java-properties/default.nix for more complete tests
testJavaProperties = {
drv = evalFormat formats.javaProperties {} {
foo = "bar";
"1" = "2";
"ütf 8" = "dûh";
# NB: Some editors (vscode) show this _whole_ line in right-to-left order
"الجبر" = "أكثر من مجرد أرقام";
};
expected = ''
# Generated with Nix
1 = 2
foo = bar
\u00fctf\ 8 = d\u00fbh
\u0627\u0644\u062c\u0628\u0631 = \u0623\u0643\u062b\u0631 \u0645\u0646 \u0645\u062c\u0631\u062f \u0623\u0631\u0642\u0627\u0645
'';
};
}

View file

@ -7,7 +7,8 @@ let
poetry2nix.defaultPoetryOverrides
(import ./poetry-git-overlay.nix { inherit pkgs; })
(self: super: {
dmarc-metrics-exporter = super.dmarc-metrics-exporter.overridePythonAttrs ({ meta ? {}, ... }: {
dmarc-metrics-exporter = super.dmarc-metrics-exporter.overridePythonAttrs ({ nativeBuildInputs ? [ ], meta ? {}, ... }: {
nativeBuildInputs = nativeBuildInputs ++ [ self.poetry ];
meta = with lib; meta // {
license = licenses.mit;
homepage = "https://github.com/jgosmann/dmarc-metrics-exporter/";
@ -44,6 +45,9 @@ let
'';
});
dataclasses = null;
bite-parser = super.bite-parser.overridePythonAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ self.poetry ];
});
})
];
}) python;

View file

@ -70,4 +70,6 @@ with pkgs;
dhall = callPackage ./dhall { };
makeWrapper = callPackage ./make-wrapper {};
pkgs-lib = recurseIntoAttrs (import ../pkgs-lib/tests { inherit pkgs; });
}

View file

@ -3,18 +3,15 @@
, fetchFromGitHub
, bluez-tools
, cinnamon
, gnome
, gobject-introspection
, intltool
, pavucontrol
, python3Packages
, util-linux
, wrapGAppsHook
, callPackage
}:
let
gnome-bluetooth = callPackage ./gnome-bluetooth.nix {};
in
stdenv.mkDerivation rec {
pname = "blueberry";
version = "1.4.7";
@ -35,7 +32,7 @@ stdenv.mkDerivation rec {
buildInputs = [
bluez-tools
cinnamon.xapps
gnome-bluetooth
gnome.gnome-bluetooth_1_0
python3Packages.python
util-linux
];

View file

@ -21656,6 +21656,9 @@ with pkgs;
morty = callPackage ../servers/web-apps/morty { };
inherit (callPackage ../applications/networking/mullvad { })
mullvad;
mullvad-vpn = callPackage ../applications/networking/mullvad-vpn { };
mycorrhiza = callPackage ../servers/mycorrhiza {