···11# Testers {#chap-testers}
22This chapter describes several testing builders which are available in the `testers` namespace.
3344-## `hasPkgConfigModule` {#tester-hasPkgConfigModule}
44+## `hasPkgConfigModules` {#tester-hasPkgConfigModules}
5566-Checks whether a package exposes a certain `pkg-config` module.
66+<!-- Old anchor name so links still work -->
77+[]{#tester-hasPkgConfigModule}
88+Checks whether a package exposes a given list of `pkg-config` modules.
99+If the `moduleNames` argument is omitted, `hasPkgConfigModules` will
1010+use `meta.pkgConfigModules`.
711812Example:
9131014```nix
1111-passthru.tests.pkg-config = testers.hasPkgConfigModule {
1515+passthru.tests.pkg-config = testers.hasPkgConfigModules {
1216 package = finalAttrs.finalPackage;
1313- moduleName = "libfoo";
1414-}
1717+ moduleNames = [ "libfoo" ];
1818+};
1919+```
2020+2121+If the package in question has `meta.pkgConfigModules` set, it is even simpler:
2222+2323+```nix
2424+passthru.tests.pkg-config = testers.hasPkgConfigModules {
2525+ package = finalAttrs.finalPackage;
2626+};
2727+2828+meta.pkgConfigModules = [ "libfoo" ];
1529```
16301731## `testVersion` {#tester-testVersion}
+1-1
nixos/modules/i18n/input-method/fcitx5.nix
···1919 '';
2020 };
2121 quickPhrase = mkOption {
2222- type = with types; attrsOf string;
2222+ type = with types; attrsOf str;
2323 default = { };
2424 example = literalExpression ''
2525 {
+1-1
nixos/modules/programs/firefox.nix
···5353 };
54545555 preferences = mkOption {
5656- type = with types; attrsOf (oneOf [ bool int string ]);
5656+ type = with types; attrsOf (oneOf [ bool int str ]);
5757 default = { };
5858 description = mdDoc ''
5959 Preferences to set from `about:config`.
+2-2
nixos/modules/programs/gamescope.nix
···4242 };
43434444 args = mkOption {
4545- type = types.listOf types.string;
4545+ type = types.listOf types.str;
4646 default = [ ];
4747 example = [ "--rt" "--prefer-vk-device 8086:9bc4" ];
4848 description = mdDoc ''
···5151 };
52525353 env = mkOption {
5454- type = types.attrsOf types.string;
5454+ type = types.attrsOf types.str;
5555 default = { };
5656 example = literalExpression ''
5757 # for Prime render offload on Nvidia laptops.
+2-2
nixos/modules/programs/steam.nix
···8989 options = {
9090 enable = mkEnableOption (mdDoc "GameScope Session");
9191 args = mkOption {
9292- type = types.listOf types.string;
9292+ type = types.listOf types.str;
9393 default = [ ];
9494 description = mdDoc ''
9595 Arguments to be passed to GameScope for the session.
···9797 };
98989999 env = mkOption {
100100- type = types.attrsOf types.string;
100100+ type = types.attrsOf types.str;
101101 default = { };
102102 description = mdDoc ''
103103 Environmental variables to be passed to GameScope for the session.
+1-1
nixos/modules/security/ipa.nix
···8686 };
87878888 ifpAllowedUids = mkOption {
8989- type = types.listOf types.string;
8989+ type = types.listOf types.str;
9090 default = ["root"];
9191 description = lib.mdDoc "A list of users allowed to access the ifp dbus interface.";
9292 };
+1-1
nixos/modules/security/pam.nix
···934934 };
935935 authserver = mkOption {
936936 default = null;
937937- type = with types; nullOr string;
937937+ type = with types; nullOr str;
938938 description = lib.mdDoc ''
939939 This controls the hostname for the 9front authentication server
940940 that users will be authenticated against.
···142142143143 user = mkOption {
144144 default = "maddy";
145145- type = with types; uniq string;
145145+ type = with types; uniq str;
146146 description = lib.mdDoc ''
147147 User account under which maddy runs.
148148···156156157157 group = mkOption {
158158 default = "maddy";
159159- type = with types; uniq string;
159159+ type = with types; uniq str;
160160 description = lib.mdDoc ''
161161 Group account under which maddy runs.
162162···170170171171 hostname = mkOption {
172172 default = "localhost";
173173- type = with types; uniq string;
173173+ type = with types; uniq str;
174174 example = ''example.com'';
175175 description = lib.mdDoc ''
176176 Hostname to use. It should be FQDN.
···179179180180 primaryDomain = mkOption {
181181 default = "localhost";
182182- type = with types; uniq string;
182182+ type = with types; uniq str;
183183 example = ''mail.example.com'';
184184 description = lib.mdDoc ''
185185 Primary MX domain to use. It should be FQDN.
+5-1
nixos/modules/services/web-apps/nextcloud.nix
···405405 adminuser = mkOption {
406406 type = types.str;
407407 default = "root";
408408- description = lib.mdDoc "Username for the admin account.";
408408+ description = lib.mdDoc ''
409409+ Username for the admin account. The username is only set during the
410410+ initial setup of Nextcloud! Since the username also acts as unique
411411+ ID internally, it cannot be changed later!
412412+ '';
409413 };
410414 adminpassFile = mkOption {
411415 type = types.str;
···1515, executableName, longName, shortName, pname, updateScript
1616, dontFixup ? false
1717, rev ? null, vscodeServer ? null
1818-1919-# sourceExecutableName is the name of the binary in the source archive, over
2020-# which we have no control
2118, sourceExecutableName ? executableName
2222-2319, useVSCodeRipgrep ? false
2420, ripgrep
2521}:
+8-2
pkgs/applications/editors/vscode/vscode.nix
···55, nixosTests
66, srcOnly
77, isInsiders ? false
88+# sourceExecutableName is the name of the binary in the source archive over
99+# which we have no control and it is needed to run the insider version as
1010+# documented in https://nixos.wiki/wiki/Visual_Studio_Code#Insiders_Build
1111+# On MacOS the insider binary is still called code instead of code-insiders as
1212+# of 2023-08-06.
1313+, sourceExecutableName ? "code" + lib.optionalString (isInsiders && stdenv.isLinux) "-insiders"
814, commandLineArgs ? ""
915, useVSCodeRipgrep ? stdenv.isDarwin
1016}:
···3541 # Please backport all compatible updates to the stable release.
3642 # This is important for the extension ecosystem.
3743 version = "1.81.0";
3838- pname = "vscode";
4444+ pname = "vscode" + lib.optionalString isInsiders "-insiders";
39454046 # This is used for VS Code - Remote SSH test
4147 rev = "6445d93c81ebe42c4cbd7a60712e0b17d9463e97";
···4349 executableName = "code" + lib.optionalString isInsiders "-insiders";
4450 longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
4551 shortName = "Code" + lib.optionalString isInsiders " - Insiders";
4646- inherit commandLineArgs useVSCodeRipgrep;
5252+ inherit commandLineArgs useVSCodeRipgrep sourceExecutableName;
47534854 src = fetchurl {
4955 name = "VSCode_${version}_${plat}.${archive_fmt}";
···1414 owner = "ImageOptim";
1515 repo = "gifski";
1616 rev = version;
1717- sha256 = "sha256-sPsq/hntNqOdPJcoob1jrDUrLLiBEnfRoDANyFUjOuM=";
1717+ hash = "sha256-sPsq/hntNqOdPJcoob1jrDUrLLiBEnfRoDANyFUjOuM=";
1818 };
19192020 cargoLock = {
···35353636 buildFeatures = [ "video" ];
37373838- # error: the crate `gifski` is compiled with the panic strategy `abort` which is incompatible with this crate's strategy of `unwind`
3939- doCheck = !stdenv.isDarwin;
3838+ # When the default checkType of release is used, we get the following error:
3939+ #
4040+ # error: the crate `gifski` is compiled with the panic strategy `abort` which
4141+ # is incompatible with this crate's strategy of `unwind`
4242+ #
4343+ # It looks like https://github.com/rust-lang/cargo/issues/6313, which does not
4444+ # outline a solution.
4545+ #
4646+ checkType = "debug";
40474148 # error: linker `/usr/bin/x86_64-linux-gnu-gcc` not found
4249 postPatch = ''
···4956 changelog = "https://github.com/ImageOptim/gifski/releases/tag/${src.rev}";
5057 license = licenses.agpl3Plus;
5158 maintainers = with maintainers; [ figsoda marsam ];
5959+ mainProgram = "gifski";
5260 };
5361}
+4-3
pkgs/tools/misc/arp-scan/default.nix
···2222 buildInputs = [ perlPackages.perl libpcap ];
23232424 postInstall = ''
2525- for name in get-{oui,iab}; do
2626- wrapProgram "$out/bin/$name" --set PERL5LIB "${perlPackages.makeFullPerlPath perlModules}"
2525+ for binary in get-{oui,iab}; do
2626+ wrapProgram "$out/bin/$binary" --set PERL5LIB "${perlPackages.makeFullPerlPath perlModules}"
2727 done;
2828 '';
2929···3333 Arp-scan is a command-line tool that uses the ARP protocol to discover
3434 and fingerprint IP hosts on the local network.
3535 '';
3636- homepage = "http://www.nta-monitor.com/wiki/index.php/Arp-scan_Documentation";
3636+ homepage = "https://github.com/royhills/arp-scan/wiki/arp-scan-User-Guide";
3737 license = licenses.gpl3;
3838 platforms = platforms.linux ++ platforms.darwin;
3939 maintainers = with maintainers; [ bjornfor mikoim r-burns ];
4040+ mainProgram = "arp-scan";
4041 };
4142}
+12-7
pkgs/tools/misc/atuin/default.nix
···11111212rustPlatform.buildRustPackage rec {
1313 pname = "atuin";
1414- version = "15.0.0";
1414+ version = "16.0.0";
15151616 src = fetchFromGitHub {
1717- owner = "ellie";
1818- repo = pname;
1717+ owner = "atuinsh";
1818+ repo = "atuin";
1919 rev = "v${version}";
2020- hash = "sha256-BX1WpvJMcfpepsRX0U6FJBL5/+mpUyTZxm65BbbZLJA=";
2020+ hash = "sha256-Kh6aaWYV+ZG7Asvw5JdGsV+nxD+xvvQab5wLIedcQcQ=";
2121 };
22222323 # TODO: unify this to one hash because updater do not support this
2424 cargoHash =
2525 if stdenv.isLinux
2626- then "sha256-EnIR+BXw8oYlv3dpYy4gAkN/zckRI8KEAbbR9wPmMq4="
2727- else "sha256-hHcahzrIuXIgOv+sx0HbC9f5guTcTr6L4eeLoiQsAzA=";
2626+ then "sha256-Ami88ScGj58jCCat4MMDvjZtV5WglmrlggpQfo+LPjs="
2727+ else "sha256-HQMZ9w1C6go16XGrPNniQZliIQ/5yAp2w/uUwAOQTM0=";
28282929 nativeBuildInputs = [ installShellFiles ];
3030···4141 inherit (nixosTests) atuin;
4242 };
43434444+ checkFlags = [
4545+ # tries to make a network access
4646+ "--skip=registration"
4747+ ];
4848+4449 meta = with lib; {
4550 description = "Replacement for a shell history which records additional commands context with optional encrypted synchronization between machines";
4646- homepage = "https://github.com/ellie/atuin";
5151+ homepage = "https://github.com/atuinsh/atuin";
4752 license = licenses.mit;
4853 maintainers = with maintainers; [ SuperSandro2000 sciencentistguy _0x4A6F ];
4954 };
···58215821 # example of an error which this fixes
58225822 # [Errno 8] Exec format error: './gdk3-scan'
58235823 mesonEmulatorHook =
58245824- if (!stdenv.buildPlatform.canExecute stdenv.targetPlatform) then
58255825- makeSetupHook
58265826- {
58275827- name = "mesonEmulatorHook";
58285828- substitutions = {
58295829- crossFile = writeText "cross-file.conf" ''
58245824+ makeSetupHook
58255825+ {
58265826+ name = "mesonEmulatorHook";
58275827+ substitutions = {
58285828+ crossFile = writeText "cross-file.conf" ''
58305829 [binaries]
58315831- exe_wrapper = ${lib.escapeShellArg (stdenv.targetPlatform.emulator buildPackages)}
58305830+ exe_wrapper = ${lib.escapeShellArg (stdenv.targetPlatform.emulator pkgs)}
58325831 '';
58335833- };
58345834- } ../development/tools/build-managers/meson/emulator-hook.sh
58355835- else throw "mesonEmulatorHook has to be in a conditional to check if the target binaries can be executed i.e. (!stdenv.buildPlatform.canExecute stdenv.hostPlatform)";
58325832+ };
58335833+ }
58345834+ # The throw is moved into the `makeSetupHook` derivation, so that its
58355835+ # outer level, but not its outPath can still be evaluated if the condition
58365836+ # doesn't hold. This ensures that splicing still can work correctly.
58375837+ (if (!stdenv.hostPlatform.canExecute stdenv.targetPlatform) then
58385838+ ../development/tools/build-managers/meson/emulator-hook.sh
58395839+ else
58405840+ throw "mesonEmulatorHook may only be added to nativeBuildInputs when the target binaries can't be executed; however you are attempting to use it in a situation where ${stdenv.hostPlatform.config} can execute ${stdenv.targetPlatform.config}. Consider only adding mesonEmulatorHook according to a conditional based canExecute in your package expression.");
5836584158375842 meson-tools = callPackage ../misc/meson-tools { };
58385843···10335103401033610341 linux-exploit-suggester = callPackage ../tools/security/linux-exploit-suggester { };
10337103421034310343+ linux-gpib = callPackage ../applications/science/electronics/linux-gpib/user.nix { };
1034410344+1033810345 linuxquota = callPackage ../tools/misc/linuxquota { };
10339103461034010347 lipl = callPackage ../tools/misc/lipl { };
···1240112408 realvnc-vnc-viewer = callPackage ../tools/admin/realvnc-vnc-viewer { };
12402124091240312410 re-isearch = callPackage ../applications/search/re-isearch { };
1241112411+1241212412+ reason-shell = callPackage ../applications/science/misc/reason-shell { };
12404124131240512414 reaverwps = callPackage ../tools/networking/reaver-wps { };
1240612415···3396933978 softmaker-office = callPackage ../applications/office/softmaker/softmaker_office.nix { };
33970339793397133980 songrec = callPackage ../applications/audio/songrec { };
3398133981+3398233982+ storj-uplink = callPackage ../applications/networking/sync/storj-uplink {};
33972339833397333984 storrent = callPackage ../applications/networking/p2p/storrent { };
3397433985