···53To [backport a change into a release branch](https://nixos.org/nixpkgs/manual/#submitting-changes-stable-release-branches):
54551. Take note of the commit in which the change was introduced into `master`.
56-2. Check out the target _release branch_, e.g. `release-19.09`. Do not use a _channel branch_ like `nixos-19.09` or `nixpkgs-19.09`.
573. Use `git cherry-pick -x <original commit>`.
58-4. Open your backport PR. Make sure to select the release branch (e.g. `release-19.09`) as the target branch of the PR, and link to the PR in which the original change was made to `master`.
5960## Reviewing contributions
61
···53To [backport a change into a release branch](https://nixos.org/nixpkgs/manual/#submitting-changes-stable-release-branches):
54551. Take note of the commit in which the change was introduced into `master`.
56+2. Check out the target _release branch_, e.g. `release-20.03`. Do not use a _channel branch_ like `nixos-20.03` or `nixpkgs-20.03`.
573. Use `git cherry-pick -x <original commit>`.
58+4. Open your backport PR. Make sure to select the release branch (e.g. `release-20.03`) as the target branch of the PR, and link to the PR in which the original change was made to `master`.
5960## Reviewing contributions
61
+2-2
README.md
···45system, [Hydra](https://hydra.nixos.org/).
4647* [Continuous package builds for unstable/master](https://hydra.nixos.org/jobset/nixos/trunk-combined)
48-* [Continuous package builds for the NixOS 19.09 release](https://hydra.nixos.org/jobset/nixos/release-19.09)
49* [Tests for unstable/master](https://hydra.nixos.org/job/nixos/trunk-combined/tested#tabs-constituents)
50-* [Tests for the NixOS 19.09 release](https://hydra.nixos.org/job/nixos/release-19.09/tested#tabs-constituents)
5152Artifacts successfully built with Hydra are published to cache at
53https://cache.nixos.org/. When successful build and test criteria are
···45system, [Hydra](https://hydra.nixos.org/).
4647* [Continuous package builds for unstable/master](https://hydra.nixos.org/jobset/nixos/trunk-combined)
48+* [Continuous package builds for the NixOS 20.03 release](https://hydra.nixos.org/jobset/nixos/release-20.03)
49* [Tests for unstable/master](https://hydra.nixos.org/job/nixos/trunk-combined/tested#tabs-constituents)
50+* [Tests for the NixOS 20.03 release](https://hydra.nixos.org/job/nixos/release-20.03/tested#tabs-constituents)
5152Artifacts successfully built with Hydra are published to cache at
53https://cache.nixos.org/. When successful build and test criteria are
···412413 meta = with lib; {
414 description = "A pythonic wrapper around FFTW, the FFT library, presenting a unified interface for all the supported transforms";
415- homepage = http://hgomersall.github.com/pyFFTW;
416 license = with licenses; [ bsd2 bsd3 ];
417 maintainers = with maintainers; [ fridh ];
418 };
···412413 meta = with lib; {
414 description = "A pythonic wrapper around FFTW, the FFT library, presenting a unified interface for all the supported transforms";
415+ homepage = "http://hgomersall.github.com/pyFFTW";
416 license = with licenses; [ bsd2 bsd3 ];
417 maintainers = with maintainers; [ fridh ];
418 };
+2-2
doc/languages-frameworks/ruby.xml
···3233 meta = with lib; {
34 description = "A monitoring framework that aims to be simple, malleable, and scalable";
35- homepage = http://sensuapp.org/;
36 license = with licenses; mit;
37 maintainers = with maintainers; [ theuni ];
38 platforms = platforms.unix;
···6970 meta = with lib; {
71 description = "Tool and libraries for maintaining Ruby gems.";
72- homepage = https://github.com/nyarly/corundum;
73 license = licenses.mit;
74 maintainers = [ maintainers.nyarly ];
75 platforms = platforms.unix;
···3233 meta = with lib; {
34 description = "A monitoring framework that aims to be simple, malleable, and scalable";
35+ homepage = "http://sensuapp.org/";
36 license = with licenses; mit;
37 maintainers = with maintainers; [ theuni ];
38 platforms = platforms.unix;
···6970 meta = with lib; {
71 description = "Tool and libraries for maintaining Ruby gems.";
72+ homepage = "https://github.com/nyarly/corundum";
73 license = licenses.mit;
74 maintainers = [ maintainers.nyarly ];
75 platforms = platforms.unix;
-27
doc/languages-frameworks/texlive.xml
···149]]></programlisting>
150 </para>
151 </section>
152-153- <section xml:id="sec-language-texlive-known-problems">
154- <title>Known problems</title>
155-156- <itemizedlist>
157- <listitem>
158- <para>
159- Some tools are still missing, e.g. luajittex;
160- </para>
161- </listitem>
162- <listitem>
163- <para>
164- some apps aren't packaged/tested yet (asymptote, biber, etc.);
165- </para>
166- </listitem>
167- <listitem>
168- <para>
169- feature/bug: when a package is rejected by <varname>pkgFilter</varname>, its dependencies are still propagated;
170- </para>
171- </listitem>
172- <listitem>
173- <para>
174- in case of any bugs or feature requests, file a github issue or better a pull request and /cc @vcunat.
175- </para>
176- </listitem>
177- </itemizedlist>
178- </section>
179</section>
···190 The function <function>fetchurl</function> now has support for two different kinds of mirroring of files. First, it has support for <emphasis>content-addressable mirrors</emphasis>. For example, given the <function>fetchurl</function> call
191<programlisting>
192fetchurl {
193- url = http://releases.mozilla.org/<replaceable>...</replaceable>/firefox-2.0.0.6-source.tar.bz2;
194 sha1 = "eb72f55e4a8bf08e8c6ef227c0ade3d068ba1082";
195}</programlisting>
196 <function>fetchurl</function> will first try to download this file from <link
···190 The function <function>fetchurl</function> now has support for two different kinds of mirroring of files. First, it has support for <emphasis>content-addressable mirrors</emphasis>. For example, given the <function>fetchurl</function> call
191<programlisting>
192fetchurl {
193+ url = "http://releases.mozilla.org/<replaceable>...</replaceable>/firefox-2.0.0.6-source.tar.bz2";
194 sha1 = "eb72f55e4a8bf08e8c6ef227c0ade3d068ba1082";
195}</programlisting>
196 <function>fetchurl</function> will first try to download this file from <link
···14 <para>
15 <emphasis>Stable channels</emphasis>, such as
16 <literal
17- xlink:href="https://nixos.org/channels/nixos-19.09">nixos-19.09</literal>.
18 These only get conservative bug fixes and package upgrades. For instance,
19 a channel update may cause the Linux kernel on your system to be upgraded
20 from 4.19.34 to 4.19.38 (a minor bug fix), but not from
···38 <para>
39 <emphasis>Small channels</emphasis>, such as
40 <literal
41- xlink:href="https://nixos.org/channels/nixos-19.09-small">nixos-19.09-small</literal>
42 or
43 <literal
44 xlink:href="https://nixos.org/channels/nixos-unstable-small">nixos-unstable-small</literal>.
···63 <para>
64 When you first install NixOS, you’re automatically subscribed to the NixOS
65 channel that corresponds to your installation source. For instance, if you
66- installed from a 19.09 ISO, you will be subscribed to the
67- <literal>nixos-19.09</literal> channel. To see which NixOS channel you’re
68 subscribed to, run the following as root:
69<screen>
70# nix-channel --list | grep nixos
···75# nix-channel --add https://nixos.org/channels/<replaceable>channel-name</replaceable> nixos
76</screen>
77 (Be sure to include the <literal>nixos</literal> parameter at the end.) For
78- instance, to use the NixOS 19.09 stable channel:
79<screen>
80-# nix-channel --add https://nixos.org/channels/nixos-19.09 nixos
81</screen>
82 If you have a server, you may want to use the “small” channel instead:
83<screen>
84-# nix-channel --add https://nixos.org/channels/nixos-19.09-small nixos
85</screen>
86 And if you want to live on the bleeding edge:
87<screen>
···132 kernel, initrd or kernel modules.
133 You can also specify a channel explicitly, e.g.
134<programlisting>
135-<xref linkend="opt-system.autoUpgrade.channel"/> = https://nixos.org/channels/nixos-19.09;
136</programlisting>
137 </para>
138 </section>
···14 <para>
15 <emphasis>Stable channels</emphasis>, such as
16 <literal
17+ xlink:href="https://nixos.org/channels/nixos-20.03">nixos-20.03</literal>.
18 These only get conservative bug fixes and package upgrades. For instance,
19 a channel update may cause the Linux kernel on your system to be upgraded
20 from 4.19.34 to 4.19.38 (a minor bug fix), but not from
···38 <para>
39 <emphasis>Small channels</emphasis>, such as
40 <literal
41+ xlink:href="https://nixos.org/channels/nixos-20.03-small">nixos-20.03-small</literal>
42 or
43 <literal
44 xlink:href="https://nixos.org/channels/nixos-unstable-small">nixos-unstable-small</literal>.
···63 <para>
64 When you first install NixOS, you’re automatically subscribed to the NixOS
65 channel that corresponds to your installation source. For instance, if you
66+ installed from a 20.03 ISO, you will be subscribed to the
67+ <literal>nixos-20.03</literal> channel. To see which NixOS channel you’re
68 subscribed to, run the following as root:
69<screen>
70# nix-channel --list | grep nixos
···75# nix-channel --add https://nixos.org/channels/<replaceable>channel-name</replaceable> nixos
76</screen>
77 (Be sure to include the <literal>nixos</literal> parameter at the end.) For
78+ instance, to use the NixOS 20.03 stable channel:
79<screen>
80+# nix-channel --add https://nixos.org/channels/nixos-20.03 nixos
81</screen>
82 If you have a server, you may want to use the “small” channel instead:
83<screen>
84+# nix-channel --add https://nixos.org/channels/nixos-20.03-small nixos
85</screen>
86 And if you want to live on the bleeding edge:
87<screen>
···132 kernel, initrd or kernel modules.
133 You can also specify a channel explicitly, e.g.
134<programlisting>
135+<xref linkend="opt-system.autoUpgrade.channel"/> = https://nixos.org/channels/nixos-20.03;
136</programlisting>
137 </para>
138 </section>
···180 ) )
181 {
182 # we need e.g. brcmfmac43602-pcie.bin
183- push @imports, "<nixpkgs/nixos/modules/hardware/network/broadcom-43xx.nix>";
184 }
185186 # Can't rely on $module here, since the module may not be loaded
···279280# Likewise for QEMU.
281if ($virt eq "qemu" || $virt eq "kvm" || $virt eq "bochs") {
282- push @imports, "<nixpkgs/nixos/modules/profiles/qemu-guest.nix>";
283}
284285# Also for Hyper-V.
···296297# Provide firmware for devices that are not detected by this script,
298# unless we're in a VM/container.
299-push @imports, "<nixpkgs/nixos/modules/installer/scan/not-detected.nix>"
300 if $virt eq "none";
301302···549# Do not modify this file! It was generated by ‘nixos-generate-config’
550# and may be overwritten by future invocations. Please make changes
551# to /etc/nixos/configuration.nix instead.
552-{ config, lib, pkgs, ... }:
553554{
555 imports =${\multiLineList(" ", @imports)};
···180 ) )
181 {
182 # we need e.g. brcmfmac43602-pcie.bin
183+ push @imports, "(modulesPath + \"/hardware/network/broadcom-43xx.nix\")";
184 }
185186 # Can't rely on $module here, since the module may not be loaded
···279280# Likewise for QEMU.
281if ($virt eq "qemu" || $virt eq "kvm" || $virt eq "bochs") {
282+ push @imports, "(modulesPath + \"/profiles/qemu-guest.nix\")";
283}
284285# Also for Hyper-V.
···296297# Provide firmware for devices that are not detected by this script,
298# unless we're in a VM/container.
299+push @imports, "(modulesPath + \"/installer/scan/not-detected.nix\")"
300 if $virt eq "none";
301302···549# Do not modify this file! It was generated by ‘nixos-generate-config’
550# and may be overwritten by future invocations. Please make changes
551# to /etc/nixos/configuration.nix instead.
552+{ config, lib, pkgs, modulesPath, ... }:
553554{
555 imports =${\multiLineList(" ", @imports)};
···343344 # Test that existing cert is older than new cert
345 KEY=${spath}/certificates/${keyName}.key
0346 if [ -e $KEY -a $KEY -nt key.pem ]; then
0347 cp -p ${spath}/certificates/${keyName}.key key.pem
348 cp -p ${spath}/certificates/${keyName}.crt fullchain.pem
349 cp -p ${spath}/certificates/${keyName}.issuer.crt chain.pem
···354 chmod ${fileMode} *.pem
355 chown '${data.user}:${data.group}' *.pem
356357- ${data.postRun}
000358 '';
359 in
360 "+${script}";
···343344 # Test that existing cert is older than new cert
345 KEY=${spath}/certificates/${keyName}.key
346+ KEY_CHANGED=no
347 if [ -e $KEY -a $KEY -nt key.pem ]; then
348+ KEY_CHANGED=yes
349 cp -p ${spath}/certificates/${keyName}.key key.pem
350 cp -p ${spath}/certificates/${keyName}.crt fullchain.pem
351 cp -p ${spath}/certificates/${keyName}.issuer.crt chain.pem
···356 chmod ${fileMode} *.pem
357 chown '${data.user}:${data.group}' *.pem
358359+ if [ "$KEY_CHANGED" = "yes" ]; then
360+ : # noop in case postRun is empty
361+ ${data.postRun}
362+ fi
363 '';
364 in
365 "+${script}";
+1-1
nixos/modules/services/databases/cockroachdb.nix
···153 defaultText = "pkgs.cockroachdb";
154 description = ''
155 The CockroachDB derivation to use for running the service.
156-157 This would primarily be useful to enable Enterprise Edition features
158 in your own custom CockroachDB build (Nixpkgs CockroachDB binaries
159 only contain open source features and open source code).
···153 defaultText = "pkgs.cockroachdb";
154 description = ''
155 The CockroachDB derivation to use for running the service.
156+157 This would primarily be useful to enable Enterprise Edition features
158 in your own custom CockroachDB build (Nixpkgs CockroachDB binaries
159 only contain open source features and open source code).
···3let
45 inherit (lib) mkEnableOption mkForce mkIf mkMerge mkOption optionalAttrs recursiveUpdate types;
067- cfg = config.services.dokuwiki;
89- user = config.services.nginx.user;
10 group = config.services.nginx.group;
1112- dokuwikiAclAuthConfig = pkgs.writeText "acl.auth.php" ''
13 # acl.auth.php
14 # <?php exit()?>
15 #
···18 ${toString cfg.acl}
19 '';
2021- dokuwikiLocalConfig = pkgs.writeText "local.php" ''
22 <?php
23 $conf['savedir'] = '${cfg.stateDir}';
24 $conf['superuser'] = '${toString cfg.superUser}';
25 $conf['useacl'] = '${toString cfg.aclUse}';
026 ${toString cfg.extraConfig}
27 '';
2829- dokuwikiPluginsLocalConfig = pkgs.writeText "plugins.local.php" ''
30 <?php
31 ${cfg.pluginsConfig}
32 '';
3334-in
35-{
36- options.services.dokuwiki = {
37- enable = mkEnableOption "DokuWiki web application.";
3839- hostName = mkOption {
40- type = types.str;
41- default = "localhost";
42- description = "FQDN for the instance.";
43- };
4445- stateDir = mkOption {
46- type = types.path;
47- default = "/var/lib/dokuwiki/data";
48- description = "Location of the dokuwiki state directory.";
49- };
5051- acl = mkOption {
52- type = types.nullOr types.lines;
53- default = null;
54- example = "* @ALL 8";
55- description = ''
56- Access Control Lists: see <link xlink:href="https://www.dokuwiki.org/acl"/>
57- Mutually exclusive with services.dokuwiki.aclFile
58- Set this to a value other than null to take precedence over aclFile option.
59- '';
60- };
06162- aclFile = mkOption {
63- type = types.nullOr types.path;
64- default = null;
65- description = ''
66- Location of the dokuwiki acl rules. Mutually exclusive with services.dokuwiki.acl
67- Mutually exclusive with services.dokuwiki.acl which is preferred.
68- Consult documentation <link xlink:href="https://www.dokuwiki.org/acl"/> for further instructions.
69- Example: <link xlink:href="https://github.com/splitbrain/dokuwiki/blob/master/conf/acl.auth.php.dist"/>
70- '';
71- };
7273- aclUse = mkOption {
74- type = types.bool;
75- default = true;
76- description = ''
77- Necessary for users to log in into the system.
78- Also limits anonymous users. When disabled,
79- everyone is able to create and edit content.
80- '';
81- };
8283- pluginsConfig = mkOption {
84- type = types.lines;
85- default = ''
86- $plugins['authad'] = 0;
87- $plugins['authldap'] = 0;
88- $plugins['authmysql'] = 0;
89- $plugins['authpgsql'] = 0;
90- '';
91- description = ''
92- List of the dokuwiki (un)loaded plugins.
93- '';
94- };
9596- superUser = mkOption {
97- type = types.nullOr types.str;
98- default = "@admin";
99- description = ''
100- You can set either a username, a list of usernames (“admin1,admin2”),
101- or the name of a group by prepending an @ char to the groupname
102- Consult documentation <link xlink:href="https://www.dokuwiki.org/config:superuser"/> for further instructions.
103- '';
104- };
105106- usersFile = mkOption {
107- type = types.nullOr types.path;
108- default = null;
109- description = ''
110- Location of the dokuwiki users file. List of users. Format:
111- login:passwordhash:Real Name:email:groups,comma,separated
112- Create passwordHash easily by using:$ mkpasswd -5 password `pwgen 8 1`
113- Example: <link xlink:href="https://github.com/splitbrain/dokuwiki/blob/master/conf/users.auth.php.dist"/>
000114 '';
115- };
000000000000116117- extraConfig = mkOption {
118- type = types.nullOr types.lines;
119- default = null;
120- example = ''
121- $conf['title'] = 'My Wiki';
122- $conf['userewrite'] = 1;
123- '';
124- description = ''
125- DokuWiki configuration. Refer to
126- <link xlink:href="https://www.dokuwiki.org/config"/>
127- for details on supported values.
128- '';
129- };
0000000000000000000130131- poolConfig = mkOption {
132- type = with types; attrsOf (oneOf [ str int bool ]);
133- default = {
134- "pm" = "dynamic";
135- "pm.max_children" = 32;
136- "pm.start_servers" = 2;
137- "pm.min_spare_servers" = 2;
138- "pm.max_spare_servers" = 4;
139- "pm.max_requests" = 500;
0140 };
141- description = ''
142- Options for the dokuwiki PHP pool. See the documentation on <literal>php-fpm.conf</literal>
143- for details on configuration directives.
144- '';
145- };
146147- nginx = mkOption {
148- type = types.submodule (
149- recursiveUpdate
150- (import ../web-servers/nginx/vhost-options.nix { inherit config lib; })
151- {
152- # Enable encryption by default,
153- options.forceSSL.default = true;
154- options.enableACME.default = true;
155- }
156- );
157- default = {forceSSL = true; enableACME = true;};
158- example = {
159- serverAliases = [
160- "wiki.\${config.networking.domain}"
161- ];
162- enableACME = false;
163 };
164- description = ''
165- With this option, you can customize the nginx virtualHost which already has sensible defaults for DokuWiki.
166- '';
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000167 };
168 };
169170 # implementation
171172- config = mkIf cfg.enable {
173174- warnings = mkIf (cfg.superUser == null) ["Not setting services.dokuwiki.superUser will impair your ability to administer DokuWiki"];
175176- assertions = [
177- {
178- assertion = cfg.aclUse -> (cfg.acl != null || cfg.aclFile != null);
179- message = "Either services.dokuwiki.acl or services.dokuwiki.aclFile is mandatory when aclUse is true";
180- }
181- {
182- assertion = cfg.usersFile != null -> cfg.aclUse != false;
183- message = "services.dokuwiki.aclUse must be true when usersFile is not null";
184- }
185- ];
186187- services.phpfpm.pools.dokuwiki = {
188- inherit user;
189- inherit group;
190- phpEnv = {
191- DOKUWIKI_LOCAL_CONFIG = "${dokuwikiLocalConfig}";
192- DOKUWIKI_PLUGINS_LOCAL_CONFIG = "${dokuwikiPluginsLocalConfig}";
193- } //optionalAttrs (cfg.usersFile != null) {
194- DOKUWIKI_USERS_AUTH_CONFIG = "${cfg.usersFile}";
195- } //optionalAttrs (cfg.aclUse) {
196- DOKUWIKI_ACL_AUTH_CONFIG = if (cfg.acl != null) then "${dokuwikiAclAuthConfig}" else "${toString cfg.aclFile}";
197- };
198-199- settings = {
200- "listen.mode" = "0660";
201- "listen.owner" = user;
202- "listen.group" = group;
203- } // cfg.poolConfig;
204- };
0205206 services.nginx = {
207 enable = true;
208-209- virtualHosts = {
210- ${cfg.hostName} = mkMerge [ cfg.nginx {
211- root = mkForce "${pkgs.dokuwiki}/share/dokuwiki/";
212- extraConfig = "fastcgi_param HTTPS on;";
213214- locations."~ /(conf/|bin/|inc/|install.php)" = {
215- extraConfig = "deny all;";
216- };
217218- locations."~ ^/data/" = {
219- root = "${cfg.stateDir}";
220- extraConfig = "internal;";
221- };
222223- locations."~ ^/lib.*\.(js|css|gif|png|ico|jpg|jpeg)$" = {
224- extraConfig = "expires 365d;";
225- };
226227- locations."/" = {
228- priority = 1;
229- index = "doku.php";
230- extraConfig = ''try_files $uri $uri/ @dokuwiki;'';
231- };
232233- locations."@dokuwiki" = {
234- extraConfig = ''
235 # rewrites "doku.php/" out of the URLs if you set the userwrite setting to .htaccess in dokuwiki config page
236 rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
237 rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
238 rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
239 rewrite ^/(.*) /doku.php?id=$1&$args last;
240- '';
241- };
242243- locations."~ \.php$" = {
244- extraConfig = ''
245 try_files $uri $uri/ /doku.php;
246 include ${pkgs.nginx}/conf/fastcgi_params;
247 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
248 fastcgi_param REDIRECT_STATUS 200;
249- fastcgi_pass unix:${config.services.phpfpm.pools.dokuwiki.socket};
250 fastcgi_param HTTPS on;
251- '';
252- };
253- }];
254- };
255-256 };
257258- systemd.tmpfiles.rules = [
259 "d ${cfg.stateDir}/attic 0750 ${user} ${group} - -"
260 "d ${cfg.stateDir}/cache 0750 ${user} ${group} - -"
261 "d ${cfg.stateDir}/index 0750 ${user} ${group} - -"
···266 "d ${cfg.stateDir}/meta 0750 ${user} ${group} - -"
267 "d ${cfg.stateDir}/pages 0750 ${user} ${group} - -"
268 "d ${cfg.stateDir}/tmp 0750 ${user} ${group} - -"
269- ];
002700000271 };
272}
···3let
45 inherit (lib) mkEnableOption mkForce mkIf mkMerge mkOption optionalAttrs recursiveUpdate types;
6+ inherit (lib) concatMapStringsSep flatten mapAttrs mapAttrs' mapAttrsToList nameValuePair concatMapStringSep;
78+ eachSite = config.services.dokuwiki;
910+ user = "dokuwiki";
11 group = config.services.nginx.group;
1213+ dokuwikiAclAuthConfig = cfg: pkgs.writeText "acl.auth.php" ''
14 # acl.auth.php
15 # <?php exit()?>
16 #
···19 ${toString cfg.acl}
20 '';
2122+ dokuwikiLocalConfig = cfg: pkgs.writeText "local.php" ''
23 <?php
24 $conf['savedir'] = '${cfg.stateDir}';
25 $conf['superuser'] = '${toString cfg.superUser}';
26 $conf['useacl'] = '${toString cfg.aclUse}';
27+ $conf['disableactions'] = '${cfg.disableActions}';
28 ${toString cfg.extraConfig}
29 '';
3031+ dokuwikiPluginsLocalConfig = cfg: pkgs.writeText "plugins.local.php" ''
32 <?php
33 ${cfg.pluginsConfig}
34 '';
3536+ pkg = hostName: cfg: pkgs.stdenv.mkDerivation rec {
37+ pname = "dokuwiki-${hostName}";
38+ version = src.version;
39+ src = cfg.package;
4041+ installPhase = ''
42+ mkdir -p $out
43+ cp -r * $out/
004445+ # symlink the dokuwiki config
46+ ln -s ${dokuwikiLocalConfig cfg} $out/share/dokuwiki/local.php
0004748+ # symlink plugins config
49+ ln -s ${dokuwikiPluginsLocalConfig cfg} $out/share/dokuwiki/plugins.local.php
50+51+ # symlink acl
52+ ln -s ${dokuwikiAclAuthConfig cfg} $out/share/dokuwiki/acl.auth.php
53+54+ # symlink additional plugin(s) and templates(s)
55+ ${concatMapStringsSep "\n" (template: "ln -s ${template} $out/share/dokuwiki/lib/tpl/${template.name}") cfg.templates}
56+ ${concatMapStringsSep "\n" (plugin: "ln -s ${plugin} $out/share/dokuwiki/lib/plugins/${plugin.name}") cfg.plugins}
57+ '';
58+ };
5960+ siteOpts = { config, lib, name, ...}: {
61+ options = {
62+ enable = mkEnableOption "DokuWiki web application.";
00000006364+ package = mkOption {
65+ type = types.package;
66+ default = pkgs.dokuwiki;
67+ description = "Which dokuwiki package to use.";
68+ };
00006970+ hostName = mkOption {
71+ type = types.str;
72+ default = "localhost";
73+ description = "FQDN for the instance.";
74+ };
00000007576+ stateDir = mkOption {
77+ type = types.path;
78+ default = "/var/lib/dokuwiki/${name}/data";
79+ description = "Location of the dokuwiki state directory.";
80+ };
00008182+ acl = mkOption {
83+ type = types.nullOr types.lines;
84+ default = null;
85+ example = "* @ALL 8";
86+ description = ''
87+ Access Control Lists: see <link xlink:href="https://www.dokuwiki.org/acl"/>
88+ Mutually exclusive with services.dokuwiki.aclFile
89+ Set this to a value other than null to take precedence over aclFile option.
90+91+ Warning: Consider using aclFile instead if you do not
92+ want to store the ACL in the world-readable Nix store.
93 '';
94+ };
95+96+ aclFile = mkOption {
97+ type = with types; nullOr str;
98+ default = if (config.aclUse && config.acl == null) then "/var/lib/dokuwiki/${name}/users.auth.php" else null;
99+ description = ''
100+ Location of the dokuwiki acl rules. Mutually exclusive with services.dokuwiki.acl
101+ Mutually exclusive with services.dokuwiki.acl which is preferred.
102+ Consult documentation <link xlink:href="https://www.dokuwiki.org/acl"/> for further instructions.
103+ Example: <link xlink:href="https://github.com/splitbrain/dokuwiki/blob/master/conf/acl.auth.php.dist"/>
104+ '';
105+ example = "/var/lib/dokuwiki/${name}/acl.auth.php";
106+ };
107108+ aclUse = mkOption {
109+ type = types.bool;
110+ default = true;
111+ description = ''
112+ Necessary for users to log in into the system.
113+ Also limits anonymous users. When disabled,
114+ everyone is able to create and edit content.
115+ '';
116+ };
117+118+ pluginsConfig = mkOption {
119+ type = types.lines;
120+ default = ''
121+ $plugins['authad'] = 0;
122+ $plugins['authldap'] = 0;
123+ $plugins['authmysql'] = 0;
124+ $plugins['authpgsql'] = 0;
125+ '';
126+ description = ''
127+ List of the dokuwiki (un)loaded plugins.
128+ '';
129+ };
130+131+ superUser = mkOption {
132+ type = types.nullOr types.str;
133+ default = "@admin";
134+ description = ''
135+ You can set either a username, a list of usernames (“admin1,admin2”),
136+ or the name of a group by prepending an @ char to the groupname
137+ Consult documentation <link xlink:href="https://www.dokuwiki.org/config:superuser"/> for further instructions.
138+ '';
139+ };
140141+ usersFile = mkOption {
142+ type = with types; nullOr str;
143+ default = if config.aclUse then "/var/lib/dokuwiki/${name}/users.auth.php" else null;
144+ description = ''
145+ Location of the dokuwiki users file. List of users. Format:
146+ login:passwordhash:Real Name:email:groups,comma,separated
147+ Create passwordHash easily by using:$ mkpasswd -5 password `pwgen 8 1`
148+ Example: <link xlink:href="https://github.com/splitbrain/dokuwiki/blob/master/conf/users.auth.php.dist"/>
149+ '';
150+ example = "/var/lib/dokuwiki/${name}/users.auth.php";
151 };
00000152153+ disableActions = mkOption {
154+ type = types.nullOr types.str;
155+ default = "";
156+ example = "search,register";
157+ description = ''
158+ Disable individual action modes. Refer to
159+ <link xlink:href="https://www.dokuwiki.org/config:action_modes"/>
160+ for details on supported values.
161+ '';
0000000162 };
163+164+ extraConfig = mkOption {
165+ type = types.nullOr types.lines;
166+ default = null;
167+ example = ''
168+ $conf['title'] = 'My Wiki';
169+ $conf['userewrite'] = 1;
170+ '';
171+ description = ''
172+ DokuWiki configuration. Refer to
173+ <link xlink:href="https://www.dokuwiki.org/config"/>
174+ for details on supported values.
175+ '';
176+ };
177+178+ plugins = mkOption {
179+ type = types.listOf types.path;
180+ default = [];
181+ description = ''
182+ List of path(s) to respective plugin(s) which are copied from the 'plugin' directory.
183+ <note><para>These plugins need to be packaged before use, see example.</para></note>
184+ '';
185+ example = ''
186+ # Let's package the icalevents plugin
187+ plugin-icalevents = pkgs.stdenv.mkDerivation {
188+ name = "icalevents";
189+ # Download the plugin from the dokuwiki site
190+ src = pkgs.fetchurl {
191+ url = https://github.com/real-or-random/dokuwiki-plugin-icalevents/releases/download/2017-06-16/dokuwiki-plugin-icalevents-2017-06-16.zip;
192+ sha256 = "e40ed7dd6bbe7fe3363bbbecb4de481d5e42385b5a0f62f6a6ce6bf3a1f9dfa8";
193+ };
194+ sourceRoot = ".";
195+ # We need unzip to build this package
196+ buildInputs = [ pkgs.unzip ];
197+ # Installing simply means copying all files to the output directory
198+ installPhase = "mkdir -p $out; cp -R * $out/";
199+ };
200+201+ # And then pass this theme to the plugin list like this:
202+ plugins = [ plugin-icalevents ];
203+ '';
204+ };
205+206+ templates = mkOption {
207+ type = types.listOf types.path;
208+ default = [];
209+ description = ''
210+ List of path(s) to respective template(s) which are copied from the 'tpl' directory.
211+ <note><para>These templates need to be packaged before use, see example.</para></note>
212+ '';
213+ example = ''
214+ # Let's package the bootstrap3 theme
215+ template-bootstrap3 = pkgs.stdenv.mkDerivation {
216+ name = "bootstrap3";
217+ # Download the theme from the dokuwiki site
218+ src = pkgs.fetchurl {
219+ url = https://github.com/giterlizzi/dokuwiki-template-bootstrap3/archive/v2019-05-22.zip;
220+ sha256 = "4de5ff31d54dd61bbccaf092c9e74c1af3a4c53e07aa59f60457a8f00cfb23a6";
221+ };
222+ # We need unzip to build this package
223+ buildInputs = [ pkgs.unzip ];
224+ # Installing simply means copying all files to the output directory
225+ installPhase = "mkdir -p $out; cp -R * $out/";
226+ };
227+228+ # And then pass this theme to the template list like this:
229+ templates = [ template-bootstrap3 ];
230+ '';
231+ };
232+233+ poolConfig = mkOption {
234+ type = with types; attrsOf (oneOf [ str int bool ]);
235+ default = {
236+ "pm" = "dynamic";
237+ "pm.max_children" = 32;
238+ "pm.start_servers" = 2;
239+ "pm.min_spare_servers" = 2;
240+ "pm.max_spare_servers" = 4;
241+ "pm.max_requests" = 500;
242+ };
243+ description = ''
244+ Options for the dokuwiki PHP pool. See the documentation on <literal>php-fpm.conf</literal>
245+ for details on configuration directives.
246+ '';
247+ };
248+249+ nginx = mkOption {
250+ type = types.submodule (
251+ recursiveUpdate
252+ (import ../web-servers/nginx/vhost-options.nix { inherit config lib; })
253+ {
254+ # Enable encryption by default,
255+ options.forceSSL.default = true;
256+ options.enableACME.default = true;
257+ }
258+ );
259+ default = {forceSSL = true; enableACME = true;};
260+ example = {
261+ serverAliases = [
262+ "wiki.\${config.networking.domain}"
263+ ];
264+ enableACME = false;
265+ };
266+ description = ''
267+ With this option, you can customize the nginx virtualHost which already has sensible defaults for DokuWiki.
268+ '';
269+ };
270+ };
271+ };
272+in
273+{
274+ # interface
275+ options = {
276+ services.dokuwiki = mkOption {
277+ type = types.attrsOf (types.submodule siteOpts);
278+ default = {};
279+ description = "Sepcification of one or more dokuwiki sites to service.";
280 };
281 };
282283 # implementation
284285+ config = mkIf (eachSite != {}) {
286287+ warnings = mapAttrsToList (hostName: cfg: mkIf (cfg.superUser == null) "Not setting services.dokuwiki.${hostName} superUser will impair your ability to administer DokuWiki") eachSite;
288289+ assertions = flatten (mapAttrsToList (hostName: cfg:
290+ [{
291+ assertion = cfg.aclUse -> (cfg.acl != null || cfg.aclFile != null);
292+ message = "Either services.dokuwiki.${hostName}.acl or services.dokuwiki.${hostName}.aclFile is mandatory if aclUse true";
293+ }
294+ {
295+ assertion = cfg.usersFile != null -> cfg.aclUse != false;
296+ message = "services.dokuwiki.${hostName}.aclUse must must be true if usersFile is not null";
297+ }
298+ ]) eachSite);
299300+ services.phpfpm.pools = mapAttrs' (hostName: cfg: (
301+ nameValuePair "dokuwiki-${hostName}" {
302+ inherit user;
303+ inherit group;
304+ phpEnv = {
305+ DOKUWIKI_LOCAL_CONFIG = "${dokuwikiLocalConfig cfg}";
306+ DOKUWIKI_PLUGINS_LOCAL_CONFIG = "${dokuwikiPluginsLocalConfig cfg}";
307+ } // optionalAttrs (cfg.usersFile != null) {
308+ DOKUWIKI_USERS_AUTH_CONFIG = "${cfg.usersFile}";
309+ } //optionalAttrs (cfg.aclUse) {
310+ DOKUWIKI_ACL_AUTH_CONFIG = if (cfg.acl != null) then "${dokuwikiAclAuthConfig cfg}" else "${toString cfg.aclFile}";
311+ };
312+313+ settings = {
314+ "listen.mode" = "0660";
315+ "listen.owner" = user;
316+ "listen.group" = group;
317+ } // cfg.poolConfig;
318+ })) eachSite;
319320 services.nginx = {
321 enable = true;
322+ virtualHosts = mapAttrs (hostName: cfg: mkMerge [ cfg.nginx {
323+ root = mkForce "${pkg hostName cfg}/share/dokuwiki";
324+ extraConfig = "fastcgi_param HTTPS on;";
00325326+ locations."~ /(conf/|bin/|inc/|install.php)" = {
327+ extraConfig = "deny all;";
328+ };
329330+ locations."~ ^/data/" = {
331+ root = "${cfg.stateDir}";
332+ extraConfig = "internal;";
333+ };
334335+ locations."~ ^/lib.*\.(js|css|gif|png|ico|jpg|jpeg)$" = {
336+ extraConfig = "expires 365d;";
337+ };
338339+ locations."/" = {
340+ priority = 1;
341+ index = "doku.php";
342+ extraConfig = ''try_files $uri $uri/ @dokuwiki;'';
343+ };
344345+ locations."@dokuwiki" = {
346+ extraConfig = ''
347 # rewrites "doku.php/" out of the URLs if you set the userwrite setting to .htaccess in dokuwiki config page
348 rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
349 rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
350 rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
351 rewrite ^/(.*) /doku.php?id=$1&$args last;
352+ '';
353+ };
354355+ locations."~ \.php$" = {
356+ extraConfig = ''
357 try_files $uri $uri/ /doku.php;
358 include ${pkgs.nginx}/conf/fastcgi_params;
359 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
360 fastcgi_param REDIRECT_STATUS 200;
361+ fastcgi_pass unix:${config.services.phpfpm.pools."dokuwiki-${hostName}".socket};
362 fastcgi_param HTTPS on;
363+ '';
364+ };
365+ }]) eachSite;
00366 };
367368+ systemd.tmpfiles.rules = flatten (mapAttrsToList (hostName: cfg: [
369 "d ${cfg.stateDir}/attic 0750 ${user} ${group} - -"
370 "d ${cfg.stateDir}/cache 0750 ${user} ${group} - -"
371 "d ${cfg.stateDir}/index 0750 ${user} ${group} - -"
···376 "d ${cfg.stateDir}/meta 0750 ${user} ${group} - -"
377 "d ${cfg.stateDir}/pages 0750 ${user} ${group} - -"
378 "d ${cfg.stateDir}/tmp 0750 ${user} ${group} - -"
379+ ] ++ lib.optional (cfg.aclFile != null) "C ${cfg.aclFile} 0640 ${user} ${group} - ${pkg hostName cfg}/share/dokuwiki/conf/acl.auth.php.dist"
380+ ++ lib.optional (cfg.usersFile != null) "C ${cfg.usersFile} 0640 ${user} ${group} - ${pkg hostName cfg}/share/dokuwiki/conf/users.auth.php.dist"
381+ ) eachSite);
382383+ users.users.${user} = {
384+ group = group;
385+ isSystemUser = true;
386+ };
387 };
388}
+2-2
nixos/modules/services/web-apps/wordpress.nix
···105 name = "embed-pdf-viewer-plugin";
106 # Download the theme from the wordpress site
107 src = pkgs.fetchurl {
108- url = https://downloads.wordpress.org/plugin/embed-pdf-viewer.2.0.3.zip;
109 sha256 = "1rhba5h5fjlhy8p05zf0p14c9iagfh96y91r36ni0rmk6y891lyd";
110 };
111 # We need unzip to build this package
···132 name = "responsive-theme";
133 # Download the theme from the wordpress site
134 src = pkgs.fetchurl {
135- url = https://downloads.wordpress.org/theme/responsive.3.14.zip;
136 sha256 = "0rjwm811f4aa4q43r77zxlpklyb85q08f9c8ns2akcarrvj5ydx3";
137 };
138 # We need unzip to build this package
···105 name = "embed-pdf-viewer-plugin";
106 # Download the theme from the wordpress site
107 src = pkgs.fetchurl {
108+ url = "https://downloads.wordpress.org/plugin/embed-pdf-viewer.2.0.3.zip";
109 sha256 = "1rhba5h5fjlhy8p05zf0p14c9iagfh96y91r36ni0rmk6y891lyd";
110 };
111 # We need unzip to build this package
···132 name = "responsive-theme";
133 # Download the theme from the wordpress site
134 src = pkgs.fetchurl {
135+ url = "https://downloads.wordpress.org/theme/responsive.3.14.zip";
136 sha256 = "0rjwm811f4aa4q43r77zxlpklyb85q08f9c8ns2akcarrvj5ydx3";
137 };
138 # We need unzip to build this package
···463 A specification of the desired configuration of this
464 container, as a NixOS module.
465 '';
466- type = lib.mkOptionType {
00467 name = "Toplevel NixOS config";
468- merge = loc: defs: (import ../../lib/eval-config.nix {
469 inherit system;
000470 modules =
471 let
472 extraConfig = {
···512 Grant additional capabilities to the container. See the
513 capabilities(7) and systemd-nspawn(1) man pages for more
514 information.
000000000515 '';
516 };
517
···463 A specification of the desired configuration of this
464 container, as a NixOS module.
465 '';
466+ type = let
467+ confPkgs = if config.pkgs == null then pkgs else config.pkgs;
468+ in lib.mkOptionType {
469 name = "Toplevel NixOS config";
470+ merge = loc: defs: (import (confPkgs.path + "/nixos/lib/eval-config.nix") {
471 inherit system;
472+ pkgs = confPkgs;
473+ baseModules = import (confPkgs.path + "/nixos/modules/module-list.nix");
474+ inherit (confPkgs) lib;
475 modules =
476 let
477 extraConfig = {
···517 Grant additional capabilities to the container. See the
518 capabilities(7) and systemd-nspawn(1) man pages for more
519 information.
520+ '';
521+ };
522+523+ pkgs = mkOption {
524+ type = types.nullOr types.attrs;
525+ default = null;
526+ example = literalExample "pkgs";
527+ description = ''
528+ Customise which nixpkgs to use for this container.
529 '';
530 };
531
···1# This performs a full 'end-to-end' test of a multi-node CockroachDB cluster
2# using the built-in 'cockroach workload' command, to simulate a semi-realistic
3# test load. It generally takes anywhere from 3-5 minutes to run and 1-2GB of
4-# RAM (though each of 3 workers gets 1GB allocated)
5#
6# CockroachDB requires synchronized system clocks within a small error window
7# (~500ms by default) on each node in order to maintain a multi-node cluster.
···5556 {
57 # Bank/TPC-C benchmarks take some memory to complete
58- virtualisation.memorySize = 1024;
5960 # Install the KVM PTP "Virtualized Clock" driver. This allows a /dev/ptp0
61 # device to appear as a reference clock, synchronized to the host clock.
···88 services.cockroachdb.listen.address = myAddr;
89 services.cockroachdb.join = lib.mkIf (joinNode != null) joinNode;
900091 # Hold startup until Chrony has performed its first measurement (which
92 # will probably result in a full timeskip, thanks to makestep)
93 systemd.services.cockroachdb.preStart = ''
···95 '';
96 };
9798-in import ./make-test.nix ({ pkgs, ...} : {
99 name = "cockroachdb";
100 meta.maintainers = with pkgs.stdenv.lib.maintainers;
101 [ thoughtpolice ];
···110 # there's otherwise no way to guarantee that node1 will start before the others try
111 # to join it.
112 testScript = ''
113- $node1->start;
114- $node1->waitForUnit("cockroachdb");
115-116- $node2->start;
117- $node2->waitForUnit("cockroachdb");
118-119- $node3->start;
120- $node3->waitForUnit("cockroachdb");
121-122- $node1->mustSucceed("cockroach sql --host=192.168.1.1 --insecure -e 'SHOW ALL CLUSTER SETTINGS' 2>&1");
123- $node1->mustSucceed("cockroach workload init bank 'postgresql://root\@192.168.1.1:26257?sslmode=disable'");
124- $node1->mustSucceed("cockroach workload run bank --duration=1m 'postgresql://root\@192.168.1.1:26257?sslmode=disable'");
125 '';
126})
···1# This performs a full 'end-to-end' test of a multi-node CockroachDB cluster
2# using the built-in 'cockroach workload' command, to simulate a semi-realistic
3# test load. It generally takes anywhere from 3-5 minutes to run and 1-2GB of
4+# RAM (though each of 3 workers gets 2GB allocated)
5#
6# CockroachDB requires synchronized system clocks within a small error window
7# (~500ms by default) on each node in order to maintain a multi-node cluster.
···5556 {
57 # Bank/TPC-C benchmarks take some memory to complete
58+ virtualisation.memorySize = 2048;
5960 # Install the KVM PTP "Virtualized Clock" driver. This allows a /dev/ptp0
61 # device to appear as a reference clock, synchronized to the host clock.
···88 services.cockroachdb.listen.address = myAddr;
89 services.cockroachdb.join = lib.mkIf (joinNode != null) joinNode;
9091+ systemd.services.chronyd.unitConfig.ConditionPathExists = "/dev/ptp0";
92+93 # Hold startup until Chrony has performed its first measurement (which
94 # will probably result in a full timeskip, thanks to makestep)
95 systemd.services.cockroachdb.preStart = ''
···97 '';
98 };
99100+in import ./make-test-python.nix ({ pkgs, ...} : {
101 name = "cockroachdb";
102 meta.maintainers = with pkgs.stdenv.lib.maintainers;
103 [ thoughtpolice ];
···112 # there's otherwise no way to guarantee that node1 will start before the others try
113 # to join it.
114 testScript = ''
115+ for node in node1, node2, node3:
116+ node.start()
117+ node.wait_for_unit("cockroachdb")
118+ node1.succeed(
119+ "cockroach sql --host=192.168.1.1 --insecure -e 'SHOW ALL CLUSTER SETTINGS' 2>&1",
120+ "cockroach workload init bank 'postgresql://root@192.168.1.1:26257?sslmode=disable'",
121+ "cockroach workload run bank --duration=1m 'postgresql://root@192.168.1.1:26257?sslmode=disable'",
122+ )
0000123 '';
124})
···1# The certificate for the ACME service is exported as:
2#
3-# config.test-support.letsencrypt.caCert
4#
5# This value can be used inside the configuration of other test nodes to inject
6# the snakeoil certificate into security.pki.certificateFiles or into package
7# overlays.
8#
9# Another value that's needed if you don't use a custom resolver (see below for
10-# notes on that) is to add the letsencrypt node as a nameserver to every node
11# that needs to acquire certificates using ACME, because otherwise the API host
12-# for letsencrypt.org can't be resolved.
13#
14# A configuration example of a full node setup using this would be this:
15#
16# {
17-# letsencrypt = import ./common/letsencrypt;
18#
19# example = { nodes, ... }: {
20# networking.nameservers = [
21-# nodes.letsencrypt.config.networking.primaryIPAddress
22# ];
23# security.pki.certificateFiles = [
24-# nodes.letsencrypt.config.test-support.letsencrypt.caCert
25# ];
26# };
27# }
···33# override networking.nameservers like this:
34#
35# {
36-# letsencrypt = { nodes, ... }: {
37-# imports = [ ./common/letsencrypt ];
38-# networking.nameservers = [
39# nodes.myresolver.config.networking.primaryIPAddress
40# ];
41# };
···55let
56 snakeOilCerts = import ./snakeoil-certs.nix;
5758- wfeDomain = "acme-v02.api.letsencrypt.org";
59 wfeCertFile = snakeOilCerts.${wfeDomain}.cert;
60 wfeKeyFile = snakeOilCerts.${wfeDomain}.key;
6162- siteDomain = "letsencrypt.org";
63 siteCertFile = snakeOilCerts.${siteDomain}.cert;
64 siteKeyFile = snakeOilCerts.${siteDomain}.key;
65 pebble = pkgs.pebble;
66 resolver = let
67- message = "You need to define a resolver for the letsencrypt test module.";
68 firstNS = lib.head config.networking.nameservers;
69 in if config.networking.nameservers == [] then throw message else firstNS;
70···76 httpPort = 80;
77 tlsPort = 443;
78 ocspResponderURL = "http://0.0.0.0:4002";
079 };
8081 pebbleConfFile = pkgs.writeText "pebble.conf" (builtins.toJSON pebbleConf);
82 pebbleDataDir = "/root/pebble";
8384in {
85- imports = [ ../resolver.nix ];
8687- options.test-support.letsencrypt.caCert = lib.mkOption {
88 type = lib.types.path;
89 description = ''
90 A certificate file to use with the <literal>nodes</literal> attribute to
···98 resolver.enable = let
99 isLocalResolver = config.networking.nameservers == [ "127.0.0.1" ];
100 in lib.mkOverride 900 isLocalResolver;
101- letsencrypt.caCert = snakeOilCerts.ca.cert;
102 };
103104 # This has priority 140, because modules/testing/test-instrumentation.nix
···126 '';
127 serviceConfig = {
128 # Required to bind on privileged ports.
129- User = "root";
130- Group = "root";
131 };
132 };
133 };
···1# The certificate for the ACME service is exported as:
2#
3+# config.test-support.acme.caCert
4#
5# This value can be used inside the configuration of other test nodes to inject
6# the snakeoil certificate into security.pki.certificateFiles or into package
7# overlays.
8#
9# Another value that's needed if you don't use a custom resolver (see below for
10+# notes on that) is to add the acme node as a nameserver to every node
11# that needs to acquire certificates using ACME, because otherwise the API host
12+# for acme.test can't be resolved.
13#
14# A configuration example of a full node setup using this would be this:
15#
16# {
17+# acme = import ./common/acme/server;
18#
19# example = { nodes, ... }: {
20# networking.nameservers = [
21+# nodes.acme.config.networking.primaryIPAddress
22# ];
23# security.pki.certificateFiles = [
24+# nodes.acme.config.test-support.acme.caCert
25# ];
26# };
27# }
···33# override networking.nameservers like this:
34#
35# {
36+# acme = { nodes, lib, ... }: {
37+# imports = [ ./common/acme/server ];
38+# networking.nameservers = lib.mkForce [
39# nodes.myresolver.config.networking.primaryIPAddress
40# ];
41# };
···55let
56 snakeOilCerts = import ./snakeoil-certs.nix;
5758+ wfeDomain = "acme.test";
59 wfeCertFile = snakeOilCerts.${wfeDomain}.cert;
60 wfeKeyFile = snakeOilCerts.${wfeDomain}.key;
6162+ siteDomain = "acme.test";
63 siteCertFile = snakeOilCerts.${siteDomain}.cert;
64 siteKeyFile = snakeOilCerts.${siteDomain}.key;
65 pebble = pkgs.pebble;
66 resolver = let
67+ message = "You need to define a resolver for the acme test module.";
68 firstNS = lib.head config.networking.nameservers;
69 in if config.networking.nameservers == [] then throw message else firstNS;
70···76 httpPort = 80;
77 tlsPort = 443;
78 ocspResponderURL = "http://0.0.0.0:4002";
79+ strict = true;
80 };
8182 pebbleConfFile = pkgs.writeText "pebble.conf" (builtins.toJSON pebbleConf);
83 pebbleDataDir = "/root/pebble";
8485in {
86+ imports = [ ../../resolver.nix ];
8788+ options.test-support.acme.caCert = lib.mkOption {
89 type = lib.types.path;
90 description = ''
91 A certificate file to use with the <literal>nodes</literal> attribute to
···99 resolver.enable = let
100 isLocalResolver = config.networking.nameservers == [ "127.0.0.1" ];
101 in lib.mkOverride 900 isLocalResolver;
102+ acme.caCert = snakeOilCerts.ca.cert;
103 };
104105 # This has priority 140, because modules/testing/test-instrumentation.nix
···127 '';
128 serviceConfig = {
129 # Required to bind on privileged ports.
130+ AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ];
0131 };
132 };
133 };
···18 defining this option needs to be explicitly imported.
1920 The reason this option exists is for the
21- <filename>nixos/tests/common/letsencrypt</filename> module, which
22 needs that option to disable the resolver once the user has set its own
23 resolver.
24 '';
···18 defining this option needs to be explicitly imported.
1920 The reason this option exists is for the
21+ <filename>nixos/tests/common/acme/server</filename> module, which
22 needs that option to disable the resolver once the user has set its own
23 resolver.
24 '';
···1-{ stdenv, lib, buildEnv, buildGoPackage, fetchFromGitHub, makeWrapper
2, runCommand, writeText, terraform-providers }:
34let
···17 rev = "v${version}";
18 inherit sha256;
19 };
0000002021 postInstall = ''
22 # remove all plugins, they are part of the main binary now
···1+{ stdenv, lib, buildEnv, buildGoPackage, fetchFromGitHub, makeWrapper, coreutils
2, runCommand, writeText, terraform-providers }:
34let
···17 rev = "v${version}";
18 inherit sha256;
19 };
20+21+ postPatch = ''
22+ # speakeasy hardcodes /bin/stty https://github.com/bgentry/speakeasy/issues/22
23+ substituteInPlace vendor/github.com/bgentry/speakeasy/speakeasy_unix.go \
24+ --replace "/bin/stty" "${coreutils}/bin/stty"
25+ '';
2627 postInstall = ''
28 # remove all plugins, they are part of the main binary now
···1516stdenv.mkDerivation rec {
17 pname = "elementary-planner";
18+ version = "2.3.2";
1920 src = fetchFromGitHub {
21 owner = "alainm23";
22 repo = "planner";
23 rev = version;
24+ sha256 = "1kjk1zafx71zmax3whzpx6mzl037wlxri30bl2k9y9rg3fd09arr";
25 };
26+27+ patches = [
28+ # Revert a patch the works around some stylesheet issues:
29+ # https://github.com/alainm23/planner/issues/268
30+ # https://github.com/alainm23/planner/issues/303
31+ # The don't seem to be a problem with Pantheon on NixOS
32+ # and for some reason produce the opposite effect with
33+ # pantheon's stylesheet.
34+ ./0001-Revert-Add-patch.patch
35+ ];
3637 nativeBuildInputs = [
38 desktop-file-utils
···5 # During compilation, a CMake bundle is downloaded from `artifacts.plex.tv`,
6 # which then downloads a handful of web client-related files. To enable
7 # sandboxed builds, we manually download them and save them so these files
8- # are fetched ahead-of-time instead of during the CMake build. Whenever
9- # plex-media-player is updated, the versions for these files are changed,
10- # so the build IDs (and SHAs) below will need to be updated!
11- depSrcs = rec {
12- webClientBuildId = "141-4af71961b12c68";
13- webClientDesktopBuildId = "3.104.2-1b12c68";
14- webClientTvBuildId = "4.3.0-4af7196";
15-16- webClient = fetchurl {
17- url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/buildid.cmake";
18- sha256 = "0fpkd1s49dbiqqlijxbillqd71a78p8y2sc23mwp0lvcmxrg265p";
19- };
20- webClientDesktopHash = fetchurl {
21- url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz.sha1";
22- sha256 = "0sb0j44lwqz9zbm98nba4x6c1jxdzvs36ynwfg527avkxxna0f8f";
23- };
24- webClientDesktop = fetchurl {
25- url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-desktop-${webClientDesktopBuildId}.tar.xz";
26- sha256 = "0dxa0ka0igfsryzda4r5clwdl47ah78nmlmgj9d5pgsvyvzjp87z";
27- };
28- webClientTvHash = fetchurl {
29- url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz.sha1";
30- sha256 = "086w1bavk2aqsyhv9zi5fynk31zf61sl91r6gjrdrz656wfk5bxa";
31- };
32- webClientTv = fetchurl {
33- url = "https://artifacts.plex.tv/web-client-pmp/${webClientBuildId}/web-client-tv-${webClientTvBuildId}.tar.xz";
34- sha256 = "12vbgsfnj0j2y5jd73dpi08hqsr9888sma41nvd4ydsd7qblm455";
35- };
36- };
37in mkDerivation rec {
38 pname = "plex-media-player";
39- version = "2.40.0.1007";
40- vsnHash = "5482132c";
4142 src = fetchFromGitHub {
43 owner = "plexinc";
44 repo = "plex-media-player";
45 rev = "v${version}-${vsnHash}";
46- sha256 = "0ibdh5g8x32iy74q97jfsmxd08wnyrzs3gfiwjfgc10vaa1qdhli";
47 };
4849 nativeBuildInputs = [ pkgconfig cmake python3 ];
···60 '';
6162 cmakeFlags = [ "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DQTROOT=${qtbase}" ];
006364 meta = with stdenv.lib; {
65 description = "Streaming media player for Plex";
···5 # During compilation, a CMake bundle is downloaded from `artifacts.plex.tv`,
6 # which then downloads a handful of web client-related files. To enable
7 # sandboxed builds, we manually download them and save them so these files
8+ # are fetched ahead-of-time instead of during the CMake build. To update
9+ # plex-media-player use the update.sh script, so the versions and hashes
10+ # for these files are are also updated!
11+ depSrcs = import ./deps.nix { inherit fetchurl; };
000000000000000000000000012in mkDerivation rec {
13 pname = "plex-media-player";
14+ version = "2.55.0.1069";
15+ vsnHash = "2369bed9";
1617 src = fetchFromGitHub {
18 owner = "plexinc";
19 repo = "plex-media-player";
20 rev = "v${version}-${vsnHash}";
21+ sha256 = "1jq4592sgaia0xy2h7n3vh5i7c84sdh4l64fdc774r4i0bmg66qi";
22 };
2324 nativeBuildInputs = [ pkgconfig cmake python3 ];
···35 '';
3637 cmakeFlags = [ "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DQTROOT=${qtbase}" ];
38+39+ passthru.updateScript = ./update.sh;
4041 meta = with stdenv.lib; {
42 description = "Streaming media player for Plex";
···1{ stdenv, lib, fetchFromGitHub, substituteAll, cmake, bash }:
23+# This was originally called mkl-dnn, then it was renamed to dnnl, and it has
4+# just recently been renamed again to oneDNN. In a follow-up, let's move the
5+# attr and alias dnnl -> oneDNN. See here for details:
6+# https://github.com/oneapi-src/oneDNN#oneapi-deep-neural-network-library-onednn
7stdenv.mkDerivation rec {
8 pname = "dnnl";
9+ version = "1.4";
1011 src = fetchFromGitHub {
12+ owner = "oneapi-src";
13+ repo = "oneDNN";
14 rev = "v${version}";
15+ sha256 = "162fb0c7klahz2irchhyxympi4fq4yp284apc53cadbss41mzld9";
16 };
00000001718 outputs = [ "out" "dev" "doc" ];
19···33 '';
3435 meta = with lib; {
36+ description = "oneAPI Deep Neural Network Library (oneDNN)";
37+ homepage = "https://01.org/dnnl";
38+ changelog = "https://github.com/oneapi-src/oneDNN/releases/tag/v${version}";
39 license = licenses.asl20;
40 platforms = [ "x86_64-linux" ];
41 maintainers = with maintainers; [ alexarice bhipple ];
···1+{ stdenv, buildPythonPackage, fetchFromGitHub, requests }:
2+3+buildPythonPackage rec {
4+ pname = "publicsuffix2";
5+ version = "2.20191221";
6+7+ # Tests are missing in the sdist
8+ # See: https://github.com/nexB/python-publicsuffix2/issues/12
9+ src = fetchFromGitHub {
10+ owner = "nexB";
11+ repo = "python-publicsuffix2";
12+ rev = "release-2.2019-12-21";
13+ sha256 = "1dkvfvl0izq9hqzilnw8ipkbgjs9xyad9p21i3864hzinbh0wp9r";
14+ };
15+16+ nativeBuildInputs = [ requests ];
17+18+ meta = with stdenv.lib; {
19+ description = ''
20+ Get a public suffix for a domain name using the Public Suffix
21+ List. Forked from and using the same API as the publicsuffix package.
22+ '';
23+ homepage = "https://pypi.python.org/pypi/publicsuffix2/";
24+ license = licenses.mpl20;
25+ };
26+}
···141 # # provided here verbatim for the convenience of anyone wanting to build
142 # # Asterisk from other sources. Include in externals.
143 # "sounds/asterisk-core-sounds-en-gsm-1.5.tar.gz" = fetchurl {
144- # url = http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en-gsm-1.5.tar.gz;
145 # sha256 = "01xzbg7xy0c5zg7sixjw5025pvr4z64kfzi9zvx19im0w331h4cd";
146 # };
147 # "sounds/asterisk-moh-opsound-wav-2.03.tar.gz" = fetchurl {
148- # url = http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-moh-opsound-wav-2.03.tar.gz;
149 # sha256 = "449fb810d16502c3052fedf02f7e77b36206ac5a145f3dacf4177843a2fcb538";
150 # };
151 # # TODO: Sounds for other languages could be added here
···141 # # provided here verbatim for the convenience of anyone wanting to build
142 # # Asterisk from other sources. Include in externals.
143 # "sounds/asterisk-core-sounds-en-gsm-1.5.tar.gz" = fetchurl {
144+ # url = "http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en-gsm-1.5.tar.gz";
145 # sha256 = "01xzbg7xy0c5zg7sixjw5025pvr4z64kfzi9zvx19im0w331h4cd";
146 # };
147 # "sounds/asterisk-moh-opsound-wav-2.03.tar.gz" = fetchurl {
148+ # url = "http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-moh-opsound-wav-2.03.tar.gz";
149 # sha256 = "449fb810d16502c3052fedf02f7e77b36206ac5a145f3dacf4177843a2fcb538";
150 # };
151 # # TODO: Sounds for other languages could be added here
+34
pkgs/servers/dns/https-dns-proxy/default.nix
···0000000000000000000000000000000000
···1+{ stdenv, fetchFromGitHub, cmake, gtest, c-ares, curl, libev }:
2+3+stdenv.mkDerivation rec {
4+ pname = "https-dns-proxy";
5+ # there are no stable releases (yet?)
6+ version = "unstable-20200419";
7+8+ src = fetchFromGitHub {
9+ owner = "aarond10";
10+ repo = "https_dns_proxy";
11+ rev = "79fc7b085e3b1ad64c8332f7115dfe2bf5f1f3e4";
12+ sha256 = "1cdfswfjby4alp6gy7yyjm76kfyclh5ax0zadnqs2pyigg9plh0b";
13+ };
14+15+ nativeBuildInputs = [ cmake gtest ];
16+17+ buildInputs = [ c-ares curl libev ];
18+19+ installPhase = ''
20+ install -Dm555 -t $out/bin https_dns_proxy
21+ install -Dm444 -t $out/share/doc/${pname} ../{LICENSE,README}.*
22+ '';
23+24+ # upstream wants to add tests and the gtest framework is in place, so be ready
25+ # for when that happens despite there being none as of right now
26+ doCheck = true;
27+28+ meta = with stdenv.lib; {
29+ description = "DNS to DNS over HTTPS (DoH) proxy";
30+ license = licenses.mit;
31+ maintainers = with maintainers; [ peterhoeg ];
32+ platforms = platforms.linux;
33+ };
34+}