···1# Testers {#chap-testers}
2This chapter describes several testing builders which are available in the `testers` namespace.
34-## `hasPkgConfigModule` {#tester-hasPkgConfigModule}
56-Checks whether a package exposes a certain `pkg-config` module.
000078Example:
910```nix
11-passthru.tests.pkg-config = testers.hasPkgConfigModule {
12 package = finalAttrs.finalPackage;
13- moduleName = "libfoo";
14-}
000000000015```
1617## `testVersion` {#tester-testVersion}
···1# Testers {#chap-testers}
2This chapter describes several testing builders which are available in the `testers` namespace.
34+## `hasPkgConfigModules` {#tester-hasPkgConfigModules}
56+<!-- Old anchor name so links still work -->
7+[]{#tester-hasPkgConfigModule}
8+Checks whether a package exposes a given list of `pkg-config` modules.
9+If the `moduleNames` argument is omitted, `hasPkgConfigModules` will
10+use `meta.pkgConfigModules`.
1112Example:
1314```nix
15+passthru.tests.pkg-config = testers.hasPkgConfigModules {
16 package = finalAttrs.finalPackage;
17+ moduleNames = [ "libfoo" ];
18+};
19+```
20+21+If the package in question has `meta.pkgConfigModules` set, it is even simpler:
22+23+```nix
24+passthru.tests.pkg-config = testers.hasPkgConfigModules {
25+ package = finalAttrs.finalPackage;
26+};
27+28+meta.pkgConfigModules = [ "libfoo" ];
29```
3031## `testVersion` {#tester-testVersion}
+1-1
nixos/modules/i18n/input-method/fcitx5.nix
···19 '';
20 };
21 quickPhrase = mkOption {
22- type = with types; attrsOf string;
23 default = { };
24 example = literalExpression ''
25 {
···19 '';
20 };
21 quickPhrase = mkOption {
22+ type = with types; attrsOf str;
23 default = { };
24 example = literalExpression ''
25 {
+1-1
nixos/modules/programs/firefox.nix
···53 };
5455 preferences = mkOption {
56- type = with types; attrsOf (oneOf [ bool int string ]);
57 default = { };
58 description = mdDoc ''
59 Preferences to set from `about:config`.
···53 };
5455 preferences = mkOption {
56+ type = with types; attrsOf (oneOf [ bool int str ]);
57 default = { };
58 description = mdDoc ''
59 Preferences to set from `about:config`.
+2-2
nixos/modules/programs/gamescope.nix
···42 };
4344 args = mkOption {
45- type = types.listOf types.string;
46 default = [ ];
47 example = [ "--rt" "--prefer-vk-device 8086:9bc4" ];
48 description = mdDoc ''
···51 };
5253 env = mkOption {
54- type = types.attrsOf types.string;
55 default = { };
56 example = literalExpression ''
57 # for Prime render offload on Nvidia laptops.
···42 };
4344 args = mkOption {
45+ type = types.listOf types.str;
46 default = [ ];
47 example = [ "--rt" "--prefer-vk-device 8086:9bc4" ];
48 description = mdDoc ''
···51 };
5253 env = mkOption {
54+ type = types.attrsOf types.str;
55 default = { };
56 example = literalExpression ''
57 # for Prime render offload on Nvidia laptops.
+2-2
nixos/modules/programs/steam.nix
···89 options = {
90 enable = mkEnableOption (mdDoc "GameScope Session");
91 args = mkOption {
92- type = types.listOf types.string;
93 default = [ ];
94 description = mdDoc ''
95 Arguments to be passed to GameScope for the session.
···97 };
9899 env = mkOption {
100- type = types.attrsOf types.string;
101 default = { };
102 description = mdDoc ''
103 Environmental variables to be passed to GameScope for the session.
···89 options = {
90 enable = mkEnableOption (mdDoc "GameScope Session");
91 args = mkOption {
92+ type = types.listOf types.str;
93 default = [ ];
94 description = mdDoc ''
95 Arguments to be passed to GameScope for the session.
···97 };
9899 env = mkOption {
100+ type = types.attrsOf types.str;
101 default = { };
102 description = mdDoc ''
103 Environmental variables to be passed to GameScope for the session.
+1-1
nixos/modules/security/ipa.nix
···86 };
8788 ifpAllowedUids = mkOption {
89- type = types.listOf types.string;
90 default = ["root"];
91 description = lib.mdDoc "A list of users allowed to access the ifp dbus interface.";
92 };
···86 };
8788 ifpAllowedUids = mkOption {
89+ type = types.listOf types.str;
90 default = ["root"];
91 description = lib.mdDoc "A list of users allowed to access the ifp dbus interface.";
92 };
+1-1
nixos/modules/security/pam.nix
···934 };
935 authserver = mkOption {
936 default = null;
937- type = with types; nullOr string;
938 description = lib.mdDoc ''
939 This controls the hostname for the 9front authentication server
940 that users will be authenticated against.
···934 };
935 authserver = mkOption {
936 default = null;
937+ type = with types; nullOr str;
938 description = lib.mdDoc ''
939 This controls the hostname for the 9front authentication server
940 that users will be authenticated against.
···142143 user = mkOption {
144 default = "maddy";
145- type = with types; uniq string;
146 description = lib.mdDoc ''
147 User account under which maddy runs.
148···156157 group = mkOption {
158 default = "maddy";
159- type = with types; uniq string;
160 description = lib.mdDoc ''
161 Group account under which maddy runs.
162···170171 hostname = mkOption {
172 default = "localhost";
173- type = with types; uniq string;
174 example = ''example.com'';
175 description = lib.mdDoc ''
176 Hostname to use. It should be FQDN.
···179180 primaryDomain = mkOption {
181 default = "localhost";
182- type = with types; uniq string;
183 example = ''mail.example.com'';
184 description = lib.mdDoc ''
185 Primary MX domain to use. It should be FQDN.
···142143 user = mkOption {
144 default = "maddy";
145+ type = with types; uniq str;
146 description = lib.mdDoc ''
147 User account under which maddy runs.
148···156157 group = mkOption {
158 default = "maddy";
159+ type = with types; uniq str;
160 description = lib.mdDoc ''
161 Group account under which maddy runs.
162···170171 hostname = mkOption {
172 default = "localhost";
173+ type = with types; uniq str;
174 example = ''example.com'';
175 description = lib.mdDoc ''
176 Hostname to use. It should be FQDN.
···179180 primaryDomain = mkOption {
181 default = "localhost";
182+ type = with types; uniq str;
183 example = ''mail.example.com'';
184 description = lib.mdDoc ''
185 Primary MX domain to use. It should be FQDN.
+5-1
nixos/modules/services/web-apps/nextcloud.nix
···405 adminuser = mkOption {
406 type = types.str;
407 default = "root";
408- description = lib.mdDoc "Username for the admin account.";
0000409 };
410 adminpassFile = mkOption {
411 type = types.str;
···405 adminuser = mkOption {
406 type = types.str;
407 default = "root";
408+ description = lib.mdDoc ''
409+ Username for the admin account. The username is only set during the
410+ initial setup of Nextcloud! Since the username also acts as unique
411+ ID internally, it cannot be changed later!
412+ '';
413 };
414 adminpassFile = mkOption {
415 type = types.str;
···15, executableName, longName, shortName, pname, updateScript
16, dontFixup ? false
17, rev ? null, vscodeServer ? null
18-19-# sourceExecutableName is the name of the binary in the source archive, over
20-# which we have no control
21, sourceExecutableName ? executableName
22-23, useVSCodeRipgrep ? false
24, ripgrep
25}:
···5, nixosTests
6, srcOnly
7, isInsiders ? false
0000008, commandLineArgs ? ""
9, useVSCodeRipgrep ? stdenv.isDarwin
10}:
···35 # Please backport all compatible updates to the stable release.
36 # This is important for the extension ecosystem.
37 version = "1.81.0";
38- pname = "vscode";
3940 # This is used for VS Code - Remote SSH test
41 rev = "6445d93c81ebe42c4cbd7a60712e0b17d9463e97";
···43 executableName = "code" + lib.optionalString isInsiders "-insiders";
44 longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
45 shortName = "Code" + lib.optionalString isInsiders " - Insiders";
46- inherit commandLineArgs useVSCodeRipgrep;
4748 src = fetchurl {
49 name = "VSCode_${version}_${plat}.${archive_fmt}";
···5, nixosTests
6, srcOnly
7, isInsiders ? false
8+# sourceExecutableName is the name of the binary in the source archive over
9+# which we have no control and it is needed to run the insider version as
10+# documented in https://nixos.wiki/wiki/Visual_Studio_Code#Insiders_Build
11+# On MacOS the insider binary is still called code instead of code-insiders as
12+# of 2023-08-06.
13+, sourceExecutableName ? "code" + lib.optionalString (isInsiders && stdenv.isLinux) "-insiders"
14, commandLineArgs ? ""
15, useVSCodeRipgrep ? stdenv.isDarwin
16}:
···41 # Please backport all compatible updates to the stable release.
42 # This is important for the extension ecosystem.
43 version = "1.81.0";
44+ pname = "vscode" + lib.optionalString isInsiders "-insiders";
4546 # This is used for VS Code - Remote SSH test
47 rev = "6445d93c81ebe42c4cbd7a60712e0b17d9463e97";
···49 executableName = "code" + lib.optionalString isInsiders "-insiders";
50 longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
51 shortName = "Code" + lib.optionalString isInsiders " - Insiders";
52+ inherit commandLineArgs useVSCodeRipgrep sourceExecutableName;
5354 src = fetchurl {
55 name = "VSCode_${version}_${plat}.${archive_fmt}";
···14 owner = "ImageOptim";
15 repo = "gifski";
16 rev = version;
17- sha256 = "sha256-sPsq/hntNqOdPJcoob1jrDUrLLiBEnfRoDANyFUjOuM=";
18 };
1920 cargoLock = {
···3536 buildFeatures = [ "video" ];
3738- # error: the crate `gifski` is compiled with the panic strategy `abort` which is incompatible with this crate's strategy of `unwind`
39- doCheck = !stdenv.isDarwin;
00000004041 # error: linker `/usr/bin/x86_64-linux-gnu-gcc` not found
42 postPatch = ''
···49 changelog = "https://github.com/ImageOptim/gifski/releases/tag/${src.rev}";
50 license = licenses.agpl3Plus;
51 maintainers = with maintainers; [ figsoda marsam ];
052 };
53}
···14 owner = "ImageOptim";
15 repo = "gifski";
16 rev = version;
17+ hash = "sha256-sPsq/hntNqOdPJcoob1jrDUrLLiBEnfRoDANyFUjOuM=";
18 };
1920 cargoLock = {
···3536 buildFeatures = [ "video" ];
3738+ # When the default checkType of release is used, we get the following error:
39+ #
40+ # error: the crate `gifski` is compiled with the panic strategy `abort` which
41+ # is incompatible with this crate's strategy of `unwind`
42+ #
43+ # It looks like https://github.com/rust-lang/cargo/issues/6313, which does not
44+ # outline a solution.
45+ #
46+ checkType = "debug";
4748 # error: linker `/usr/bin/x86_64-linux-gnu-gcc` not found
49 postPatch = ''
···56 changelog = "https://github.com/ImageOptim/gifski/releases/tag/${src.rev}";
57 license = licenses.agpl3Plus;
58 maintainers = with maintainers; [ figsoda marsam ];
59+ mainProgram = "gifski";
60 };
61}
+4-3
pkgs/tools/misc/arp-scan/default.nix
···22 buildInputs = [ perlPackages.perl libpcap ];
2324 postInstall = ''
25- for name in get-{oui,iab}; do
26- wrapProgram "$out/bin/$name" --set PERL5LIB "${perlPackages.makeFullPerlPath perlModules}"
27 done;
28 '';
29···33 Arp-scan is a command-line tool that uses the ARP protocol to discover
34 and fingerprint IP hosts on the local network.
35 '';
36- homepage = "http://www.nta-monitor.com/wiki/index.php/Arp-scan_Documentation";
37 license = licenses.gpl3;
38 platforms = platforms.linux ++ platforms.darwin;
39 maintainers = with maintainers; [ bjornfor mikoim r-burns ];
040 };
41}
···22 buildInputs = [ perlPackages.perl libpcap ];
2324 postInstall = ''
25+ for binary in get-{oui,iab}; do
26+ wrapProgram "$out/bin/$binary" --set PERL5LIB "${perlPackages.makeFullPerlPath perlModules}"
27 done;
28 '';
29···33 Arp-scan is a command-line tool that uses the ARP protocol to discover
34 and fingerprint IP hosts on the local network.
35 '';
36+ homepage = "https://github.com/royhills/arp-scan/wiki/arp-scan-User-Guide";
37 license = licenses.gpl3;
38 platforms = platforms.linux ++ platforms.darwin;
39 maintainers = with maintainers; [ bjornfor mikoim r-burns ];
40+ mainProgram = "arp-scan";
41 };
42}
+12-7
pkgs/tools/misc/atuin/default.nix
···1112rustPlatform.buildRustPackage rec {
13 pname = "atuin";
14- version = "15.0.0";
1516 src = fetchFromGitHub {
17- owner = "ellie";
18- repo = pname;
19 rev = "v${version}";
20- hash = "sha256-BX1WpvJMcfpepsRX0U6FJBL5/+mpUyTZxm65BbbZLJA=";
21 };
2223 # TODO: unify this to one hash because updater do not support this
24 cargoHash =
25 if stdenv.isLinux
26- then "sha256-EnIR+BXw8oYlv3dpYy4gAkN/zckRI8KEAbbR9wPmMq4="
27- else "sha256-hHcahzrIuXIgOv+sx0HbC9f5guTcTr6L4eeLoiQsAzA=";
2829 nativeBuildInputs = [ installShellFiles ];
30···41 inherit (nixosTests) atuin;
42 };
430000044 meta = with lib; {
45 description = "Replacement for a shell history which records additional commands context with optional encrypted synchronization between machines";
46- homepage = "https://github.com/ellie/atuin";
47 license = licenses.mit;
48 maintainers = with maintainers; [ SuperSandro2000 sciencentistguy _0x4A6F ];
49 };
···1112rustPlatform.buildRustPackage rec {
13 pname = "atuin";
14+ version = "16.0.0";
1516 src = fetchFromGitHub {
17+ owner = "atuinsh";
18+ repo = "atuin";
19 rev = "v${version}";
20+ hash = "sha256-Kh6aaWYV+ZG7Asvw5JdGsV+nxD+xvvQab5wLIedcQcQ=";
21 };
2223 # TODO: unify this to one hash because updater do not support this
24 cargoHash =
25 if stdenv.isLinux
26+ then "sha256-Ami88ScGj58jCCat4MMDvjZtV5WglmrlggpQfo+LPjs="
27+ else "sha256-HQMZ9w1C6go16XGrPNniQZliIQ/5yAp2w/uUwAOQTM0=";
2829 nativeBuildInputs = [ installShellFiles ];
30···41 inherit (nixosTests) atuin;
42 };
4344+ checkFlags = [
45+ # tries to make a network access
46+ "--skip=registration"
47+ ];
48+49 meta = with lib; {
50 description = "Replacement for a shell history which records additional commands context with optional encrypted synchronization between machines";
51+ homepage = "https://github.com/atuinsh/atuin";
52 license = licenses.mit;
53 maintainers = with maintainers; [ SuperSandro2000 sciencentistguy _0x4A6F ];
54 };
···5821 # example of an error which this fixes
5822 # [Errno 8] Exec format error: './gdk3-scan'
5823 mesonEmulatorHook =
5824- if (!stdenv.buildPlatform.canExecute stdenv.targetPlatform) then
5825- makeSetupHook
5826- {
5827- name = "mesonEmulatorHook";
5828- substitutions = {
5829- crossFile = writeText "cross-file.conf" ''
5830 [binaries]
5831- exe_wrapper = ${lib.escapeShellArg (stdenv.targetPlatform.emulator buildPackages)}
5832 '';
5833- };
5834- } ../development/tools/build-managers/meson/emulator-hook.sh
5835- 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)";
00000058365837 meson-tools = callPackage ../misc/meson-tools { };
5838···1033510336 linux-exploit-suggester = callPackage ../tools/security/linux-exploit-suggester { };
103370010338 linuxquota = callPackage ../tools/misc/linuxquota { };
1033910340 lipl = callPackage ../tools/misc/lipl { };
···12401 realvnc-vnc-viewer = callPackage ../tools/admin/realvnc-vnc-viewer { };
1240212403 re-isearch = callPackage ../applications/search/re-isearch { };
001240412405 reaverwps = callPackage ../tools/networking/reaver-wps { };
12406···33969 softmaker-office = callPackage ../applications/office/softmaker/softmaker_office.nix { };
3397033971 songrec = callPackage ../applications/audio/songrec { };
003397233973 storrent = callPackage ../applications/networking/p2p/storrent { };
33974
···5821 # example of an error which this fixes
5822 # [Errno 8] Exec format error: './gdk3-scan'
5823 mesonEmulatorHook =
5824+ makeSetupHook
5825+ {
5826+ name = "mesonEmulatorHook";
5827+ substitutions = {
5828+ crossFile = writeText "cross-file.conf" ''
05829 [binaries]
5830+ exe_wrapper = ${lib.escapeShellArg (stdenv.targetPlatform.emulator pkgs)}
5831 '';
5832+ };
5833+ }
5834+ # The throw is moved into the `makeSetupHook` derivation, so that its
5835+ # outer level, but not its outPath can still be evaluated if the condition
5836+ # doesn't hold. This ensures that splicing still can work correctly.
5837+ (if (!stdenv.hostPlatform.canExecute stdenv.targetPlatform) then
5838+ ../development/tools/build-managers/meson/emulator-hook.sh
5839+ else
5840+ 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.");
58415842 meson-tools = callPackage ../misc/meson-tools { };
5843···1034010341 linux-exploit-suggester = callPackage ../tools/security/linux-exploit-suggester { };
1034210343+ linux-gpib = callPackage ../applications/science/electronics/linux-gpib/user.nix { };
10344+10345 linuxquota = callPackage ../tools/misc/linuxquota { };
1034610347 lipl = callPackage ../tools/misc/lipl { };
···12408 realvnc-vnc-viewer = callPackage ../tools/admin/realvnc-vnc-viewer { };
1240912410 re-isearch = callPackage ../applications/search/re-isearch { };
12411+12412+ reason-shell = callPackage ../applications/science/misc/reason-shell { };
1241312414 reaverwps = callPackage ../tools/networking/reaver-wps { };
12415···33978 softmaker-office = callPackage ../applications/office/softmaker/softmaker_office.nix { };
3397933980 songrec = callPackage ../applications/audio/songrec { };
33981+33982+ storj-uplink = callPackage ../applications/networking/sync/storj-uplink {};
3398333984 storrent = callPackage ../applications/networking/p2p/storrent { };
33985