From 8e016023f865b6feb3cff4fac39c5e2315033074 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sat, 27 Feb 2021 16:18:32 +0100 Subject: [PATCH 1/9] nixos/acpid: clean up the module - Use --netlink to avoid systemd-udev-settle[1] - Run daemon in foreground which is preferred with systemd - Add unit documentation - Write ExecStart directly, no need for a script [1]: https://github.com/archlinux/svntogit-community/commit/52bbd2b80bea968ce95fbc52e80c5afddb771337 --- nixos/modules/services/hardware/acpid.nix | 31 +++++++++++------------ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/nixos/modules/services/hardware/acpid.nix b/nixos/modules/services/hardware/acpid.nix index 4c97485d972..3e619fe32ef 100644 --- a/nixos/modules/services/hardware/acpid.nix +++ b/nixos/modules/services/hardware/acpid.nix @@ -3,21 +3,22 @@ with lib; let + cfg = config.services.acpid; canonicalHandlers = { powerEvent = { event = "button/power.*"; - action = config.services.acpid.powerEventCommands; + action = cfg.powerEventCommands; }; lidEvent = { event = "button/lid.*"; - action = config.services.acpid.lidEventCommands; + action = cfg.lidEventCommands; }; acEvent = { event = "ac_adapter.*"; - action = config.services.acpid.acEventCommands; + action = cfg.acEventCommands; }; }; @@ -33,7 +34,7 @@ let echo "event=${handler.event}" > $fn echo "action=${pkgs.writeShellScriptBin "${name}.sh" handler.action }/bin/${name}.sh '%e'" >> $fn ''; - in concatStringsSep "\n" (mapAttrsToList f (canonicalHandlers // config.services.acpid.handlers)) + in concatStringsSep "\n" (mapAttrsToList f (canonicalHandlers // cfg.handlers)) } ''; @@ -47,11 +48,7 @@ in services.acpid = { - enable = mkOption { - type = types.bool; - default = false; - description = "Whether to enable the ACPI daemon."; - }; + enable = mkEnableOption "the ACPI daemon"; logEvents = mkOption { type = types.bool; @@ -129,26 +126,28 @@ in ###### implementation - config = mkIf config.services.acpid.enable { + config = mkIf cfg.enable { systemd.services.acpid = { description = "ACPI Daemon"; + documentation = [ "man:acpid(8)" ]; wantedBy = [ "multi-user.target" ]; - after = [ "systemd-udev-settle.service" ]; - - path = [ pkgs.acpid ]; serviceConfig = { - Type = "forking"; + ExecStart = escapeShellArgs + ([ "${pkgs.acpid}/bin/acpid" + "--foreground" + "--netlink" + "--confdir" "${acpiConfDir}" + ] ++ optional cfg.logEvents "--logevents" + ); }; - unitConfig = { ConditionVirtualization = "!systemd-nspawn"; ConditionPathExists = [ "/proc/acpi" ]; }; - script = "acpid ${optionalString config.services.acpid.logEvents "--logevents"} --confdir ${acpiConfDir}"; }; }; From b26297344aa5aa80513a4f4689b159cab5ab73c2 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sun, 28 Feb 2021 01:28:51 +0000 Subject: [PATCH 2/9] python37Packages.alerta: 8.3.0 -> 8.4.0 --- pkgs/development/python-modules/alerta/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/alerta/default.nix b/pkgs/development/python-modules/alerta/default.nix index e69503777d4..ad80f62db05 100644 --- a/pkgs/development/python-modules/alerta/default.nix +++ b/pkgs/development/python-modules/alerta/default.nix @@ -4,11 +4,11 @@ buildPythonPackage rec { pname = "alerta"; - version = "8.3.0"; + version = "8.4.0"; src = fetchPypi { inherit pname version; - sha256 = "83c7d751bad0cb9bd7886700da4cd83c5451b2e8eb8d4cc697966e02d6a565f8"; + sha256 = "260ff3118e73396104129928217b0f317ac5afdff8221874d8986df22ecf5f34"; }; propagatedBuildInputs = [ six click requests requests-hawk pytz tabulate ]; From 196b4ead1d3b064cf3bc94c06ffb790662e1c608 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sun, 28 Feb 2021 05:47:21 +0000 Subject: [PATCH 3/9] python37Packages.identify: 1.5.14 -> 1.6.1 --- pkgs/development/python-modules/identify/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/identify/default.nix b/pkgs/development/python-modules/identify/default.nix index 110c28ee2f4..7da30166eda 100644 --- a/pkgs/development/python-modules/identify/default.nix +++ b/pkgs/development/python-modules/identify/default.nix @@ -2,11 +2,11 @@ buildPythonPackage rec { pname = "identify"; - version = "1.5.14"; + version = "1.6.1"; src = fetchPypi { inherit pname version; - sha256 = "de7129142a5c86d75a52b96f394d94d96d497881d2aaf8eafe320cdbe8ac4bcc"; + sha256 = "7b435803dc79a0f0ce887887a62ad360f3a9e8162ac0db9ee649d5d24085bf30"; }; pythonImportsCheck = [ "identify" ]; From 627f2b5b9c80e726a0bb5c536e7995a94ddaa223 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sun, 28 Feb 2021 07:40:36 +0000 Subject: [PATCH 4/9] adoptopenjdk-icedtea-web: 1.8.5 -> 1.8.6 --- .../compilers/adoptopenjdk-icedtea-web/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/adoptopenjdk-icedtea-web/default.nix b/pkgs/development/compilers/adoptopenjdk-icedtea-web/default.nix index efc94e4baf4..d062c8605b6 100644 --- a/pkgs/development/compilers/adoptopenjdk-icedtea-web/default.nix +++ b/pkgs/development/compilers/adoptopenjdk-icedtea-web/default.nix @@ -3,13 +3,13 @@ stdenv.mkDerivation rec { pname = "adoptopenjdk-icedtea-web"; - version = "1.8.5"; + version = "1.8.6"; src = fetchFromGitHub { owner = "AdoptOpenJDK"; repo = "IcedTea-Web"; rev = "icedtea-web-${version}"; - sha256 = "sha256-AC6D6n8jLdATXIXrDTHhs2QFnIZNaaZvJyFEqfxCxYQ="; + sha256 = "sha256-meqbFLGwCMpFoOVAfvtriRAS8ZWr374eSN3m0CdC2aM="; }; nativeBuildInputs = [ autoreconfHook pkg-config bc ]; From df3d5609998e47a98138259816a0db774d901189 Mon Sep 17 00:00:00 2001 From: Milan Svoboda Date: Wed, 30 Dec 2020 11:59:20 +0100 Subject: [PATCH 5/9] nixos/nix-gc: add persistent and randomizeDelaySec options --- nixos/doc/manual/release-notes/rl-2105.xml | 7 +++ nixos/modules/services/misc/nix-gc.nix | 55 ++++++++++++++++++---- 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2105.xml b/nixos/doc/manual/release-notes/rl-2105.xml index e03142d3d04..6a0eb13eac9 100644 --- a/nixos/doc/manual/release-notes/rl-2105.xml +++ b/nixos/doc/manual/release-notes/rl-2105.xml @@ -738,6 +738,13 @@ self: super: terminology has been deprecated and should be replaced with Far/Near in the configuration file. + + + The nix-gc service now accepts randomizedDelaySec (default: 0) and persistent (default: true) parameters. + By default nix-gc will now run immediately if it would have been triggered at least + once during the time when the timer was inactive. + + diff --git a/nixos/modules/services/misc/nix-gc.nix b/nixos/modules/services/misc/nix-gc.nix index 12bed05757a..a7a6a3b5964 100644 --- a/nixos/modules/services/misc/nix-gc.nix +++ b/nixos/modules/services/misc/nix-gc.nix @@ -21,13 +21,45 @@ in }; dates = mkOption { - default = "03:15"; type = types.str; + default = "03:15"; + example = "weekly"; description = '' - Specification (in the format described by + How often or when garbage collection is performed. For most desktop and server systems + a sufficient garbage collection is once a week. + + The format is described in systemd.time - 7) of the time at - which the garbage collector will run. + 7. + ''; + }; + + randomizedDelaySec = mkOption { + default = "0"; + type = types.str; + example = "45min"; + description = '' + Add a randomized delay before each automatic upgrade. + The delay will be chosen between zero and this value. + This value must be a time span in the format specified by + systemd.time + 7 + ''; + }; + + 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. ''; }; @@ -50,11 +82,18 @@ in config = { - systemd.services.nix-gc = - { description = "Nix Garbage Collector"; - script = "exec ${config.nix.package.out}/bin/nix-collect-garbage ${cfg.options}"; - startAt = optional cfg.automatic cfg.dates; + systemd.services.nix-gc = { + description = "Nix Garbage Collector"; + script = "exec ${config.nix.package.out}/bin/nix-collect-garbage ${cfg.options}"; + startAt = optional cfg.automatic cfg.dates; + }; + + systemd.timers.nix-gc = lib.mkIf cfg.automatic { + timerConfig = { + RandomizedDelaySec = cfg.randomizedDelaySec; + Persistent = cfg.persistent; }; + }; }; From e8909c77f6d1386de4fcbc7018991fdb2ef83155 Mon Sep 17 00:00:00 2001 From: toastal Date: Sun, 28 Feb 2021 15:40:10 +0700 Subject: [PATCH 6/9] =?UTF-8?q?julia-mono=200.022=20=E2=86=92=200.034?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/data/fonts/julia-mono/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/data/fonts/julia-mono/default.nix b/pkgs/data/fonts/julia-mono/default.nix index 8774913c83c..bf2fbe256fa 100644 --- a/pkgs/data/fonts/julia-mono/default.nix +++ b/pkgs/data/fonts/julia-mono/default.nix @@ -1,11 +1,12 @@ { lib, fetchzip }: let - version = "0.022"; + version = "0.034"; + in fetchzip { name = "JuliaMono-${version}"; url = "https://github.com/cormullion/juliamono/releases/download/v${version}/JuliaMono.zip"; - sha256 = "sha256-/MVT6n842sSiuPZNYxN3q1vn6yvMvmcTEDyvAd2GikA="; + sha256 = "sha256:0xx3mhzs17baaich67kvwyzqg8h9ga11jrja2i8sxx4861dp1z85"; postFetch = '' mkdir -p $out/share/fonts/truetype @@ -14,9 +15,12 @@ in fetchzip { meta = { description = "A monospaced font for scientific and technical computing"; + longDescription = '' + JuliaMono is a monospaced typeface designed for use in text editing environments that require a wide range of specialist and technical Unicode characters. It was intended as a fun experiment to be presented at the 2020 JuliaCon conference in Lisbon, Portugal (which of course didn’t physically happen in Lisbon, but online). + ''; maintainers = with lib.maintainers; [ suhr ]; platforms = with lib.platforms; all; - homepage = "https://juliamono.netlify.app/"; + homepage = "https://cormullion.github.io/pages/2020-07-26-JuliaMono/"; license = lib.licenses.ofl; }; } From d0328678e91b1bb89d6a184c63bc3f21f81dbfe2 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 27 Feb 2021 21:29:26 +0100 Subject: [PATCH 7/9] ocamlPackages.ocaml-migrate-parsetree-2-1: use Dune 2 --- .../development/ocaml-modules/ocaml-migrate-parsetree/2.1.x.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/2.1.x.nix b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/2.1.x.nix index afe3d34963a..ca88fe32416 100644 --- a/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/2.1.x.nix +++ b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/2.1.x.nix @@ -4,6 +4,8 @@ buildDunePackage rec { pname = "ocaml-migrate-parsetree"; version = "2.1.0"; + useDune2 = true; + minimumOCamlVersion = "4.02"; src = fetchurl { From 5a0fc991018d7015e102ecffd3e142da631e7fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 28 Feb 2021 12:36:57 +0100 Subject: [PATCH 8/9] python3Packages.pygraphviz: 1.6 -> 1.7 (#113040) --- .../python-modules/pygraphviz/default.nix | 42 +++++++++++-------- .../pygraphviz/graphviz-path.patch | 13 ------ .../python-modules/pygraphviz/path.patch | 13 ++++++ 3 files changed, 38 insertions(+), 30 deletions(-) delete mode 100644 pkgs/development/python-modules/pygraphviz/graphviz-path.patch create mode 100644 pkgs/development/python-modules/pygraphviz/path.patch diff --git a/pkgs/development/python-modules/pygraphviz/default.nix b/pkgs/development/python-modules/pygraphviz/default.nix index e9b66a95771..bac70be9987 100644 --- a/pkgs/development/python-modules/pygraphviz/default.nix +++ b/pkgs/development/python-modules/pygraphviz/default.nix @@ -1,40 +1,48 @@ -{ lib, buildPythonPackage, isPy3k, fetchPypi, substituteAll, graphviz -, pkg-config, doctest-ignore-unicode, mock, nose }: +{ lib +, buildPythonPackage +, isPy3k +, fetchPypi +, substituteAll +, graphviz +, coreutils +, pkg-config +, pytest +}: buildPythonPackage rec { pname = "pygraphviz"; - version = "1.6"; + version = "1.7"; disabled = !isPy3k; src = fetchPypi { inherit pname version; - sha256 = "411ae84a5bc313e3e1523a1cace59159f512336318a510573b47f824edef8860"; + sha256 = "a7bec6609f37cf1e64898c59f075afd659106cf9356c5f387cecaa2e0cdb2304"; extension = "zip"; }; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ graphviz ]; - checkInputs = [ doctest-ignore-unicode mock nose ]; - patches = [ - # pygraphviz depends on graphviz being in PATH. This patch always prepends - # graphviz to PATH. + # pygraphviz depends on graphviz executables and wc being in PATH (substituteAll { - src = ./graphviz-path.patch; - inherit graphviz; + src = ./path.patch; + path = lib.makeBinPath [ graphviz coreutils ]; }) ]; - # The tests are currently failing because of a bug in graphviz 2.40.1. - # Upstream does not want to skip the relevant tests: - # https://github.com/pygraphviz/pygraphviz/pull/129 - doCheck = false; + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ graphviz ]; + + checkInputs = [ pytest ]; + + checkPhase = '' + pytest --pyargs pygraphviz + ''; meta = with lib; { description = "Python interface to Graphviz graph drawing package"; homepage = "https://github.com/pygraphviz/pygraphviz"; license = licenses.bsd3; - maintainers = with maintainers; [ matthiasbeyer ]; + maintainers = with maintainers; [ matthiasbeyer dotlambda ]; }; } diff --git a/pkgs/development/python-modules/pygraphviz/graphviz-path.patch b/pkgs/development/python-modules/pygraphviz/graphviz-path.patch deleted file mode 100644 index e4ff925009d..00000000000 --- a/pkgs/development/python-modules/pygraphviz/graphviz-path.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/pygraphviz/agraph.py b/pygraphviz/agraph.py -index 8f72024..2d8358e 100644 ---- a/pygraphviz/agraph.py -+++ b/pygraphviz/agraph.py -@@ -1557,7 +1557,7 @@ class AGraph(object): - import os - import glob - -- paths = os.environ["PATH"] -+ paths = '@graphviz@/bin:' + os.environ["PATH"] - if os.name == "nt": - exe = ".exe" - else: diff --git a/pkgs/development/python-modules/pygraphviz/path.patch b/pkgs/development/python-modules/pygraphviz/path.patch new file mode 100644 index 00000000000..a895eae7756 --- /dev/null +++ b/pkgs/development/python-modules/pygraphviz/path.patch @@ -0,0 +1,13 @@ +diff --git a/pygraphviz/agraph.py b/pygraphviz/agraph.py +index d539ba0..f5bac3f 100644 +--- a/pygraphviz/agraph.py ++++ b/pygraphviz/agraph.py +@@ -1792,7 +1792,7 @@ class AGraph: + if platform.system() == "Windows": + name += ".exe" + +- paths = os.environ["PATH"] ++ paths = '@path@' + for path in paths.split(os.pathsep): + match = glob.glob(os.path.join(path, name)) + if match: From d6876bc87971f3ad66ee1e3e7f773f6f6a2fcb3e Mon Sep 17 00:00:00 2001 From: Pavel Borzenkov Date: Sun, 28 Feb 2021 15:05:26 +0300 Subject: [PATCH 9/9] google-cloud-sdk: fix searching for cloud_sql_proxy on the PATH (#114488) 'gcloud sql connect' command allows to connect to a CloudSQL instance from a local machine. In order to do so, it starts local 'cloud_sdk_proxy' instance. google-cloud-sdk expects to find one in SDK root (installed by 'gcloud components') or on the PATH, if SDK is not correctly installed ('.install' directory is missing). Since google-cloud-sdk on NixOS is properly installed 'gcloud sql connect' never looks for 'cloud_sql_proxy' on the PATH and simply doesn't work at all. The patch slightly modifies the check by looking not only for '.install' directory, but for actual 'cloud_sql_proxy' binary before falling back to the search on the PATH. With this patch it's now possible to use 'gcloud sql connect' on NixOS, provided that 'cloud_sql_proxy' is available either in user or system enviroment (available in nixpkgs). --- .../cloud_sql_proxy_path.patch | 36 +++++++++++++++++++ pkgs/tools/admin/google-cloud-sdk/default.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/tools/admin/google-cloud-sdk/cloud_sql_proxy_path.patch diff --git a/pkgs/tools/admin/google-cloud-sdk/cloud_sql_proxy_path.patch b/pkgs/tools/admin/google-cloud-sdk/cloud_sql_proxy_path.patch new file mode 100644 index 00000000000..aec4be2ec19 --- /dev/null +++ b/pkgs/tools/admin/google-cloud-sdk/cloud_sql_proxy_path.patch @@ -0,0 +1,36 @@ +diff --git a/lib/googlecloudsdk/api_lib/sql/instances.py b/lib/googlecloudsdk/api_lib/sql/instances.py +index 0d88ffe..814a436 100644 +--- a/lib/googlecloudsdk/api_lib/sql/instances.py ++++ b/lib/googlecloudsdk/api_lib/sql/instances.py +@@ -86,18 +86,19 @@ def GetRegionFromZone(gce_zone): + def _GetCloudSqlProxyPath(): + """Determines the path to the cloud_sql_proxy binary.""" + sdk_bin_path = config.Paths().sdk_bin_path +- if not sdk_bin_path: +- # Check if cloud_sql_proxy is located on the PATH. +- proxy_path = file_utils.FindExecutableOnPath('cloud_sql_proxy') +- if proxy_path: +- log.debug( +- 'Using cloud_sql_proxy found at [{path}]'.format(path=proxy_path)) +- return proxy_path +- else: +- raise exceptions.ToolException( +- 'A Cloud SQL Proxy SDK root could not be found. Please check your ' +- 'installation.') +- return os.path.join(sdk_bin_path, 'cloud_sql_proxy') ++ if sdk_bin_path and os.path.isfile(os.path.join(sdk_bin_path, 'cloud_sql_proxy')): ++ return os.path.join(sdk_bin_path, 'cloud_sql_proxy') ++ ++ # Check if cloud_sql_proxy is located on the PATH. ++ proxy_path = file_utils.FindExecutableOnPath('cloud_sql_proxy') ++ if proxy_path: ++ log.debug( ++ 'Using cloud_sql_proxy found at [{path}]'.format(path=proxy_path)) ++ return proxy_path ++ ++ raise exceptions.ToolException( ++ 'A Cloud SQL Proxy SDK root could not be found. Please check your ' ++ 'installation.') + + + def _RaiseProxyError(error_msg=None): diff --git a/pkgs/tools/admin/google-cloud-sdk/default.nix b/pkgs/tools/admin/google-cloud-sdk/default.nix index 644bdedffe5..1d585514f7e 100644 --- a/pkgs/tools/admin/google-cloud-sdk/default.nix +++ b/pkgs/tools/admin/google-cloud-sdk/default.nix @@ -45,6 +45,8 @@ in stdenv.mkDerivation rec { ./gcloud-path.patch # Disable checking for updates for the package ./gsutil-disable-updates.patch + # Try to use cloud_sql_proxy from SDK only if it actually exists, otherwise, search for one in PATH + ./cloud_sql_proxy_path.patch ]; installPhase = ''