From 8f177612b14063b644288a5a1058bf47f44b43a5 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Tue, 24 Nov 2020 00:18:18 +0100 Subject: [PATCH 1/9] nixos/wireless: fix failure with no interfaces This resolves issue #101963. When the service is started and no interface is ready yet, wpa_supplicant is being exec'd with no `-i` flags, thus failing. Once the interfaces are ready, the udev rule would fire but wouldn't restart the unit because it wasn't currently running (see systemctl(1) try-restart). The solution is to exit (with a clear error message) but always restart wpa_supplicant when the interfaces are modified. --- nixos/modules/services/networking/wpa_supplicant.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/networking/wpa_supplicant.nix b/nixos/modules/services/networking/wpa_supplicant.nix index 39513987903..3cfcb535ef5 100644 --- a/nixos/modules/services/networking/wpa_supplicant.nix +++ b/nixos/modules/services/networking/wpa_supplicant.nix @@ -233,9 +233,10 @@ in { path = [ pkgs.wpa_supplicant ]; script = '' - if [ -f /etc/wpa_supplicant.conf -a "/etc/wpa_supplicant.conf" != "${configFile}" ] - then echo >&2 "<3>/etc/wpa_supplicant.conf present but ignored. Generated ${configFile} is used instead." + if [ -f /etc/wpa_supplicant.conf -a "/etc/wpa_supplicant.conf" != "${configFile}" ]; then + echo >&2 "<3>/etc/wpa_supplicant.conf present but ignored. Generated ${configFile} is used instead." fi + iface_args="-s -u -D${cfg.driver} -c ${configFile}" ${if ifaces == [] then '' for i in $(cd /sys/class/net && echo *); do @@ -248,6 +249,10 @@ in { fi fi done + if [ -z "$args" ]; then + echo >&2 "<3>No wireless interfaces detected (yet)." + exit 1 + fi '' else '' args="${concatMapStringsSep " -N " (i: "-i${i} $iface_args") ifaces}" ''} @@ -261,7 +266,7 @@ in { # Restart wpa_supplicant when a wlan device appears or disappears. services.udev.extraRules = '' - ACTION=="add|remove", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", RUN+="/run/current-system/systemd/bin/systemctl try-restart wpa_supplicant.service" + ACTION=="add|remove", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", RUN+="/run/current-system/systemd/bin/systemctl restart wpa_supplicant.service" ''; }; From 9a714393431ad95452b8b52097f93baea643174a Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Mon, 14 Dec 2020 05:43:08 -0600 Subject: [PATCH 2/9] nixos/plasma5: test that KDED runs at startup --- nixos/tests/plasma5.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/tests/plasma5.nix b/nixos/tests/plasma5.nix index 5a603f8cbfb..7b17321e2e1 100644 --- a/nixos/tests/plasma5.nix +++ b/nixos/tests/plasma5.nix @@ -35,6 +35,9 @@ import ./make-test-python.nix ({ pkgs, ...} : machine.wait_until_succeeds("pgrep plasmashell") machine.wait_for_window("^Desktop ") + with subtest("Check that KDED is running"): + machine.succeed("pgrep kded5") + with subtest("Check that logging in has given the user ownership of devices"): machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}") From d12a819b2438a8e10524079f15ad6af51e5966ee Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Mon, 14 Dec 2020 18:25:42 -0500 Subject: [PATCH 3/9] pythonPackages.debugpy: 1.2.0 -> 1.2.1 --- pkgs/development/python-modules/debugpy/default.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/debugpy/default.nix b/pkgs/development/python-modules/debugpy/default.nix index 75a11d8cf26..beb5ba9c46b 100644 --- a/pkgs/development/python-modules/debugpy/default.nix +++ b/pkgs/development/python-modules/debugpy/default.nix @@ -4,7 +4,6 @@ , fetchFromGitHub , substituteAll , gdb -, colorama , flask , psutil , pytest-timeout @@ -18,13 +17,13 @@ buildPythonPackage rec { pname = "debugpy"; - version = "1.2.0"; + version = "1.2.1"; src = fetchFromGitHub { owner = "Microsoft"; repo = pname; rev = "v${version}"; - sha256 = "1r5w5ngipj5fgjylrmlw3jrh5y2n67n68l91sj9329549x4ww8dh"; + sha256 = "1dgjbbhy228w2zbfq5pf0hkai7742zw8mmybnzjdc9l6pw7360rq"; }; patches = [ @@ -65,7 +64,6 @@ buildPythonPackage rec { )''; checkInputs = [ - colorama flask psutil pytest-timeout From 8f66dc94a751bf212c8e6541796025bfeabb87dd Mon Sep 17 00:00:00 2001 From: Terin Stock Date: Fri, 11 Dec 2020 18:54:44 -0800 Subject: [PATCH 4/9] dockerTools: normalize arch to GOARCH Docker (via containerd) and the the OCI Image Configuration imply and suggest, respectfully, that the architecture set in images matches those of GOARCH in the Go Language document. This changeset updates the implimentation of getArch in dockerTools to return GOARCH values, to satisfy Docker. Fixes: #106695 --- nixos/tests/docker-tools.nix | 2 +- pkgs/build-support/docker/default.nix | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nixos/tests/docker-tools.nix b/nixos/tests/docker-tools.nix index 3d1e39a379c..8402ba68b72 100644 --- a/nixos/tests/docker-tools.nix +++ b/nixos/tests/docker-tools.nix @@ -245,7 +245,7 @@ import ./make-test-python.nix ({ pkgs, ... }: { "docker inspect ${pkgs.dockerTools.examples.cross.imageName} " + "| ${pkgs.jq}/bin/jq -r .[].Architecture" ).strip() - == "${if pkgs.system == "aarch64-linux" then "amd64" else "arm64v8"}" + == "${if pkgs.system == "aarch64-linux" then "amd64" else "arm64"}" ) ''; }) diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index b30ac5c7765..93c32c68a96 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -58,15 +58,15 @@ let done; ''; - # Map nixpkgs architecture to Docker notation - # Reference: https://github.com/docker-library/official-images#architectures-other-than-amd64 + # Map nixpkgs architecture to OCI recomendation + # Reference: https://github.com/opencontainers/image-spec/blob/master/config.md#properties getArch = nixSystem: { - aarch64-linux = "arm64v8"; - armv7l-linux = "arm32v7"; + aarch64-linux = "arm64"; + armv7l-linux = "arm"; x86_64-linux = "amd64"; powerpc64le-linux = "ppc64le"; - i686-linux = "i386"; - }.${nixSystem} or "Can't map Nix system ${nixSystem} to Docker architecture notation. Please check that your input and your requested build are correct or update the mapping in Nixpkgs."; + i686-linux = "386"; + }.${nixSystem} or "Can't map Nix system ${nixSystem} to Docker architecture. Please check that your input and your requested build are correct or update the mapping in Nixpkgs."; in rec { From d4b7efe5317bcd63e355cc630fa8650708c93325 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 13 Dec 2020 00:33:46 +0100 Subject: [PATCH 5/9] nixosTests.docker-tools-cross: init Not everyone has a suitable remote builder set up, so the cross-compilation tests that _include_ running the result are separate. That way, most people can run the majority of the test suite without the extra setup. --- nixos/tests/all-tests.nix | 1 + nixos/tests/docker-tools-cross.nix | 76 ++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 nixos/tests/docker-tools-cross.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 3e134c7544a..0c06e3f4424 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -91,6 +91,7 @@ in docker-edge = handleTestOn ["x86_64-linux"] ./docker-edge.nix {}; docker-registry = handleTest ./docker-registry.nix {}; docker-tools = handleTestOn ["x86_64-linux"] ./docker-tools.nix {}; + docker-tools-cross = handleTestOn ["x86_64-linux" "aarch64-linux"] ./docker-tools-cross.nix {}; docker-tools-overlay = handleTestOn ["x86_64-linux"] ./docker-tools-overlay.nix {}; documize = handleTest ./documize.nix {}; dokuwiki = handleTest ./dokuwiki.nix {}; diff --git a/nixos/tests/docker-tools-cross.nix b/nixos/tests/docker-tools-cross.nix new file mode 100644 index 00000000000..d433b5508fc --- /dev/null +++ b/nixos/tests/docker-tools-cross.nix @@ -0,0 +1,76 @@ +# Not everyone has a suitable remote builder set up, so the cross-compilation +# tests that _include_ running the result are separate. That way, most people +# can run the majority of the test suite without the extra setup. + + +import ./make-test-python.nix ({ pkgs, ... }: +let + + remoteSystem = + if pkgs.system == "aarch64-linux" + then "x86_64-linux" + else "aarch64-linux"; + + remoteCrossPkgs = import ../.. /*nixpkgs*/ { + # NOTE: This is the machine that runs the build - local from the + # 'perspective' of the build script. + localSystem = remoteSystem; + + # NOTE: Since this file can't control where the test will be _run_ we don't + # cross-compile _to_ a different system but _from_ a different system + crossSystem = pkgs.system; + }; + + hello1 = remoteCrossPkgs.dockerTools.buildImage { + name = "hello1"; + tag = "latest"; + contents = remoteCrossPkgs.hello; + }; + + hello2 = remoteCrossPkgs.dockerTools.buildLayeredImage { + name = "hello2"; + tag = "latest"; + contents = remoteCrossPkgs.hello; + }; + +in { + name = "docker-tools"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ roberth ]; + }; + + nodes = { + docker = { ... }: { + virtualisation = { + diskSize = 2048; + docker.enable = true; + }; + }; + }; + + testScript = '' + docker.wait_for_unit("sockets.target") + + with subtest("Ensure cross compiled buildImage image can run."): + docker.succeed( + "docker load --input='${hello1}'" + ) + assert "Hello, world!" in docker.succeed( + "docker run --rm ${hello1.imageName} hello", + ) + docker.succeed( + "docker rmi ${hello1.imageName}", + ) + + with subtest("Ensure cross compiled buildLayeredImage image can run."): + docker.succeed( + "docker load --input='${hello2}'" + ) + assert "Hello, world!" in docker.succeed( + "docker run --rm ${hello2.imageName} hello", + ) + docker.succeed( + "docker rmi ${hello2.imageName}", + ) + ''; +}) From 5cacf0fcecdde29b1e72d729fea0e922df29ed02 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 13 Dec 2020 00:42:31 +0100 Subject: [PATCH 6/9] dockerTools: use go.GOARCH as default arch --- pkgs/build-support/docker/default.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 93c32c68a96..276c7cd1bdb 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -58,15 +58,12 @@ let done; ''; - # Map nixpkgs architecture to OCI recomendation + # The OCI Image specification recommends that configurations use values listed + # in the Go Language document for GOARCH. # Reference: https://github.com/opencontainers/image-spec/blob/master/config.md#properties - getArch = nixSystem: { - aarch64-linux = "arm64"; - armv7l-linux = "arm"; - x86_64-linux = "amd64"; - powerpc64le-linux = "ppc64le"; - i686-linux = "386"; - }.${nixSystem} or "Can't map Nix system ${nixSystem} to Docker architecture. Please check that your input and your requested build are correct or update the mapping in Nixpkgs."; + # For the mapping from Nixpkgs system parameters to GOARCH, we can reuse the + # mapping from the go package. + defaultArch = go.GOARCH; in rec { @@ -84,7 +81,7 @@ rec { , imageDigest , sha256 , os ? "linux" - , arch ? getArch system + , arch ? defaultArch # This is used to set name to the pulled image , finalImageName ? imageName @@ -500,7 +497,7 @@ rec { baseJson = let pure = writeText "${baseName}-config.json" (builtins.toJSON { inherit created config; - architecture = getArch system; + architecture = defaultArch; os = "linux"; }); impure = runCommand "${baseName}-config.json" @@ -754,7 +751,7 @@ rec { streamScript = writePython3 "stream" {} ./stream_layered_image.py; baseJson = writeText "${name}-base.json" (builtins.toJSON { inherit config; - architecture = getArch system; + architecture = defaultArch; os = "linux"; }); From c5d2491fd1fe5573a47d14707535d265d7af0a26 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Sun, 23 Aug 2020 14:27:55 +0200 Subject: [PATCH 7/9] utf8proc: enable tests For the current version normtest and graphemetest are disabled. This will probably change in the future. Those tests are problematic because they depend on unicode data files which are downloaded by cmake at build time: file(MAKE_DIRECTORY data) set(UNICODE_VERSION 13.0.0) file(DOWNLOAD https://www.unicode.org/Public/${UNICODE_VERSION}/ucd/NormalizationTest.txt data/NormalizationTest.txt SHOW_PROGRESS) file(DOWNLOAD https://www.unicode.org/Public/${UNICODE_VERSION}/ucd/auxiliary/GraphemeBreakTest.txt data/GraphemeBreakTest.txt SHOW_PROGRESS) For the next update, we'll probably need to patch out this section of CMakeLists.txt and download the files in question with fetchurl ourselves. --- pkgs/development/libraries/utf8proc/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/libraries/utf8proc/default.nix b/pkgs/development/libraries/utf8proc/default.nix index 05b23e25aff..3f8f47793a4 100644 --- a/pkgs/development/libraries/utf8proc/default.nix +++ b/pkgs/development/libraries/utf8proc/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" + "-DUTF8PROC_ENABLE_TESTING=ON" + "-DCMAKE_SKIP_BUILD_RPATH=OFF" ]; # the pkg-config file is not created in the cmake installation @@ -23,6 +25,8 @@ stdenv.mkDerivation rec { preConfigure = "make libutf8proc.pc prefix=$out"; postInstall = "install -Dm644 ../libutf8proc.pc -t $out/lib/pkgconfig/"; + doCheck = true; + meta = with stdenv.lib; { description = "A clean C library for processing UTF-8 Unicode data"; homepage = "https://juliastrings.github.io/utf8proc/"; From b65b04d4ffc39686c4c2cc82d06765c5c835cd29 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Mon, 23 Nov 2020 19:23:34 +0100 Subject: [PATCH 8/9] wezterm: initial package --- .../terminal-emulators/wezterm/default.nix | 85 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 87 insertions(+) create mode 100644 pkgs/applications/terminal-emulators/wezterm/default.nix diff --git a/pkgs/applications/terminal-emulators/wezterm/default.nix b/pkgs/applications/terminal-emulators/wezterm/default.nix new file mode 100644 index 00000000000..7a0cf13b0c7 --- /dev/null +++ b/pkgs/applications/terminal-emulators/wezterm/default.nix @@ -0,0 +1,85 @@ +{ rustPlatform +, lib +, fetchFromGitHub + +, pkg-config +, fontconfig +, python3 +, openssl +, perl + +, dbus +, libX11 +, xcbutil +, libxcb +, xcbutilkeysyms +, xcbutilwm # contains xcb-ewmh among others +, libxkbcommon +, libglvnd # libEGL.so.1 +, egl-wayland +, wayland +, libGLU +, libGL +, freetype +, zlib +}: +let + runtimeDeps = [ + libX11 + xcbutil + libxcb + xcbutilkeysyms + xcbutilwm + libxkbcommon + dbus + libglvnd + zlib + egl-wayland + wayland + libGLU + libGL + fontconfig + freetype + ]; + pname = "wezterm"; +in + +rustPlatform.buildRustPackage { + inherit pname; + version = "unstable-2020-11-22"; + + src = fetchFromGitHub { + owner = "wez"; + repo = pname; + rev = "3bd8d8c84591f4d015ff9a47ddb478e55c231fda"; + sha256 = "13xf3685kir4p159hsxrqkj9p2lwgfp0n13h9zadslrd44l8b8j8"; + }; + cargoSha256 = "1i983ix7kdq7kd1i14kk3ra7jiihrd7n4pxmfifbj48g3kyxn2pq"; + + nativeBuildInputs = [ + pkg-config + python3 + openssl.dev + perl + ]; + + buildInputs = runtimeDeps; + + installPhase = '' + for artifact in wezterm wezterm-gui wezterm-mux-server strip-ansi-escapes; do + patchelf --set-rpath "${lib.makeLibraryPath runtimeDeps}" $releaseDir/$artifact + install -D $releaseDir/$artifact -t $out/bin + done + ''; + + # prevent further changes to the RPATH + dontPatchELF = true; + + meta = with lib; { + description = "A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust"; + homepage = "https://wezfurlong.org/wezterm"; + license = licenses.mit; + maintainers = with maintainers; [ steveej ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8d861c49469..9e336517b32 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -801,6 +801,8 @@ in wayst = callPackage ../applications/terminal-emulators/wayst { }; + wezterm = callPackage ../applications/terminal-emulators/wezterm { }; + x3270 = callPackage ../applications/terminal-emulators/x3270 { }; xterm = callPackage ../applications/terminal-emulators/xterm { }; From b75e7f4b20d0d03f4a01780ec2504cf27303aefd Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Wed, 25 Nov 2020 21:57:52 +0100 Subject: [PATCH 9/9] fixup! wezterm: initial package --- pkgs/applications/terminal-emulators/wezterm/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/terminal-emulators/wezterm/default.nix b/pkgs/applications/terminal-emulators/wezterm/default.nix index 7a0cf13b0c7..35b2500c7c9 100644 --- a/pkgs/applications/terminal-emulators/wezterm/default.nix +++ b/pkgs/applications/terminal-emulators/wezterm/default.nix @@ -53,8 +53,9 @@ rustPlatform.buildRustPackage { repo = pname; rev = "3bd8d8c84591f4d015ff9a47ddb478e55c231fda"; sha256 = "13xf3685kir4p159hsxrqkj9p2lwgfp0n13h9zadslrd44l8b8j8"; + fetchSubmodules = true; }; - cargoSha256 = "1i983ix7kdq7kd1i14kk3ra7jiihrd7n4pxmfifbj48g3kyxn2pq"; + cargoSha256 = "1ghjpyd3f5dqi6bblr6d2lihdschpyj5djfd1600hvb41x75lmhx"; nativeBuildInputs = [ pkg-config