update nixos

This commit is contained in:
Gabriel Ebner 2022-05-14 12:01:32 +02:00
parent a1b116cc91
commit d5a8330136
4 changed files with 67 additions and 4 deletions

62
172622.patch Normal file
View File

@ -0,0 +1,62 @@
From b053f97b3d6284b0a945c09c9e45d1852c01fb85 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= <nix@dotlambda.de>
Date: Wed, 11 May 2022 22:52:27 +0000
Subject: [PATCH] python3Packages.notify-py: fix tests
Previously tests failed on Linux with
Cannot spawn a message bus without a machine-id
---
.../python-modules/notify-py/default.nix | 28 ++++++++++++++-----
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/pkgs/development/python-modules/notify-py/default.nix b/pkgs/development/python-modules/notify-py/default.nix
index 497b20d3df8ff..6d255424812e5 100644
--- a/pkgs/development/python-modules/notify-py/default.nix
+++ b/pkgs/development/python-modules/notify-py/default.nix
@@ -9,7 +9,8 @@
, which
, jeepney
, loguru
-, pytestCheckHook
+, pytest
+, dbus
, coreutils
}:
@@ -41,16 +42,29 @@ buildPythonPackage rec {
})
];
- propagatedBuildInputs = [ loguru ]
- ++ lib.optionals stdenv.isLinux [ jeepney ];
+ propagatedBuildInputs = [
+ loguru
+ ] ++ lib.optionals stdenv.isLinux [
+ jeepney
+ ];
- checkInputs = [ pytestCheckHook ];
+ checkInputs = [
+ pytest
+ ] ++ lib.optionals stdenv.isLinux [
+ dbus
+ ];
- # Tests search for "afplay" binary which is built in to MacOS and not available in nixpkgs
- preCheck = lib.optionalString stdenv.isDarwin ''
+ checkPhase = if stdenv.isDarwin then ''
+ # Tests search for "afplay" binary which is built in to macOS and not available in nixpkgs
mkdir $TMP/bin
ln -s ${coreutils}/bin/true $TMP/bin/afplay
- export PATH="$TMP/bin:$PATH"
+ PATH="$TMP/bin:$PATH" pytest
+ '' else if stdenv.isLinux then ''
+ dbus-run-session \
+ --config-file=${dbus.daemon}/share/dbus-1/session.conf \
+ pytest
+ '' else ''
+ pytest
'';
pythonImportsCheck = [ "notifypy" ];

View File

@ -97,6 +97,7 @@
nixpkgs.config.allowTexliveBuilds = true; nixpkgs.config.allowTexliveBuilds = true;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowUnfreePredicate = (pkg: true);
nixpkgs.config.android_sdk.accept_license = true; nixpkgs.config.android_sdk.accept_license = true;
programs.adb.enable = true; programs.adb.enable = true;

View File

@ -17,11 +17,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1651558728, "lastModified": 1652378906,
"narHash": "sha256-8HzyRnWlgZluUrVFNOfZAOlA1fghpOSezXvxhalGMUo=", "narHash": "sha256-DeV2myAMArPvyqxp0M6z30kuXb2L9SO2QXjxbbsZQyY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "cbe587c735b734405f56803e267820ee1559e6c1", "rev": "d89d7af1ba23bd8a5341d00bdd862e8e9a808f56",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -15,7 +15,7 @@
channels.nixpkgs.input = nixpkgs; channels.nixpkgs.input = nixpkgs;
channels.nixpkgs.patches = [ ]; channels.nixpkgs.patches = [ ./172622.patch ];
nix.generateRegistryFromInputs = true; nix.generateRegistryFromInputs = true;