diff options
13 files changed, 264 insertions, 54 deletions
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml index 86e952ae70c87..1a6b09df26333 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml @@ -1644,6 +1644,14 @@ </listitem> <listitem> <para> + The auto-upgrade service now accepts persistent (default: + true) parameter. By default auto-upgrade will now run + immediately if it would have been triggered at least once + during the time when the timer was inactive. + </para> + </listitem> + <listitem> + <para> If you are using Wayland you can choose to use the Ozone Wayland support in Chrome and several Electron apps by setting the environment variable <literal>NIXOS_OZONE_WL=1</literal> diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md index 68ca9a6c3c84a..de1251104188a 100644 --- a/nixos/doc/manual/release-notes/rl-2205.section.md +++ b/nixos/doc/manual/release-notes/rl-2205.section.md @@ -597,6 +597,10 @@ In addition to numerous new and upgraded packages, this release has the followin - Support for older versions of hadoop have been added to the module - Overriding and extending site XML files has been made easier +- The auto-upgrade service now accepts persistent (default: true) parameter. + By default auto-upgrade will now run immediately if it would have been triggered at least + once during the time when the timer was inactive. + - If you are using Wayland you can choose to use the Ozone Wayland support in Chrome and several Electron apps by setting the environment variable `NIXOS_OZONE_WL=1` (for example via diff --git a/nixos/modules/tasks/auto-upgrade.nix b/nixos/modules/tasks/auto-upgrade.nix index a5755d08d7de9..d00dc761d6e38 100644 --- a/nixos/modules/tasks/auto-upgrade.nix +++ b/nixos/modules/tasks/auto-upgrade.nix @@ -63,13 +63,16 @@ in { }; dates = mkOption { - default = "04:40"; type = types.str; + default = "04:40"; + example = "daily"; description = '' - Specification (in the format described by + How often or when upgrade occurs. For most desktop and server systems + a sufficient upgrade frequency is once a day. + + The format is described in <citerefentry><refentrytitle>systemd.time</refentrytitle> - <manvolnum>7</manvolnum></citerefentry>) of the time at - which the update will occur. + <manvolnum>7</manvolnum></citerefentry>. ''; }; @@ -123,6 +126,22 @@ in { }); }; + persistent = mkOption { + default = true; + type = types.bool; + example = false; + description = '' + Takes a boolean argument. If true, the time when the service + unit was last triggered is stored on disk. When the timer is + activated, the service unit is triggered immediately if it + would have been triggered at least once during the time when + the timer was inactive. Such triggering is nonetheless + subject to the delay imposed by RandomizedDelaySec=. This is + useful to catch up on missed runs of the service when the + system was powered down. + ''; + }; + }; }; @@ -217,11 +236,17 @@ in { ''; startAt = cfg.dates; - }; - systemd.timers.nixos-upgrade.timerConfig.RandomizedDelaySec = - cfg.randomizedDelaySec; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; + }; + systemd.timers.nixos-upgrade = { + timerConfig = { + RandomizedDelaySec = cfg.randomizedDelaySec; + Persistent = cfg.persistent; + }; + }; }; } diff --git a/pkgs/development/compilers/graalvm/community-edition/default.nix b/pkgs/development/compilers/graalvm/community-edition/default.nix index e45c89b3f1be5..167aaa95c5ffd 100644 --- a/pkgs/development/compilers/graalvm/community-edition/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/default.nix @@ -15,8 +15,8 @@ let */ graalvm11-ce-release-version = "22.0.0.2"; graalvm17-ce-release-version = "22.0.0.2"; - graalvm11-ce-dev-version = "22.2.0-dev-20220401_1942"; - graalvm17-ce-dev-version = "22.2.0-dev-20220401_1942"; + graalvm11-ce-dev-version = "22.2.0-dev-20220415_1945"; + graalvm17-ce-dev-version = "22.2.0-dev-20220415_1945"; products = [ "graalvm-ce" @@ -49,7 +49,6 @@ in }; defaultVersion = graalvm11-ce-release-version; javaVersion = "11"; - platforms = builtins.attrNames config; }; graalvm17-ce = mkGraal rec { @@ -74,6 +73,5 @@ in }; defaultVersion = graalvm17-ce-release-version; javaVersion = "17"; - platforms = builtins.attrNames config; }; } diff --git a/pkgs/development/compilers/graalvm/community-edition/graalvm11-ce-sources.json b/pkgs/development/compilers/graalvm/community-edition/graalvm11-ce-sources.json index e3d514d58b9d7..732cefbdf7387 100644 --- a/pkgs/development/compilers/graalvm/community-edition/graalvm11-ce-sources.json +++ b/pkgs/development/compilers/graalvm/community-edition/graalvm11-ce-sources.json @@ -1,12 +1,12 @@ { "darwin-aarch64": { - "graalvm-ce|java11|22.2.0-dev-20220414_2112": { - "sha256": "7d1d39a7cc2579112e745943fa5b557405b501f5c3c3fde441f9a31c7627d18d", - "url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220414_2112/graalvm-ce-java11-darwin-aarch64-dev.tar.gz" + "graalvm-ce|java11|22.2.0-dev-20220415_1945": { + "sha256": "ab81b00177124d746a3871b6e48ce7611e93dd3b4f6dee45d77300ef214fbab8", + "url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220415_1945/graalvm-ce-java11-darwin-aarch64-dev.tar.gz" }, - "native-image-installable-svm|java11|22.2.0-dev-20220414_2112": { - "sha256": "5ec82588bf493c38656ca7c31fff276342ce1cbadee41309ae7a3486f56f7ba7", - "url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220414_2112/native-image-installable-svm-java11-darwin-aarch64-dev.jar" + "native-image-installable-svm|java11|22.2.0-dev-20220415_1945": { + "sha256": "9d3753736fe71f55f3fb3bcbdf43271dd96dda0c4b731d11f3f890d5bddf3bbb", + "url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220415_1945/native-image-installable-svm-java11-darwin-aarch64-dev.jar" } }, "darwin-amd64": { diff --git a/pkgs/development/compilers/graalvm/community-edition/mkGraal.nix b/pkgs/development/compilers/graalvm/community-edition/mkGraal.nix index 8f4aaba44f088..77f0fa9b7dc5e 100644 --- a/pkgs/development/compilers/graalvm/community-edition/mkGraal.nix +++ b/pkgs/development/compilers/graalvm/community-edition/mkGraal.nix @@ -1,7 +1,36 @@ -{ javaVersion +{ + # An attrset describing each platform configuration. All values are extract + # from the GraalVM releases available on + # https://github.com/graalvm/graalvm-ce-builds/releases + # Example: + # config = { + # x86_64-linux = { + # # List of products that will be included in the GraalVM derivation + # # See `with{NativeImage,Ruby,Python,WASM,*}Svm` variables for the + # # available values + # products = [ "graalvm-ce" "native-image-installable-svm" ]; + # # GraalVM arch, not to be confused with the nix platform + # arch = "linux-amd64"; + # # GraalVM version + # version = "22.0.0.2"; + # }; + # } + config + # GraalVM version that will be used unless overriden by `config.<platform>.version` , defaultVersion -, platforms -, config + # Java version used by GraalVM +, javaVersion + # Platforms were GraalVM will be allowed to build (i.e. `meta.platforms`) +, platforms ? builtins.attrNames config + # If set to true, update script will (re-)generate the sources file even if + # there are no updates available +, forceUpdate ? false + # Path for the sources file that will be used + # See `update.nix` file for a description on how this file works +, sourcesPath ? ./. + "/graalvm${javaVersion}-ce-sources.json" + # Use musl instead of glibc to allow true static builds in GraalVM's + # Native Image (i.e.: `--static --libc=musl`). This will cause glibc builds + # to fail, so it should be used with care , useMusl ? false }: @@ -32,10 +61,11 @@ , gtkSupport ? stdenv.isLinux , cairo , glib + # updateScript deps +, gnused , gtk3 -, writeShellScript , jq -, gnused +, writeShellScript }: assert useMusl -> stdenv.isLinux; @@ -44,8 +74,7 @@ let platform = config.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); version = platform.version or defaultVersion; name = "graalvm${javaVersion}-ce"; - sourcesFilename = "${name}-sources.json"; - sources = builtins.fromJSON (builtins.readFile (./. + "/${sourcesFilename}")); + sources = builtins.fromJSON (builtins.readFile sourcesPath); runtimeLibraryPath = lib.makeLibraryPath ([ cups ] ++ lib.optionals gtkSupport [ cairo glib gtk3 ]); @@ -285,7 +314,7 @@ let inherit (platform) products; home = graalvmXXX-ce; updateScript = import ./update.nix { - inherit lib writeShellScript jq sourcesFilename name config gnused defaultVersion; + inherit config defaultVersion forceUpdate gnused jq lib name sourcesPath writeShellScript; graalVersion = version; javaVersion = "java${javaVersion}"; }; diff --git a/pkgs/development/compilers/graalvm/community-edition/update.nix b/pkgs/development/compilers/graalvm/community-edition/update.nix index 6201ab100177e..77f9d0e095baf 100644 --- a/pkgs/development/compilers/graalvm/community-edition/update.nix +++ b/pkgs/development/compilers/graalvm/community-edition/update.nix @@ -1,14 +1,14 @@ -{ javaVersion -, graalVersion +{ config , defaultVersion -, config -, sourcesFilename -, name +, forceUpdate +, gnused +, graalVersion +, javaVersion +, jq , lib +, name +, sourcesPath , writeShellScript -, jq -, gnused -, forceUpdate ? false }: /* @@ -185,7 +185,7 @@ let newVersion = getLatestVersion graalVersion; sourcesJson = genSources javaVersion defaultVersion config; - sourcesJsonPath = lib.strings.escapeShellArg ./. + "/${sourcesFilename}"; + sourcesJsonPath = lib.strings.escapeShellArg sourcesPath; # versionKeyInDefaultNix String -> String versionKeyInDefaultNix = graalVersion: diff --git a/pkgs/development/python-modules/brother/default.nix b/pkgs/development/python-modules/brother/default.nix index 17d46940e254e..db4ef16522e83 100644 --- a/pkgs/development/python-modules/brother/default.nix +++ b/pkgs/development/python-modules/brother/default.nix @@ -1,37 +1,29 @@ { lib , buildPythonPackage , fetchFromGitHub -, pysnmp +, pysnmplib , pytest-asyncio , pytest-error-for-skips -, pytest-runner , pytestCheckHook , pythonOlder }: buildPythonPackage rec { pname = "brother"; - version = "1.1.0"; + version = "1.2.0"; + format = "setuptools"; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "bieniu"; repo = pname; rev = version; - sha256 = "sha256-ZDQIpzdr3XkYrSUgrBDZsUwUZRQCdJdvmniMezvJxzU="; + hash = "sha256-hKOZ5pTDwhM0lOXoatXXVvEVxiTfxIpBRe3fFcUfzwE="; }; - nativeBuildInputs = [ - pytest-runner - ]; - - postPatch = '' - substituteInPlace setup.cfg \ - --replace "--cov --cov-report term-missing " "" - ''; - propagatedBuildInputs = [ - pysnmp + pysnmplib ]; checkInputs = [ @@ -40,7 +32,16 @@ buildPythonPackage rec { pytestCheckHook ]; - pythonImportsCheck = [ "brother" ]; + postPatch = '' + substituteInPlace setup.cfg \ + --replace "--cov --cov-report term-missing " "" + substituteInPlace setup.py \ + --replace '"pytest-runner"' "" + ''; + + pythonImportsCheck = [ + "brother" + ]; meta = with lib; { description = "Python wrapper for getting data from Brother laser and inkjet printers via SNMP"; diff --git a/pkgs/development/python-modules/pysnmp-pyasn1/default.nix b/pkgs/development/python-modules/pysnmp-pyasn1/default.nix new file mode 100644 index 0000000000000..3caccf688b8c0 --- /dev/null +++ b/pkgs/development/python-modules/pysnmp-pyasn1/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, poetry-core +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "pysnmp-pyasn1"; + version = "1.1.2"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "pysnmp"; + repo = "pyasn1"; + rev = "v${version}"; + hash = "sha256-R4reMwVcJBTfTEHUk6sSUugsEPuKIziH1WbjMakP/dA="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "pyasn1" + ]; + + meta = with lib; { + description = "Python ASN.1 encoder and decoder"; + homepage = "https://github.com/pysnmp/pyasn1"; + license = licenses.bsd2; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/pysnmp-pysmi/default.nix b/pkgs/development/python-modules/pysnmp-pysmi/default.nix new file mode 100644 index 0000000000000..0616a7c695e9f --- /dev/null +++ b/pkgs/development/python-modules/pysnmp-pysmi/default.nix @@ -0,0 +1,46 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, ply +, poetry-core +, requests +}: + +buildPythonPackage rec { + pname = "pysnmp-pysmi"; + version = "1.1.8"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "pysnmp"; + repo = "pysmi"; + rev = "v${version}"; + hash = "sha256-nsIEZPD7bfbePZukkudP0ZH/m8Be88QkVDM5PdjNHVk="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + ply + requests + ]; + + # Circular dependency with pysnmplib + doCheck = false; + + pythonImportsCheck = [ + "pysmi" + ]; + + meta = with lib; { + description = "SNMP MIB parser"; + homepage = "https://github.com/pysnmp/pysmi"; + license = licenses.bsd2; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/pysnmplib/default.nix b/pkgs/development/python-modules/pysnmplib/default.nix new file mode 100644 index 0000000000000..3c3333074a68c --- /dev/null +++ b/pkgs/development/python-modules/pysnmplib/default.nix @@ -0,0 +1,48 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, pycryptodomex +, pysnmp-pyasn1 +, pysnmp-pysmi +, pythonOlder +}: + +buildPythonPackage rec { + pname = "pysnmplib"; + version = "5.0.10"; + format = "pyproject"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "pysnmp"; + repo = "pysnmp"; + rev = "v${version}"; + hash = "sha256-PsfsOVzeHCVdd1Bi+FYYi68Wzn1MI8dZUbRr/tmT+cA="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + pysnmp-pysmi + pysnmp-pyasn1 + pycryptodomex + ]; + + # Module has no test, examples are used for testing + doCheck = false; + + pythonImportsCheck = [ + "pysnmp" + ]; + + meta = with lib; { + description = "Implementation of v1/v2c/v3 SNMP engine"; + homepage = "https://github.com/pysnmp/pysnmp"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/tools/misc/kt/default.nix b/pkgs/tools/misc/kt/default.nix index e4713890ac40f..3e9bac0e09e9c 100644 --- a/pkgs/tools/misc/kt/default.nix +++ b/pkgs/tools/misc/kt/default.nix @@ -1,17 +1,21 @@ -{ lib, fetchFromGitHub, buildGoPackage }: +{ lib, fetchFromGitHub, buildGoModule }: -buildGoPackage rec { +buildGoModule rec { pname = "kt"; - version = "12.1.0"; + version = "13.1.0"; src = fetchFromGitHub { owner = "fgeller"; repo = "kt"; rev = "v${version}"; - sha256 = "014q39bg88vg1xdq1bz6wj982zb148sip3a42hbrinh8qj41y4yg"; + sha256 = "sha256-1UGsiMMmAyIQZ62hNIi0uzyX2uNL03EWupIazjznqDc="; }; - goPackagePath = "github.com/fgeller/kt"; + vendorSha256 = "sha256-PeNpDro6G78KLN6B2CDhsTKamRTWQyxPJYWuuv6sUyw="; + + ldflags = [ "-s" "-w" ]; + + doCheck = false; meta = with lib; { description = "Kafka command line tool"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 723bf8e63e2a8..2b0b2d0848e86 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7790,6 +7790,12 @@ in { pysnmp = callPackage ../development/python-modules/pysnmp { }; + pysnmp-pyasn1 = callPackage ../development/python-modules/pysnmp-pyasn1 { }; + + pysnmp-pysmi = callPackage ../development/python-modules/pysnmp-pysmi { }; + + pysnmplib = callPackage ../development/python-modules/pysnmplib { }; + pysnooper = callPackage ../development/python-modules/pysnooper { }; pysnow = callPackage ../development/python-modules/pysnow { }; |