···2626Add any other context about the problem here.27272828### Notify maintainers2929+2930<!--3031Please @ people who are in the `meta.maintainers` list of the offending package or module.3132If in doubt, check `git blame` for whoever last touched something.
+6-1
.github/ISSUE_TEMPLATE/build_failure.md
···11---22name: Build failure33about: Create a report to help us improve44-title: ''44+title: 'Build failure: PACKAGENAME'55labels: '0.kind: build failure'66assignees: ''7788---991010### Steps To Reproduce1111+1112Steps to reproduce the behavior:12131. build *X*13141415### Build log1616+1517```1618log here if short otherwise a link to a gist1719```18201921### Additional context2222+2023Add any other context about the problem here.21242225### Notify maintainers2626+2327<!--2428Please @ people who are in the `meta.maintainers` list of the offending package or module.2529If in doubt, check `git blame` for whoever last touched something.2630-->27312832### Metadata3333+2934Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result.30353136```console
+5-5
.github/ISSUE_TEMPLATE/missing_documentation.md
···11---22name: Missing or incorrect documentation33about: Help us improve the Nixpkgs and NixOS reference manuals44-title: ''44+title: 'Documentation: '55labels: '9.needs: documentation'66assignees: ''77···1010## Problem11111212<!-- describe your problem -->1313+1414+## Proposal1515+1616+<!-- propose a solution (optional) -->13171418## Checklist1519···2925[nixos-source]: https://github.com/NixOS/nixpkgs/tree/master/nixos/doc/manual3026[open documentation issues]: https://github.com/NixOS/nixpkgs/issues?q=is%3Aissue+is%3Aopen+label%3A%229.needs%3A+documentation%223127[open documentation pull requests]: https://github.com/NixOS/nixpkgs/pulls?q=is%3Aopen+is%3Apr+label%3A%228.has%3A+documentation%22%2C%226.topic%3A+documentation%223232-3333-## Proposal3434-3535-<!-- propose a solution -->3628
···11---22name: Out-of-date package reports33about: For packages that are out-of-date44-title: ''44+title: 'Update request: PACKAGENAME OLDVERSION → NEWVERSION'55labels: '9.needs: package (update)'66assignees: ''7788---991010-1111-###### Checklist1212-1313-<!-- Note that these are hard requirements -->1414-1515-<!--1616-You can use the "Go to file" functionality on GitHub to find the package1717-Then you can go to the history for this package1818-Find the latest "package_name: old_version -> new_version" commit1919-The "new_version" is the current version of the package2020--->2121-- [ ] Checked the [nixpkgs master branch](https://github.com/NixOS/nixpkgs)1010+- Package name:1111+- Latest released version:1212+<!-- Search your package here: https://search.nixos.org/packages?channel=unstable -->1313+- Current version on the unstable channel:1414+- Current version on the stable/release channel:2215<!--2316Type the name of your package and try to find an open pull request for the package2417If you find an open pull request, you can review it!···1926-->2027- [ ] Checked the [nixpkgs pull requests](https://github.com/NixOS/nixpkgs/pulls)21282222-###### Project name2323-`nix search` name:2424-<!--2525-The current version can be found easily with the same process as above for checking the master branch2626-If an open PR is present for the package, take this version as the current one and link to the PR2727--->2828-current version:2929-desired version:2929+**Notify maintainers**30303131-###### Notify maintainers3232-<!--3333-Search your package here: https://search.nixos.org/packages?channel=unstable3434-If no maintainer is listed for your package, tag the person that last updated the package3535--->3131+<!-- If the search.nixos.org result shows no maintainers, tag the person that last updated the package. -->36323737-maintainers:3333+-----38343939-###### Note for maintainers4040-4141-Please tag this issue in your PR.3535+Note for maintainers: Please tag this issue in your PR.
+3-2
.github/ISSUE_TEMPLATE/packaging_request.md
···11---22name: Packaging requests33about: For packages that are missing44-title: ''44+title: 'Package request: PACKAGENAME'55labels: '0.kind: packaging request'66assignees: ''7788---991010**Project description**1111-_describe the project a little_1111+1212+<!-- Describe the project a little: -->12131314**Metadata**1415
···626626627627### The check phase {#ssec-check-phase}628628629629-The check phase checks whether the package was built correctly by running its test suite. The default `checkPhase` calls `make $checkTarget`, but only if the `doCheck` variable is enabled (see below).629629+The check phase checks whether the package was built correctly by running its test suite. The default `checkPhase` calls `make $checkTarget`, but only if the [`doCheck` variable](#var-stdenv-doCheck) is enabled.630630631631#### Variables controlling the check phase {#variables-controlling-the-check-phase}632632···646646647647##### `checkTarget` {#var-stdenv-checkTarget}648648649649-The make target that runs the tests. Defaults to `check` if it exists, otherwise `test`; if neither is found, do nothing.649649+The `make` target that runs the tests.650650+If unset, use `check` if it exists, otherwise `test`; if neither is found, do nothing.650651651652##### `checkFlags` / `checkFlagsArray` {#var-stdenv-checkFlags}652653
···4455 inherit (builtins)66 isString77+ isPath78 split89 match910 ;···24232524 inherit (lib.asserts)2625 assertMsg2626+ ;2727+2828+ inherit (lib.path.subpath)2929+ isValid2730 ;28312932 # Return the reason why a subpath is invalid, or `null` if it's valid···999410095in /* No rec! Add dependencies on this file at the top. */ {101969797+ /* Append a subpath string to a path.9898+9999+ Like `path + ("/" + string)` but safer, because it errors instead of returning potentially surprising results.100100+ More specifically, it checks that the first argument is a [path value type](https://nixos.org/manual/nix/stable/language/values.html#type-path"),101101+ and that the second argument is a valid subpath string (see `lib.path.subpath.isValid`).102102+103103+ Type:104104+ append :: Path -> String -> Path105105+106106+ Example:107107+ append /foo "bar/baz"108108+ => /foo/bar/baz109109+110110+ # subpaths don't need to be normalised111111+ append /foo "./bar//baz/./"112112+ => /foo/bar/baz113113+114114+ # can append to root directory115115+ append /. "foo/bar"116116+ => /foo/bar117117+118118+ # first argument needs to be a path value type119119+ append "/foo" "bar"120120+ => <error>121121+122122+ # second argument needs to be a valid subpath string123123+ append /foo /bar124124+ => <error>125125+ append /foo ""126126+ => <error>127127+ append /foo "/bar"128128+ => <error>129129+ append /foo "../bar"130130+ => <error>131131+ */132132+ append =133133+ # The absolute path to append to134134+ path:135135+ # The subpath string to append136136+ subpath:137137+ assert assertMsg (isPath path) ''138138+ lib.path.append: The first argument is of type ${builtins.typeOf path}, but a path was expected'';139139+ assert assertMsg (isValid subpath) ''140140+ lib.path.append: Second argument is not a valid subpath string:141141+ ${subpathInvalidReason subpath}'';142142+ path + ("/" + subpath);102143103144 /* Whether a value is a valid subpath string.104145···184133 subpath.isValid "./foo//bar/"185134 => true186135 */187187- subpath.isValid = value:136136+ subpath.isValid =137137+ # The value to check138138+ value:188139 subpathInvalidReason value == null;189140190141···203150204151 Laws:205152206206- - (Idempotency) Normalising multiple times gives the same result:153153+ - Idempotency - normalising multiple times gives the same result:207154208155 subpath.normalise (subpath.normalise p) == subpath.normalise p209156210210- - (Uniqueness) There's only a single normalisation for the paths that lead to the same file system node:157157+ - Uniqueness - there's only a single normalisation for the paths that lead to the same file system node:211158212159 subpath.normalise p != subpath.normalise q -> $(realpath ${p}) != $(realpath ${q})213160···263210 subpath.normalise "/foo"264211 => <error>265212 */266266- subpath.normalise = path:267267- assert assertMsg (subpathInvalidReason path == null)268268- "lib.path.subpath.normalise: Argument is not a valid subpath string: ${subpathInvalidReason path}";269269- joinRelPath (splitRelPath path);213213+ subpath.normalise =214214+ # The subpath string to normalise215215+ subpath:216216+ assert assertMsg (isValid subpath) ''217217+ lib.path.subpath.normalise: Argument is not a valid subpath string:218218+ ${subpathInvalidReason subpath}'';219219+ joinRelPath (splitRelPath subpath);270220271221}
···5454$ xfconf-query -c xfce4-session -p /compat/LaunchGNOME -s true5555```56565757-A log-out and re-log will be needed for this to take effect.5757+It is necessary to log out and log in again for this to take effect.
···6363$ xfconf-query -c xfce4-session -p /compat/LaunchGNOME -s true6464</programlisting>6565 <para>6666- A log-out and re-log will be needed for this to take effect.6666+ It is necessary to log out and log in again for this to take6767+ effect.6768 </para>6869 </section>6970</chapter>
+26-24
nixos/lib/test-driver/test_driver/machine.py
···11-from contextlib import _GeneratorContextManager11+from contextlib import _GeneratorContextManager, nullcontext22from pathlib import Path33from queue import Queue44from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple···406406 return rootlog.nested(msg, my_attrs)407407408408 def wait_for_monitor_prompt(self) -> str:409409- with self.nested("waiting for monitor prompt"):410410- assert self.monitor is not None411411- answer = ""412412- while True:413413- undecoded_answer = self.monitor.recv(1024)414414- if not undecoded_answer:415415- break416416- answer += undecoded_answer.decode()417417- if answer.endswith("(qemu) "):418418- break419419- return answer409409+ assert self.monitor is not None410410+ answer = ""411411+ while True:412412+ undecoded_answer = self.monitor.recv(1024)413413+ if not undecoded_answer:414414+ break415415+ answer += undecoded_answer.decode()416416+ if answer.endswith("(qemu) "):417417+ break418418+ return answer420419421420 def send_monitor_command(self, command: str) -> str:422421 self.run_callbacks()423423- with self.nested(f"sending monitor command: {command}"):424424- message = f"{command}\n".encode()425425- assert self.monitor is not None426426- self.monitor.send(message)427427- return self.wait_for_monitor_prompt()422422+ message = f"{command}\n".encode()423423+ assert self.monitor is not None424424+ self.monitor.send(message)425425+ return self.wait_for_monitor_prompt()428426429427 def wait_for_unit(430428 self, unit: str, user: Optional[str] = None, timeout: int = 900···545547 self.shell.send("echo ${PIPESTATUS[0]}\n".encode())546548 rc = int(self._next_newline_closed_block_from_shell().strip())547549548548- return (rc, output.decode())550550+ return (rc, output.decode(errors="replace"))549551550552 def shell_interact(self, address: Optional[str] = None) -> None:551553 """Allows you to interact with the guest shell for debugging purposes.···683685 retry(tty_matches)684686685687 def send_chars(self, chars: str, delay: Optional[float] = 0.01) -> None:686686- with self.nested(f"sending keys '{chars}'"):688688+ with self.nested(f"sending keys {repr(chars)}"):687689 for char in chars:688688- self.send_key(char, delay)690690+ self.send_key(char, delay, log=False)689691690692 def wait_for_file(self, filename: str) -> None:691693 """Waits until the file exists in machine's file system."""···858860 if matches is not None:859861 return860862861861- def send_key(self, key: str, delay: Optional[float] = 0.01) -> None:863863+ def send_key(864864+ self, key: str, delay: Optional[float] = 0.01, log: Optional[bool] = True865865+ ) -> None:862866 key = CHAR_TO_KEY.get(key, key)863863- self.send_monitor_command(f"sendkey {key}")864864- if delay is not None:865865- time.sleep(delay)867867+ context = self.nested(f"sending key {repr(key)}") if log else nullcontext()868868+ with context:869869+ self.send_monitor_command(f"sendkey {key}")870870+ if delay is not None:871871+ time.sleep(delay)866872867873 def send_console(self, chars: str) -> None:868874 assert self.process
+99-20
nixos/modules/hardware/video/nvidia.nix
···2121 pCfg = cfg.prime;2222 syncCfg = pCfg.sync;2323 offloadCfg = pCfg.offload;2424- primeEnabled = syncCfg.enable || offloadCfg.enable;2424+ reverseSyncCfg = pCfg.reverseSync;2525+ primeEnabled = syncCfg.enable || reverseSyncCfg.enable || offloadCfg.enable;2526 nvidiaPersistencedEnabled = cfg.nvidiaPersistenced;2627 nvidiaSettings = cfg.nvidiaSettings;2728 busIDType = types.strMatching "([[:print:]]+[\:\@][0-9]{1,3}\:[0-9]{1,2}\:[0-9])?";···3231 imports =3332 [3433 (mkRenamedOptionModule [ "hardware" "nvidia" "optimus_prime" "enable" ] [ "hardware" "nvidia" "prime" "sync" "enable" ])3535- (mkRenamedOptionModule [ "hardware" "nvidia" "optimus_prime" "allowExternalGpu" ] [ "hardware" "nvidia" "prime" "sync" "allowExternalGpu" ])3434+ (mkRenamedOptionModule [ "hardware" "nvidia" "optimus_prime" "allowExternalGpu" ] [ "hardware" "nvidia" "prime" "allowExternalGpu" ])3535+ (mkRenamedOptionModule [ "hardware" "nvidia" "prime" "sync" "allowExternalGpu" ] [ "hardware" "nvidia" "prime" "allowExternalGpu" ])3636 (mkRenamedOptionModule [ "hardware" "nvidia" "optimus_prime" "nvidiaBusId" ] [ "hardware" "nvidia" "prime" "nvidiaBusId" ])3737 (mkRenamedOptionModule [ "hardware" "nvidia" "optimus_prime" "intelBusId" ] [ "hardware" "nvidia" "prime" "intelBusId" ])3838 ];···106104 description = lib.mdDoc ''107105 Enable NVIDIA Optimus support using the NVIDIA proprietary driver via PRIME.108106 If enabled, the NVIDIA GPU will be always on and used for all rendering,109109- while enabling output to displays attached only to the integrated Intel GPU110110- without a multiplexer.107107+ while enabling output to displays attached only to the integrated Intel/AMD108108+ GPU without a multiplexer.111109112110 Note that this option only has any effect if the "nvidia" driver is specified113111 in {option}`services.xserver.videoDrivers`, and it should preferably114112 be the only driver there.115113116116- If this is enabled, then the bus IDs of the NVIDIA and Intel GPUs have to be117117- specified ({option}`hardware.nvidia.prime.nvidiaBusId` and118118- {option}`hardware.nvidia.prime.intelBusId`).114114+ If this is enabled, then the bus IDs of the NVIDIA and Intel/AMD GPUs have to115115+ be specified ({option}`hardware.nvidia.prime.nvidiaBusId` and116116+ {option}`hardware.nvidia.prime.intelBusId` or117117+ {option}`hardware.nvidia.prime.amdgpuBusId`).119118120119 If you enable this, you may want to also enable kernel modesetting for the121120 NVIDIA driver ({option}`hardware.nvidia.modesetting.enable`) in order···128125 '';129126 };130127131131- hardware.nvidia.prime.sync.allowExternalGpu = mkOption {128128+ hardware.nvidia.prime.allowExternalGpu = mkOption {132129 type = types.bool;133130 default = false;134131 description = lib.mdDoc ''135135- Configure X to allow external NVIDIA GPUs when using optimus.132132+ Configure X to allow external NVIDIA GPUs when using Prime [Reverse] sync optimus.136133 '';137134 };138135···142139 description = lib.mdDoc ''143140 Enable render offload support using the NVIDIA proprietary driver via PRIME.144141145145- If this is enabled, then the bus IDs of the NVIDIA and Intel GPUs have to be146146- specified ({option}`hardware.nvidia.prime.nvidiaBusId` and147147- {option}`hardware.nvidia.prime.intelBusId`).142142+ If this is enabled, then the bus IDs of the NVIDIA and Intel/AMD GPUs have to143143+ be specified ({option}`hardware.nvidia.prime.nvidiaBusId` and144144+ {option}`hardware.nvidia.prime.intelBusId` or145145+ {option}`hardware.nvidia.prime.amdgpuBusId`).146146+ '';147147+ };148148+149149+ hardware.nvidia.prime.offload.enableOffloadCmd = mkOption {150150+ type = types.bool;151151+ default = false;152152+ description = lib.mdDoc ''153153+ Adds a `nvidia-offload` convenience script to {option}`environment.systemPackages`154154+ for offloading programs to an nvidia device. To work, should have also enabled155155+ {option}`hardware.nvidia.prime.offload.enable` or {option}`hardware.nvidia.prime.reverseSync.enable`.156156+157157+ Example usage `nvidia-offload sauerbraten_client`.158158+ '';159159+ };160160+161161+ hardware.nvidia.prime.reverseSync.enable = mkOption {162162+ type = types.bool;163163+ default = false;164164+ description = lib.mdDoc ''165165+ Warning: This feature is relatively new, depending on your system this might166166+ work poorly. AMD support, especially so.167167+ See: https://forums.developer.nvidia.com/t/the-all-new-outputsink-feature-aka-reverse-prime/129828168168+169169+ Enable NVIDIA Optimus support using the NVIDIA proprietary driver via reverse170170+ PRIME. If enabled, the Intel/AMD GPU will be used for all rendering, while171171+ enabling output to displays attached only to the NVIDIA GPU without a172172+ multiplexer.173173+174174+ Note that this option only has any effect if the "nvidia" driver is specified175175+ in {option}`services.xserver.videoDrivers`, and it should preferably176176+ be the only driver there.177177+178178+ If this is enabled, then the bus IDs of the NVIDIA and Intel/AMD GPUs have to179179+ be specified ({option}`hardware.nvidia.prime.nvidiaBusId` and180180+ {option}`hardware.nvidia.prime.intelBusId` or181181+ {option}`hardware.nvidia.prime.amdgpuBusId`).182182+183183+ If you enable this, you may want to also enable kernel modesetting for the184184+ NVIDIA driver ({option}`hardware.nvidia.modesetting.enable`) in order185185+ to prevent tearing.186186+187187+ Note that this configuration will only be successful when a display manager188188+ for which the {option}`services.xserver.displayManager.setupCommands`189189+ option is supported is used.148190 '';149191 };150192···254206 }255207256208 {209209+ assertion = offloadCfg.enableOffloadCmd -> offloadCfg.enable || reverseSyncCfg.enable;210210+ message = ''211211+ Offload command requires offloading or reverse prime sync to be enabled.212212+ '';213213+ }214214+215215+ {257216 assertion = primeEnabled -> pCfg.nvidiaBusId != "" && (pCfg.intelBusId != "" || pCfg.amdgpuBusId != "");258217 message = ''259218 When NVIDIA PRIME is enabled, the GPU bus IDs must configured.···273218 }274219275220 {221221+ assertion = (reverseSyncCfg.enable && pCfg.amdgpuBusId != "") -> versionAtLeast nvidia_x11.version "470.0";222222+ message = "NVIDIA PRIME render offload for AMD APUs is currently only supported on versions >= 470 beta.";223223+ }224224+225225+ {276226 assertion = !(syncCfg.enable && offloadCfg.enable);277277- message = "Only one NVIDIA PRIME solution may be used at a time.";227227+ message = "PRIME Sync and Offload cannot be both enabled";228228+ }229229+230230+ {231231+ assertion = !(syncCfg.enable && reverseSyncCfg.enable);232232+ message = "PRIME Sync and PRIME Reverse Sync cannot be both enabled";278233 }279234280235 {···322257 # - Configure the display manager to run specific `xrandr` commands which will323258 # configure/enable displays connected to the Intel iGPU / AMD APU.324259325325- services.xserver.drivers = let326326- in optional primeEnabled {260260+ # reverse sync implies offloading261261+ hardware.nvidia.prime.offload.enable = mkDefault reverseSyncCfg.enable;262262+263263+ services.xserver.drivers = optional primeEnabled {327264 name = igpuDriver;328265 display = offloadCfg.enable;329266 modules = optionals (igpuDriver == "amdgpu") [ pkgs.xorg.xf86videoamdgpu ];···340273 deviceSection = optionalString primeEnabled341274 ''342275 BusID "${pCfg.nvidiaBusId}"343343- ${optionalString syncCfg.allowExternalGpu "Option \"AllowExternalGpus\""}276276+ ${optionalString pCfg.allowExternalGpu "Option \"AllowExternalGpus\""}344277 '';345278 screenSection =346279 ''···357290358291 services.xserver.serverLayoutSection = optionalString syncCfg.enable ''359292 Inactive "Device-${igpuDriver}[0]"293293+ '' + optionalString reverseSyncCfg.enable ''294294+ Inactive "Device-nvidia[0]"360295 '' + optionalString offloadCfg.enable ''361296 Option "AllowNVIDIAGPUScreens"362297 '';363298364299 services.xserver.displayManager.setupCommands = let365365- sinkGpuProviderName = if igpuDriver == "amdgpu" then300300+ gpuProviderName = if igpuDriver == "amdgpu" then366301 # find the name of the provider if amdgpu367302 "`${pkgs.xorg.xrandr}/bin/xrandr --listproviders | ${pkgs.gnugrep}/bin/grep -i AMD | ${pkgs.gnused}/bin/sed -n 's/^.*name://p'`"368303 else369304 igpuDriver;370370- in optionalString syncCfg.enable ''305305+ providerCmdParams = if syncCfg.enable then "\"${gpuProviderName}\" NVIDIA-0" else "NVIDIA-G0 \"${gpuProviderName}\"";306306+ in optionalString (syncCfg.enable || reverseSyncCfg.enable) ''371307 # Added by nvidia configuration module for Optimus/PRIME.372372- ${pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource "${sinkGpuProviderName}" NVIDIA-0308308+ ${pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource ${providerCmdParams}373309 ${pkgs.xorg.xrandr}/bin/xrandr --auto374310 '';375311···395325396326 environment.systemPackages = [ nvidia_x11.bin ]397327 ++ optionals cfg.nvidiaSettings [ nvidia_x11.settings ]398398- ++ optionals nvidiaPersistencedEnabled [ nvidia_x11.persistenced ];328328+ ++ optionals nvidiaPersistencedEnabled [ nvidia_x11.persistenced ]329329+ ++ optionals offloadCfg.enableOffloadCmd [330330+ (pkgs.writeShellScriptBin "nvidia-offload" ''331331+ export __NV_PRIME_RENDER_OFFLOAD=1332332+ export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0333333+ export __GLX_VENDOR_LIBRARY_NAME=nvidia334334+ export __VK_LAYER_NV_optimus=NVIDIA_only335335+ exec "$@"336336+ '')337337+ ];399338400339 systemd.packages = optional cfg.powerManagement.enable nvidia_x11.out;401340
···11+import ./make-test-python.nix ({ pkgs, lib, ...}:22+33+{44+ name = "gnupg";55+ meta = with lib.maintainers; {66+ maintainers = [ rnhmjoj ];77+ };88+99+ # server for testing SSH1010+ nodes.server = { ... }: {1111+ imports = [ ../modules/profiles/minimal.nix ];1212+1313+ users.users.alice.isNormalUser = true;1414+ services.openssh.enable = true;1515+ };1616+1717+ # machine for testing GnuPG1818+ nodes.machine = { pkgs, ... }: {1919+ imports = [ ../modules/profiles/minimal.nix ];2020+2121+ users.users.alice.isNormalUser = true;2222+ services.getty.autologinUser = "alice";2323+2424+ environment.shellInit = ''2525+ # preset a key passphrase in gpg-agent2626+ preset_key() {2727+ # find all keys2828+ case "$1" in2929+ ssh) grips=$(awk '/^[0-9A-F]/{print $1}' "''${GNUPGHOME:-$HOME/.gnupg}/sshcontrol") ;;3030+ pgp) grips=$(gpg --with-keygrip --list-secret-keys | awk '/Keygrip/{print $3}') ;;3131+ esac3232+3333+ # try to preset the passphrase for each key found3434+ for grip in $grips; do3535+ "$(gpgconf --list-dirs libexecdir)/gpg-preset-passphrase" -c -P "$2" "$grip"3636+ done3737+ }3838+ '';3939+4040+ programs.gnupg.agent.enable = true;4141+ programs.gnupg.agent.enableSSHSupport = true;4242+ };4343+4444+ testScript =4545+ ''4646+ import shlex4747+4848+4949+ def as_alice(command: str) -> str:5050+ """5151+ Wraps a command to run it as Alice in a login shell5252+ """5353+ quoted = shlex.quote(command)5454+ return "su --login alice --command " + quoted5555+5656+5757+ start_all()5858+5959+ with subtest("Wait for the autologin"):6060+ machine.wait_until_tty_matches("1", "alice@machine")6161+6262+ with subtest("Can generate a PGP key"):6363+ # Note: this needs a tty because of pinentry6464+ machine.send_chars("gpg --gen-key\n")6565+ machine.wait_until_tty_matches("1", "Real name:")6666+ machine.send_chars("Alice\n")6767+ machine.wait_until_tty_matches("1", "Email address:")6868+ machine.send_chars("alice@machine\n")6969+ machine.wait_until_tty_matches("1", "Change")7070+ machine.send_chars("O\n")7171+ machine.wait_until_tty_matches("1", "Please enter")7272+ machine.send_chars("pgp_p4ssphrase\n")7373+ machine.wait_until_tty_matches("1", "Please re-enter")7474+ machine.send_chars("pgp_p4ssphrase\n")7575+ machine.wait_until_tty_matches("1", "public and secret key created")7676+7777+ with subtest("Confirm the key is in the keyring"):7878+ machine.wait_until_succeeds(as_alice("gpg --list-secret-keys | grep -q alice@machine"))7979+8080+ with subtest("Can generate and add an SSH key"):8181+ machine.succeed(as_alice("ssh-keygen -t ed25519 -f alice -N ssh_p4ssphrase"))8282+8383+ # Note: apparently this must be run before using the OpenSSH agent8484+ # socket for the first time in a tty. It's not needed for `ssh`8585+ # because there's a hook that calls it automatically (only in NixOS).8686+ machine.send_chars("gpg-connect-agent updatestartuptty /bye\n")8787+8888+ # Note: again, this needs a tty because of pinentry8989+ machine.send_chars("ssh-add alice\n")9090+ machine.wait_until_tty_matches("1", "Enter passphrase")9191+ machine.send_chars("ssh_p4ssphrase\n")9292+ machine.wait_until_tty_matches("1", "Please enter")9393+ machine.send_chars("ssh_agent_p4ssphrase\n")9494+ machine.wait_until_tty_matches("1", "Please re-enter")9595+ machine.send_chars("ssh_agent_p4ssphrase\n")9696+9797+ with subtest("Confirm the SSH key has been registered"):9898+ machine.wait_until_succeeds(as_alice("ssh-add -l | grep -q alice@machine"))9999+100100+ with subtest("Can preset the key passphrases in the agent"):101101+ machine.succeed(as_alice("echo allow-preset-passphrase > .gnupg/gpg-agent.conf"))102102+ machine.succeed(as_alice("pkill gpg-agent"))103103+ machine.succeed(as_alice("preset_key pgp pgp_p4ssphrase"))104104+ machine.succeed(as_alice("preset_key ssh ssh_agent_p4ssphrase"))105105+106106+ with subtest("Can encrypt and decrypt a message"):107107+ machine.succeed(as_alice("echo Hello | gpg -e -r alice | gpg -d | grep -q Hello"))108108+109109+ with subtest("Can log into the server"):110110+ # Install Alice's public key111111+ public_key = machine.succeed(as_alice("cat alice.pub"))112112+ server.succeed("mkdir /etc/ssh/authorized_keys.d")113113+ server.succeed(f"printf '{public_key}' > /etc/ssh/authorized_keys.d/alice")114114+115115+ server.wait_for_open_port(22)116116+ machine.succeed(as_alice("ssh -i alice -o StrictHostKeyChecking=no server exit"))117117+ '';118118+})
···4242 disabledTests = [4343 # python-memcached is not available (last release in 2017)4444 "TestClientSocketConnect"4545+ ] ++ lib.optionals stdenv.is32bit [4646+ # test_compressed_complex is broken on 32-bit platforms4747+ # this can be removed on the next version bump4848+ # see also https://github.com/pinterest/pymemcache/pull/4804949+ "test_compressed_complex"4550 ];46514752 pythonImportsCheck = [···5853 homepage = "https://pymemcache.readthedocs.io/";5954 license = with licenses; [ asl20 ];6055 maintainers = with maintainers; [ fab ];6161- broken = stdenv.is32bit;6256 };6357}
···357357 then pkgs.dune_2358358 else throw "dune_2 is not available for OCaml ${ocaml.version}";359359360360- dune_3 = callPackage ../development/tools/ocaml/dune/3.nix { };360360+ dune_3 =361361+ if lib.versionAtLeast ocaml.version "4.08"362362+ then callPackage ../development/tools/ocaml/dune/3.nix { }363363+ else if lib.versionAtLeast ocaml.version "4.02"364364+ then pkgs.dune_3365365+ else throw "dune_3 is not available for OCaml ${ocaml.version}";361366362367 dune-action-plugin = callPackage ../development/ocaml-modules/dune-action-plugin { };363368···12371232 result = callPackage ../development/ocaml-modules/ocaml-result { };1238123312391234 rock = callPackage ../development/ocaml-modules/rock { };12351235+12361236+ rusage = callPackage ../development/ocaml-modules/rusage { };1240123712411238 samplerate = callPackage ../development/ocaml-modules/samplerate { };12421239