Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b0c285807d6a
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5bf91db519cb
Choose a head ref
Loading
Showing with 4,251 additions and 1,680 deletions.
  1. +6 −0 maintainers/maintainer-list.nix
  2. +61 −1 nixos/doc/manual/release-notes/rl-2003.xml
  3. +1 −1 nixos/lib/make-options-doc/default.nix
  4. +2 −2 nixos/modules/misc/ids.nix
  5. +1 −1 nixos/modules/security/acme.nix
  6. +31 −2 nixos/modules/services/continuous-integration/hydra/default.nix
  7. +76 −27 nixos/modules/services/databases/postgresql.xml
  8. +25 −1 nixos/modules/services/networking/haproxy.nix
  9. +1 −1 nixos/modules/services/web-apps/moinmoin.nix
  10. +2 −2 nixos/modules/services/web-apps/nextcloud.nix
  11. +1 −0 nixos/modules/services/web-servers/phpfpm/default.nix
  12. +1 −0 nixos/modules/services/x11/desktop-managers/xfce.nix
  13. +4 −1 nixos/modules/services/x11/display-managers/default.nix
  14. +12 −6 nixos/modules/tasks/network-interfaces-scripted.nix
  15. +7 −4 nixos/modules/virtualisation/libvirtd.nix
  16. +5 −1 nixos/tests/all-tests.nix
  17. +47 −0 nixos/tests/hydra/common.nix
  18. +86 −0 nixos/tests/hydra/db-migration.nix
  19. +46 −91 nixos/tests/hydra/default.nix
  20. +2 −0 nixos/tests/os-prober.nix
  21. +16 −3 nixos/tests/postgresql-wal-receiver.nix
  22. +2 −2 pkgs/applications/audio/lollypop/default.nix
  23. +1 −1 pkgs/applications/kde/fetch.sh
  24. +864 −864 pkgs/applications/kde/srcs.nix
  25. +47 −0 pkgs/applications/misc/cura/lulzbot/curaengine-openmp-compat.patch
  26. +2 −0 pkgs/applications/misc/cura/lulzbot/curaengine.nix
  27. +2 −2 pkgs/applications/networking/browsers/brave/default.nix
  28. +10 −0 pkgs/applications/networking/browsers/chromium/browser.nix
  29. +17 −2 pkgs/applications/networking/browsers/chromium/common.nix
  30. +2 −1 pkgs/applications/networking/browsers/chromium/default.nix
  31. +9 −9 pkgs/applications/networking/browsers/chromium/upstream-info.nix
  32. +3 −3 pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix
  33. +1 −1 pkgs/applications/networking/instant-messengers/riot/riot-desktop-package.json
  34. +4 −4 pkgs/applications/networking/instant-messengers/riot/riot-desktop-yarndeps.nix
  35. +3 −3 pkgs/applications/networking/instant-messengers/riot/riot-desktop.nix
  36. +2 −2 pkgs/applications/networking/instant-messengers/riot/riot-web.nix
  37. +2 −1 pkgs/applications/networking/instant-messengers/skypeforlinux/default.nix
  38. +8 −16 pkgs/applications/office/elementary-planner/default.nix
  39. +4 −3 pkgs/applications/office/zotero/default.nix
  40. +17 −7 pkgs/applications/science/logic/monosat/default.nix
  41. +2 −2 pkgs/applications/version-management/gitea/default.nix
  42. +2 −2 pkgs/build-support/vm/default.nix
  43. +2 −2 pkgs/desktops/xfce/panel-plugins/xfce4-hardware-monitor-plugin.nix
  44. +2 −2 pkgs/desktops/xfce/panel-plugins/xfce4-whiskermenu-plugin/default.nix
  45. +2 −2 pkgs/development/compilers/ghc/8.4.4.nix
  46. +12 −4 pkgs/development/coq-modules/coqhammer/default.nix
  47. +16 −9 pkgs/development/coq-modules/paramcoq/default.nix
  48. +9 −9 pkgs/development/interpreters/ruby/default.nix
  49. +6 −3 pkgs/development/interpreters/ruby/patchsets.nix
  50. +2 −2 pkgs/development/interpreters/ruby/rvm-patchsets.nix
  51. +11 −0 pkgs/development/libraries/exiv2/default.nix
  52. +2 −2 pkgs/development/libraries/flatpak/default.nix
  53. +1 −1 pkgs/development/libraries/libdap/default.nix
  54. +136 −0 pkgs/development/libraries/libvirt/5.9.0.nix
  55. +12 −38 pkgs/development/libraries/libvirt/default.nix
  56. +0 −19 pkgs/development/libraries/loadcaffe/default.nix
  57. +28 −0 pkgs/development/libraries/nvidia-optical-flow-sdk/default.nix
  58. +4 −2 pkgs/development/libraries/opencv/4.x.nix
  59. +26 −0 pkgs/development/libraries/opencv/cuda_opt_flow.patch
  60. +22 −1 pkgs/development/libraries/qgnomeplatform/default.nix
  61. +24 −0 pkgs/development/libraries/qgnomeplatform/hardcode-gsettings.patch
  62. +0 −19 pkgs/development/libraries/torch-hdf5/default.nix
  63. +0 −38 pkgs/development/libraries/torch/default.nix
  64. +2 −2 pkgs/development/ocaml-modules/batteries/default.nix
  65. +11 −6 pkgs/development/python-modules/application/default.nix
  66. +3 −2 pkgs/development/python-modules/ftputil/default.nix
  67. +27 −0 pkgs/development/python-modules/libvirt/5.9.0.nix
  68. +2 −2 pkgs/development/python-modules/libvirt/default.nix
  69. +6 −5 pkgs/development/python-modules/ntlm-auth/default.nix
  70. +5 −2 pkgs/development/python-modules/python-otr/default.nix
  71. +9 −3 pkgs/development/python-modules/pywinrm/default.nix
  72. +58 −11 pkgs/development/python-modules/scikit-build/default.nix
  73. +4 −2 pkgs/development/python-modules/tensorflow-estimator/{ → 1}/default.nix
  74. +27 −0 pkgs/development/python-modules/tensorflow-estimator/2/default.nix
  75. 0 pkgs/development/python-modules/tensorflow-tensorboard/{ → 1}/default.nix
  76. +68 −0 pkgs/development/python-modules/tensorflow-tensorboard/2/default.nix
  77. +2 −2 pkgs/development/python-modules/tensorflow/{ → 1}/bin.nix
  78. 0 pkgs/development/python-modules/tensorflow/{ → 1}/binary-hashes.nix
  79. +16 −11 pkgs/development/python-modules/tensorflow/{ → 1}/default.nix
  80. 0 pkgs/development/python-modules/tensorflow/{ → 1}/lift-gast-restriction.patch
  81. 0 pkgs/development/python-modules/tensorflow/{ → 1}/prefetcher.sh
  82. +179 −0 pkgs/development/python-modules/tensorflow/2/bin.nix
  83. +51 −0 pkgs/development/python-modules/tensorflow/2/binary-hashes.nix
  84. +430 −0 pkgs/development/python-modules/tensorflow/2/default.nix
  85. +11 −0 pkgs/development/python-modules/tensorflow/2/lift-gast-restriction.patch
  86. +44 −0 pkgs/development/python-modules/tensorflow/2/prefetcher.sh
  87. +6 −9 pkgs/development/python-modules/zetup/default.nix
  88. 0 pkgs/development/tools/build-managers/bazel/{bazel_0 → bazel_0_26}/default.nix
  89. 0 pkgs/development/tools/build-managers/bazel/{bazel_0 → bazel_0_26}/glibc.patch
  90. 0 pkgs/development/tools/build-managers/bazel/{bazel_0 → bazel_0_26}/python-stub-path-fix.patch
  91. +559 −0 pkgs/development/tools/build-managers/bazel/bazel_0_29/default.nix
  92. +78 −0 pkgs/development/tools/build-managers/bazel/bazel_0_29/glibc.patch
  93. +506 −0 pkgs/development/tools/build-managers/bazel/bazel_0_29/src-deps.json
  94. +2 −2 pkgs/development/tools/build-managers/bazel/bazel_1/default.nix
  95. +2 −2 pkgs/development/tools/build-managers/bazel/{bazel-latest → bazel_2}/default.nix
  96. 0 pkgs/development/tools/build-managers/bazel/{bazel-latest → bazel_2}/src-deps.json
  97. +2 −2 pkgs/development/tools/continuous-integration/jenkins/default.nix
  98. +40 −0 pkgs/development/tools/hobbes/default.nix
  99. +134 −0 pkgs/development/tools/misc/hydra/common.nix
  100. +36 −137 pkgs/development/tools/misc/hydra/default.nix
  101. +4 −4 pkgs/development/tools/rust/cargo-make/Cargo.lock
  102. +3 −3 pkgs/development/tools/rust/cargo-make/default.nix
  103. +2 −2 pkgs/os-specific/linux/kernel/linux-4.14.nix
  104. +2 −2 pkgs/os-specific/linux/kernel/linux-4.19.nix
  105. +2 −2 pkgs/os-specific/linux/kernel/linux-4.4.nix
  106. +2 −2 pkgs/os-specific/linux/kernel/linux-4.9.nix
  107. +2 −2 pkgs/os-specific/linux/kernel/linux-5.4.nix
  108. +2 −2 pkgs/os-specific/linux/kernel/linux-5.5.nix
  109. +4 −3 pkgs/os-specific/linux/kernel/linux-libre.nix
  110. +2 −2 pkgs/os-specific/linux/wireguard/default.nix
  111. +2 −2 pkgs/servers/matrix-synapse/default.nix
  112. +2 −2 pkgs/servers/nextcloud/default.nix
  113. +1 −1 pkgs/servers/pulseaudio/default.nix
  114. +1 −1 pkgs/servers/rt/default.nix
  115. +1 −0 pkgs/servers/sql/mariadb/connector-c/default.nix
  116. +4 −4 pkgs/tools/admin/bubblewrap/default.nix
  117. +0 −63 pkgs/tools/graphics/fast-neural-doodle/default.nix
  118. +0 −28 pkgs/tools/graphics/fast-neural-doodle/fast-neural-doodle.sh
  119. +0 −5 pkgs/tools/graphics/fast-neural-doodle/get-mask-hdf5.sh
  120. +0 −58 pkgs/tools/graphics/neural-style/default.nix
  121. +0 −25 pkgs/tools/graphics/neural-style/neural-style.sh
  122. +3 −3 pkgs/tools/networking/pirate-get/default.nix
  123. +3 −3 pkgs/tools/nix/nix-script/default.nix
  124. +3 −2 pkgs/tools/package-management/packagekit/default.nix
  125. +2 −2 pkgs/tools/security/scallion/default.nix
  126. +2 −1 pkgs/tools/typesetting/tex/texlive/combine.nix
  127. +9 −2 pkgs/top-level/aliases.nix
  128. +25 −18 pkgs/top-level/all-packages.nix
  129. +1 −1 pkgs/top-level/make-tarball.nix
  130. +52 −6 pkgs/top-level/perl-packages.nix
  131. +41 −7 pkgs/top-level/python-packages.nix
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
@@ -7137,6 +7137,12 @@
githubId = 844343;
name = "Thiago K. Okada";
};
thmzlt = {
email = "git@thomazleite.com";
github = "thmzlt";
githubId = 7709;
name = "Thomaz Leite";
};
ThomasMader = {
email = "thomas.mader@gmail.com";
github = "ThomasMader";
62 changes: 61 additions & 1 deletion nixos/doc/manual/release-notes/rl-2003.xml
Original file line number Diff line number Diff line change
@@ -485,7 +485,7 @@ services.xserver.displayManager.defaultSession = "xfce+icewm";
<listitem>
<para>
The <literal>buildRustCrate</literal> infrastructure now produces <literal>lib</literal> outputs in addition to the <literal>out</literal> output.
This has led to drastically reduced closed sizes for some rust crates since development dependencies are now in the <literal>lib</literal> output.
This has led to drastically reduced closure sizes for some rust crates since development dependencies are now in the <literal>lib</literal> output.
</para>
</listitem>
<listitem>
@@ -947,6 +947,66 @@ auth required pam_succeed_if.so uid >= 1000 quiet
</para>
</warning>
</listitem>
<listitem>
<para>
<package>Hydra</package> has gained a massive performance improvement due to
<link xlink:href="https://github.com/NixOS/hydra/pull/710">some database schema
changes</link> by adding several IDs and better indexing. However, it's necessary
to upgrade Hydra in multiple steps:
<itemizedlist>
<listitem>
<para>
At first, an older version of Hydra needs to be deployed which adds those
(nullable) columns. When having set <link linkend="opt-system.stateVersion">stateVersion
</link> to a value older than <literal>20.03</literal>, this package will be selected
by default from the module when upgrading. Otherwise, the package can be deployed using
the following config:
<programlisting>{ pkgs, ... }: {
<link linkend="opt-services.hydra.package">services.hydra.package</link> = pkgs.hydra-migration;
}</programlisting>
</para>
</listitem>
<listitem>
<para>
Automatically fill the newly added ID columns on the server by running the following
command:
<screen>
<prompt>$ </prompt>hydra-backfill-ids
</screen>
<warning>
<para>Please note that this process can take a while depending on your database-size!</para>
</warning>
</para>
</listitem>
<listitem>
<para>
Deploy a newer version of Hydra to activate the DB optimizations. You can choose from
either <package>hydra-unstable</package> (latest <literal>master</literal> compiled
against <package>nixUnstable</package>) and <package>hydra-flakes</package> (latest
version with flake-support).
<warning>
<para>
If your <link linkend="opt-system.stateVersion">stateVersion</link> is set to
<literal>20.03</literal> or greater, <package>hydra-unstable</package> will be used
automatically! This will break your setup if you didn't run the migration.
</para>
</warning>
Please note that Hydra is currently not available with <package>nixStable</package>
as this doesn't compile anymore.
</para>
</listitem>
</itemizedlist>
<warning>
<para>
<package>pkgs.hydra</package> has been removed to ensure a graceful database-migration
using the dedicated package-attributes. If you still have <package>pkgs.hydra</package>
defined in e.g. an overlay, an assertion error will be thrown. To circumvent this,
you need to set <xref linkend="opt-services.hydra.package" /> to <package>pkgs.hydra</package>
explicitly and make sure you know what you're doing!
</para>
</warning>
</para>
</listitem>
</itemizedlist>
</section>

2 changes: 1 addition & 1 deletion nixos/lib/make-options-doc/default.nix
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ let
optionsList = lib.sort optionLess optionsListDesc;

# Convert the list of options into an XML file.
optionsXML = pkgs.writeText "options.xml" (builtins.toXML optionsList);
optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList);

optionsNix = builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList);

4 changes: 2 additions & 2 deletions nixos/modules/misc/ids.nix
Original file line number Diff line number Diff line change
@@ -133,7 +133,7 @@ in
tcpcryptd = 93; # tcpcryptd uses a hard-coded uid. We patch it in Nixpkgs to match this choice.
firebird = 95;
#keys = 96; # unused
#haproxy = 97; # DynamicUser as of 2019-11-08
#haproxy = 97; # dynamically allocated as of 2020-03-11
mongodb = 98;
openldap = 99;
#users = 100; # unused
@@ -448,7 +448,7 @@ in
#tcpcryptd = 93; # unused
firebird = 95;
keys = 96;
#haproxy = 97; # DynamicUser as of 2019-11-08
#haproxy = 97; # dynamically allocated as of 2020-03-11
#mongodb = 98; # unused
openldap = 99;
munin = 102;
2 changes: 1 addition & 1 deletion nixos/modules/security/acme.nix
Original file line number Diff line number Diff line change
@@ -294,7 +294,7 @@ in
description = "Renew ACME Certificate for ${cert}";
after = [ "network.target" "network-online.target" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
wantedBy = mkIf (!config.boot.isContainer) [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
# With RemainAfterExit the service is considered active even
33 changes: 31 additions & 2 deletions nixos/modules/services/continuous-integration/hydra/default.nix
Original file line number Diff line number Diff line change
@@ -37,6 +37,8 @@ let

haveLocalDB = cfg.dbi == localDB;

inherit (config.system) stateVersion;

in

{
@@ -63,8 +65,7 @@ in
};

package = mkOption {
type = types.path;
default = pkgs.hydra;
type = types.package;
defaultText = "pkgs.hydra";
description = "The Hydra package.";
};
@@ -194,6 +195,34 @@ in

config = mkIf cfg.enable {

warnings = optional (cfg.package.migration or false) ''
You're currently deploying an older version of Hydra which is needed to
make some required database changes[1]. As soon as this is done, it's recommended
to run `hydra-backfill-ids` and set `services.hydra.package` to either `pkgs.hydra-unstable`
or `pkgs.hydra-flakes` after that.
[1] https://github.com/NixOS/hydra/pull/711
'';

services.hydra.package = with pkgs;
mkDefault (
if pkgs ? hydra
then throw ''
The Hydra package doesn't exist anymore in `nixpkgs`! It probably exists
due to an overlay. To upgrade Hydra, you need to take two steps as some
bigger changes in the database schema were implemented recently[1]. You first
need to deploy `pkgs.hydra-migration`, run `hydra-backfill-ids` on the server
and then deploy either `pkgs.hydra-unstable` or `pkgs.hydra-flakes`.
If you want to use `pkgs.hydra` from your overlay, please set `services.hydra.package`
explicitly to `pkgs.hydra` and make sure you know what you're doing.
[1] https://github.com/NixOS/hydra/pull/711
''
else if versionOlder stateVersion "20.03" then hydra-migration
else hydra-unstable
);

users.groups.hydra = {
gid = config.ids.gids.hydra;
};
103 changes: 76 additions & 27 deletions nixos/modules/services/databases/postgresql.xml
Original file line number Diff line number Diff line change
@@ -7,12 +7,10 @@
<!-- FIXME: render nicely -->
<!-- FIXME: source can be added automatically -->
<para>
<emphasis>Source:</emphasis>
<filename>modules/services/databases/postgresql.nix</filename>
<emphasis>Source:</emphasis> <filename>modules/services/databases/postgresql.nix</filename>
</para>
<para>
<emphasis>Upstream documentation:</emphasis>
<link xlink:href="http://www.postgresql.org/docs/"/>
<emphasis>Upstream documentation:</emphasis> <link xlink:href="http://www.postgresql.org/docs/"/>
</para>
<!-- FIXME: more stuff, like maintainer? -->
<para>
@@ -23,18 +21,12 @@
<title>Configuring</title>

<para>
To enable PostgreSQL, add the following to your
<filename>configuration.nix</filename>:
To enable PostgreSQL, add the following to your <filename>configuration.nix</filename>:
<programlisting>
<xref linkend="opt-services.postgresql.enable"/> = true;
<xref linkend="opt-services.postgresql.package"/> = pkgs.postgresql_11;
</programlisting>
Note that you are required to specify the desired version of PostgreSQL
(e.g. <literal>pkgs.postgresql_11</literal>). Since upgrading your
PostgreSQL version requires a database dump and reload (see below), NixOS
cannot provide a default value for
<xref linkend="opt-services.postgresql.package"/> such as the most recent
release of PostgreSQL.
Note that you are required to specify the desired version of PostgreSQL (e.g. <literal>pkgs.postgresql_11</literal>). Since upgrading your PostgreSQL version requires a database dump and reload (see below), NixOS cannot provide a default value for <xref linkend="opt-services.postgresql.package"/> such as the most recent release of PostgreSQL.
</para>

<!--
@@ -51,9 +43,7 @@ Type "help" for help.
-->

<para>
By default, PostgreSQL stores its databases in
<filename>/var/lib/postgresql/$psqlSchema</filename>. You can override this using
<xref linkend="opt-services.postgresql.dataDir"/>, e.g.
By default, PostgreSQL stores its databases in <filename>/var/lib/postgresql/$psqlSchema</filename>. You can override this using <xref linkend="opt-services.postgresql.dataDir"/>, e.g.
<programlisting>
<xref linkend="opt-services.postgresql.dataDir"/> = "/data/postgresql";
</programlisting>
@@ -63,25 +53,83 @@ Type "help" for help.
<title>Upgrading</title>

<para>
FIXME: document dump/upgrade/load cycle.
Major PostgreSQL upgrade requires PostgreSQL downtime and a few imperative steps to be called. To simplify this process, use the following NixOS module:
<programlisting>
containers.temp-pg.config.services.postgresql = {
enable = true;
package = pkgs.postgresql_12;
## set a custom new dataDir
# dataDir = "/some/data/dir";
};
environment.systemPackages =
let newpg = config.containers.temp-pg.config.services.postgresql;
in [
(pkgs.writeScriptBin "upgrade-pg-cluster" ''
set -x
export OLDDATA="${config.services.postgresql.dataDir}"
export NEWDATA="${newpg.dataDir}"
export OLDBIN="${config.services.postgresql.package}/bin"
export NEWBIN="${newpg.package}/bin"

install -d -m 0700 -o postgres -g postgres "$NEWDATA"
cd "$NEWDATA"
sudo -u postgres $NEWBIN/initdb -D "$NEWDATA"

systemctl stop postgresql # old one

sudo -u postgres $NEWBIN/pg_upgrade \
--old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \
--old-bindir $OLDBIN --new-bindir $NEWBIN \
"$@"
'')
];
</programlisting>
</para>

<para>
The upgrade process is:
</para>

<orderedlist>
<listitem>
<para>
Rebuild nixos configuration with the configuration above added to your <filename>configuration.nix</filename>. Alternatively, add that into separate file and reference it in <literal>imports</literal> list.
</para>
</listitem>
<listitem>
<para>
Login as root (<literal>sudo su -</literal>)
</para>
</listitem>
<listitem>
<para>
Run <literal>upgrade-pg-cluster</literal>. It will stop old postgresql, initialize new one and migrate old one to new one. You may supply arguments like <literal>--jobs 4</literal> and <literal>--link</literal> to speedup migration process. See <link xlink:href="https://www.postgresql.org/docs/current/pgupgrade.html" /> for details.
</para>
</listitem>
<listitem>
<para>
Change postgresql package in NixOS configuration to the one you were upgrading to, and change <literal>dataDir</literal> to the one you have migrated to. Rebuild NixOS. This should start new postgres using upgraded data directory.
</para>
</listitem>
<listitem>
<para>
After upgrade you may want to <literal>ANALYZE</literal> new db.
</para>
</listitem>
</orderedlist>
</section>
<section xml:id="module-services-postgres-options">
<title>Options</title>

<para>
A complete list of options for the PostgreSQL module may be found
<link linkend="opt-services.postgresql.enable">here</link>.
A complete list of options for the PostgreSQL module may be found <link linkend="opt-services.postgresql.enable">here</link>.
</para>
</section>
<section xml:id="module-services-postgres-plugins">
<title>Plugins</title>

<para>
Plugins collection for each PostgreSQL version can be accessed with
<literal>.pkgs</literal>. For example, for
<literal>pkgs.postgresql_11</literal> package, its plugin collection is
accessed by <literal>pkgs.postgresql_11.pkgs</literal>:
Plugins collection for each PostgreSQL version can be accessed with <literal>.pkgs</literal>. For example, for <literal>pkgs.postgresql_11</literal> package, its plugin collection is accessed by <literal>pkgs.postgresql_11.pkgs</literal>:
<screen>
<prompt>$ </prompt>nix repl '&lt;nixpkgs&gt;'

@@ -98,8 +146,9 @@ postgresql_11.pkgs.pg_partman postgresql_11.pkgs.pgroonga
...
</screen>
</para>

<para>
To add plugins via NixOS configuration, set <literal>services.postgresql.extraPlugins</literal>:
To add plugins via NixOS configuration, set <literal>services.postgresql.extraPlugins</literal>:
<programlisting>
<xref linkend="opt-services.postgresql.package"/> = pkgs.postgresql_11;
<xref linkend="opt-services.postgresql.extraPlugins"/> = with pkgs.postgresql_11.pkgs; [
@@ -108,10 +157,9 @@ postgresql_11.pkgs.pg_partman postgresql_11.pkgs.pgroonga
];
</programlisting>
</para>

<para>
You can build custom PostgreSQL-with-plugins (to be used outside of NixOS) using
function <literal>.withPackages</literal>. For example, creating a custom
PostgreSQL package in an overlay can look like:
You can build custom PostgreSQL-with-plugins (to be used outside of NixOS) using function <literal>.withPackages</literal>. For example, creating a custom PostgreSQL package in an overlay can look like:
<programlisting>
self: super: {
postgresql_custom = self.postgresql_11.withPackages (ps: [
@@ -121,8 +169,9 @@ self: super: {
}
</programlisting>
</para>

<para>
Here's a recipe on how to override a particular plugin through an overlay:
Here's a recipe on how to override a particular plugin through an overlay:
<programlisting>
self: super: {
postgresql_11 = super.postgresql_11.override { this = self.postgresql_11; } // {
26 changes: 25 additions & 1 deletion nixos/modules/services/networking/haproxy.nix
Original file line number Diff line number Diff line change
@@ -26,6 +26,18 @@ with lib;
'';
};

user = mkOption {
type = types.str;
default = "haproxy";
description = "User account under which haproxy runs.";
};

group = mkOption {
type = types.str;
default = "haproxy";
description = "Group account under which haproxy runs.";
};

config = mkOption {
type = types.nullOr types.lines;
default = null;
@@ -49,7 +61,8 @@ with lib;
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
DynamicUser = true;
User = cfg.user;
Group = cfg.group;
Type = "notify";
# when running the config test, don't be quiet so we can see what goes wrong
ExecStartPre = "${pkgs.haproxy}/sbin/haproxy -c -f ${haproxyCfg}";
@@ -60,5 +73,16 @@ with lib;
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
};
};

users.users = optionalAttrs (cfg.user == "haproxy") {
haproxy = {
group = cfg.group;
isSystemUser = true;
};
};

users.groups = optionalAttrs (cfg.group == "haproxy") {
haproxy = {};
};
};
}
Loading