···11+# pkgs.nix-gitignore {#sec-pkgs-nix-gitignore}
22+33+`pkgs.nix-gitignore` is a function that acts similarly to `builtins.filterSource` but also allows filtering with the help of the gitignore format.
44+55+## Usage {#sec-pkgs-nix-gitignore-usage}
66+77+`pkgs.nix-gitignore` exports a number of functions, but you\'ll most likely need either `gitignoreSource` or `gitignoreSourcePure`. As their first argument, they both accept either 1. a file with gitignore lines or 2. a string with gitignore lines, or 3. a list of either of the two. They will be concatenated into a single big string.
88+99+```nix
1010+{ pkgs ? import <nixpkgs> {} }:
1111+1212+ nix-gitignore.gitignoreSource [] ./source
1313+ # Simplest version
1414+1515+ nix-gitignore.gitignoreSource "supplemental-ignores\n" ./source
1616+ # This one reads the ./source/.gitignore and concats the auxiliary ignores
1717+1818+ nix-gitignore.gitignoreSourcePure "ignore-this\nignore-that\n" ./source
1919+ # Use this string as gitignore, don't read ./source/.gitignore.
2020+2121+ nix-gitignore.gitignoreSourcePure ["ignore-this\nignore-that\n", ~/.gitignore] ./source
2222+ # It also accepts a list (of strings and paths) that will be concatenated
2323+ # once the paths are turned to strings via readFile.
2424+```
2525+2626+These functions are derived from the `Filter` functions by setting the first filter argument to `(_: _: true)`:
2727+2828+```nix
2929+gitignoreSourcePure = gitignoreFilterSourcePure (_: _: true);
3030+gitignoreSource = gitignoreFilterSource (_: _: true);
3131+```
3232+3333+Those filter functions accept the same arguments the `builtins.filterSource` function would pass to its filters, thus `fn: gitignoreFilterSourcePure fn ""` should be extensionally equivalent to `filterSource`. The file is blacklisted if it\'s blacklisted by either your filter or the gitignoreFilter.
3434+3535+If you want to make your own filter from scratch, you may use
3636+3737+```nix
3838+gitignoreFilter = ign: root: filterPattern (gitignoreToPatterns ign) root;
3939+```
4040+4141+## gitignore files in subdirectories {#sec-pkgs-nix-gitignore-usage-recursive}
4242+4343+If you wish to use a filter that would search for .gitignore files in subdirectories, just like git does by default, use this function:
4444+4545+```nix
4646+gitignoreFilterRecursiveSource = filter: patterns: root:
4747+# OR
4848+gitignoreRecursiveSource = gitignoreFilterSourcePure (_: _: true);
4949+```
-70
doc/functions/nix-gitignore.xml
···11-<section xmlns="http://docbook.org/ns/docbook"
22- xmlns:xlink="http://www.w3.org/1999/xlink"
33- xmlns:xi="http://www.w3.org/2001/XInclude"
44- xml:id="sec-pkgs-nix-gitignore">
55- <title>pkgs.nix-gitignore</title>
66-77- <para>
88- <function>pkgs.nix-gitignore</function> is a function that acts similarly to <literal>builtins.filterSource</literal> but also allows filtering with the help of the gitignore format.
99- </para>
1010-1111- <section xml:id="sec-pkgs-nix-gitignore-usage">
1212- <title>Usage</title>
1313-1414- <para>
1515- <literal>pkgs.nix-gitignore</literal> exports a number of functions, but you'll most likely need either <literal>gitignoreSource</literal> or <literal>gitignoreSourcePure</literal>. As their first argument, they both accept either 1. a file with gitignore lines or 2. a string with gitignore lines, or 3. a list of either of the two. They will be concatenated into a single big string.
1616- </para>
1717-1818-<programlisting><![CDATA[
1919-{ pkgs ? import <nixpkgs> {} }:
2020-2121- nix-gitignore.gitignoreSource [] ./source
2222- # Simplest version
2323-2424- nix-gitignore.gitignoreSource "supplemental-ignores\n" ./source
2525- # This one reads the ./source/.gitignore and concats the auxiliary ignores
2626-2727- nix-gitignore.gitignoreSourcePure "ignore-this\nignore-that\n" ./source
2828- # Use this string as gitignore, don't read ./source/.gitignore.
2929-3030- nix-gitignore.gitignoreSourcePure ["ignore-this\nignore-that\n", ~/.gitignore] ./source
3131- # It also accepts a list (of strings and paths) that will be concatenated
3232- # once the paths are turned to strings via readFile.
3333- ]]></programlisting>
3434-3535- <para>
3636- These functions are derived from the <literal>Filter</literal> functions by setting the first filter argument to <literal>(_: _: true)</literal>:
3737- </para>
3838-3939-<programlisting><![CDATA[
4040-gitignoreSourcePure = gitignoreFilterSourcePure (_: _: true);
4141-gitignoreSource = gitignoreFilterSource (_: _: true);
4242- ]]></programlisting>
4343-4444- <para>
4545- Those filter functions accept the same arguments the <literal>builtins.filterSource</literal> function would pass to its filters, thus <literal>fn: gitignoreFilterSourcePure fn ""</literal> should be extensionally equivalent to <literal>filterSource</literal>. The file is blacklisted iff it's blacklisted by either your filter or the gitignoreFilter.
4646- </para>
4747-4848- <para>
4949- If you want to make your own filter from scratch, you may use
5050- </para>
5151-5252-<programlisting><![CDATA[
5353-gitignoreFilter = ign: root: filterPattern (gitignoreToPatterns ign) root;
5454- ]]></programlisting>
5555- </section>
5656-5757- <section xml:id="sec-pkgs-nix-gitignore-usage-recursive">
5858- <title>gitignore files in subdirectories</title>
5959-6060- <para>
6161- If you wish to use a filter that would search for .gitignore files in subdirectories, just like git does by default, use this function:
6262- </para>
6363-6464-<programlisting><![CDATA[
6565-gitignoreFilterRecursiveSource = filter: patterns: root:
6666-# OR
6767-gitignoreRecursiveSource = gitignoreFilterSourcePure (_: _: true);
6868- ]]></programlisting>
6969- </section>
7070-</section>
···194194 <para>
195195 This is useful if you want to generate a wildcard certificate, since
196196 ACME servers will only hand out wildcard certs over DNS validation.
197197- There a number of supported DNS providers and servers you can utilise,
197197+ There are a number of supported DNS providers and servers you can utilise,
198198 see the <link xlink:href="https://go-acme.github.io/lego/dns/">lego docs</link>
199199 for provider/server specific configuration values. For the sake of these
200200 docs, we will provide a fully self-hosted example using bind.
-3
nixos/tests/acme.nix
···392392 # Check the key hash before and after adding an alias. It should not change.
393393 # The previous test reverts the ed384 change
394394 webserver.wait_for_unit("acme-finished-a.example.test.target")
395395- keyhash_old = webserver.succeed("md5sum /var/lib/acme/a.example.test/key.pem")
396395 switch_to(webserver, "nginx-aliases")
397396 webserver.wait_for_unit("acme-finished-a.example.test.target")
398397 check_issuer(webserver, "a.example.test", "pebble")
399398 check_connection(client, "a.example.test")
400399 check_connection(client, "b.example.test")
401401- keyhash_new = webserver.succeed("md5sum /var/lib/acme/a.example.test/key.pem")
402402- assert keyhash_old == keyhash_new
403400404401 with subtest("Can request certificates for vhost + aliases (apache-httpd)"):
405402 try:
···819819 # itself causing an infinite recursion at evaluation
820820 # time
821821 random = dontCheck super.random;
822822+823823+ # Since this package is primarily used by nixpkgs maintainers and is probably
824824+ # not used to link against by anyone, we can make it’s closure smaller.
825825+ cabal2nix-unstable = justStaticExecutables super.cabal2nix-unstable;
826826+827827+ # test suite needs local redis daemon
828828+ nri-redis = dontCheck super.nri-redis;
829829+830830+ # Make tophat find itself for _compiling_ its test suite
831831+ tophat = overrideCabal super.tophat (drv: {
832832+ postPatch = ''
833833+ sed -i 's|"tophat"|"./dist/build/tophat/tophat"|' app-test-bin/*.hs
834834+ '' + (drv.postPatch or "");
835835+ });
822836}
···228228 libc_cv_c_cleanup=yes
229229 libc_cv_gnu89_inline=yes
230230 EOF
231231+232232+ # ./configure has logic like
233233+ #
234234+ # AR=`$CC -print-prog-name=ar`
235235+ #
236236+ # This searches various directories in the gcc and its wrapper. In nixpkgs,
237237+ # this returns the bare string "ar", which is build ar. This can result as
238238+ # a build failure with the following message:
239239+ #
240240+ # libc_pic.a: error adding symbols: archive has no index; run ranlib to add one
241241+ #
242242+ # (Observed cross compiling from aarch64-linux -> armv7l-linux).
243243+ #
244244+ # Nixpkgs passes a correct value for AR and friends, so to use the correct
245245+ # set of tools, we only need to delete this special handling.
246246+ sed -i \
247247+ -e '/^AR=/d' \
248248+ -e '/^AS=/d' \
249249+ -e '/^LD=/d' \
250250+ -e '/^OBJCOPY=/d' \
251251+ -e '/^OBJDUMP=/d' \
252252+ $configureScript
231253 '';
232254233255 preBuild = lib.optionalString withGd "unset NIX_DONT_SET_RPATH";
···43434444 doCheck = true;
4545 checkPhase = ''
4646- yarn --offline test
4646+ # the default 2000ms timeout is sometimes too short on our busy builders
4747+ yarn --offline test --timeout 10000
4748 '';
48494950 postInstall = ''