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: 1741386f85cd
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: 4e674aa15783
Choose a head ref

Commits on Mar 28, 2019

  1. Copy the full SHA
    44a798e View commit details
  2. Copy the full SHA
    7f3d0ae View commit details

Commits on May 12, 2019

  1. Copy the full SHA
    73d64d4 View commit details

Commits on May 19, 2019

  1. Copy the full SHA
    915c2de View commit details
  2. Copy the full SHA
    15a2343 View commit details

Commits on May 20, 2019

  1. Copy the full SHA
    c03630a View commit details
  2. rustc: 1.34.0 -> 1.34.2, security (#61699)

    rustc: 1.34.0 -> 1.34.2, security
    Mic92 authored May 20, 2019
    Copy the full SHA
    75bc436 View commit details
  3. Merge pull request #61731 from dtzWill/feature/redhat-official-fonts

    redhat-official-fonts: init at 2.2.0
    dtzWill authored May 20, 2019
    Copy the full SHA
    e841e44 View commit details
  4. Merge pull request #61713 from dtzWill/update/minify-2.5.0

    minify: 2.0.0 -> 2.5.0, module
    dtzWill authored May 20, 2019
    Copy the full SHA
    b8e578d View commit details
  5. solc: 0.5.7 -> 0.5.8

    Also add more complete set of tests and disable shared build on MacOS.
    sifmelcara authored and Lassulus committed May 20, 2019
    Copy the full SHA
    883d626 View commit details
  6. Copy the full SHA
    9d8c27e View commit details
  7. Copy the full SHA
    a3e7e1b View commit details
  8. nixos/postgresql: add ensureDatabases & ensureUsers options (#56720)

    nixos/postgresql: add ensureDatabases & ensureUsers options
    flokli authored May 20, 2019
    Copy the full SHA
    cd96b50 View commit details
  9. Sylk: init at 2.1.0

    zimbatm committed May 20, 2019
    Copy the full SHA
    baac84c View commit details
  10. xinetd: exec xinetd on launch

    I noticed xinetd process doesn't get exec'd on launch, exec here so the bash
    process doesn't stick around.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 authored and zimbatm committed May 20, 2019
    Copy the full SHA
    9a81e9c View commit details
  11. pijul: 0.11.0 -> 0.12.0

    https://pijul.org/posts/2019-04-23-pijul-0.12/
    
    * add new dep on nettle, all the crypto libraries :)
    * libclang needed
    * clang input is not quite right AFAIK, but fixes the build.
      idea from other package,
      seems to resolve problems finding headers via libclang?
    dtzWill authored and zimbatm committed May 20, 2019
    Copy the full SHA
    11fc767 View commit details
  12. Copy the full SHA
    115d1ba View commit details
  13. cri-o: init at version v1.14.1

    This commits adds the CRI-O package, which includes the `crio` binary as
    well as `conmon` and `pause`. The configuration is not part of this
    package because it would be included in a service.
    
    Signed-off-by: Sascha Grunert <mail@saschagrunert.de>
    saschagrunert authored and zimbatm committed May 20, 2019
    Copy the full SHA
    9b43c29 View commit details
  14. Merge pull request #61394 from msteen/openra

    openra: 20181215 -> 20190314 + updated other engine releases and mods
    aanderse authored May 20, 2019
    Copy the full SHA
    2256b56 View commit details
  15. maintainers: add juaningan

    oneingan authored and Robert Schütz committed May 20, 2019
    Copy the full SHA
    1a046e1 View commit details
  16. pythonPackages.pysonos: init at 0.0.13

    oneingan authored and Robert Schütz committed May 20, 2019
    Copy the full SHA
    912856f View commit details
  17. Merge pull request #61748 from dotlambda/pysonos

    home-assistant: add sonos component dependencies
    dotlambda authored May 20, 2019
    Copy the full SHA
    4e674aa View commit details
14 changes: 12 additions & 2 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
@@ -1746,13 +1746,13 @@
github = "fps";
name = "Florian Paul Schmidt";
};

fragamus = {
email = "innovative.engineer@gmail.com";
github = "fragamus";
name = "Michael Gough";
};

fredeb = {
email = "im@fredeb.dev";
github = "fredeeb";
@@ -2486,6 +2486,11 @@
github = "jtojnar";
name = "Jan Tojnar";
};
juaningan = {
email = "juaningan@gmail.com";
github = "juaningan";
name = "Juan Rodal";
};
juliendehos = {
email = "dehos@lisic.univ-littoral.fr";
github = "juliendehos";
@@ -4397,6 +4402,11 @@
github = "sargon";
name = "Daniel Ehlers";
};
saschagrunert = {
email = "mail@saschagrunert.de";
github = "saschagrunert";
name = "Sascha Grunert";
};
sauyon = {
email = "s@uyon.co";
github = "sauyon";
91 changes: 89 additions & 2 deletions nixos/modules/services/databases/postgresql.nix
Original file line number Diff line number Diff line change
@@ -105,6 +105,80 @@ in
'';
};

ensureDatabases = mkOption {
type = types.listOf types.str;
default = [];
description = ''
Ensures that the specified databases exist.
This option will never delete existing databases, especially not when the value of this
option is changed. This means that databases created once through this option or
otherwise have to be removed manually.
'';
example = [
"gitea"
"nextcloud"
];
};

ensureUsers = mkOption {
type = types.listOf (types.submodule {
options = {
name = mkOption {
type = types.str;
description = ''
Name of the user to ensure.
'';
};
ensurePermissions = mkOption {
type = types.attrsOf types.str;
default = {};
description = ''
Permissions to ensure for the user, specified as an attribute set.
The attribute names specify the database and tables to grant the permissions for.
The attribute values specify the permissions to grant. You may specify one or
multiple comma-separated SQL privileges here.
For more information on how to specify the target
and on which privileges exist, see the
<link xlink:href="https://www.postgresql.org/docs/current/sql-grant.html">GRANT syntax</link>.
The attributes are used as <code>GRANT ''${attrName} ON ''${attrValue}</code>.
'';
example = literalExample ''
{
"DATABASE nextcloud" = "ALL PRIVILEGES";
"ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
}
'';
};
};
});
default = [];
description = ''
Ensures that the specified users exist and have at least the ensured permissions.
The PostgreSQL users will be identified using peer authentication. This authenticates the Unix user with the
same name only, and that without the need for a password.
This option will never delete existing users or remove permissions, especially not when the value of this
option is changed. This means that users created and permissions assigned once through this option or
otherwise have to be removed manually.
'';
example = literalExample ''
[
{
name = "nextcloud";
ensurePermissions = {
"DATABASE nextcloud" = "ALL PRIVILEGES";
};
}
{
name = "superuser";
ensurePermissions = {
"ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
};
}
]
'';
};

enableTCPIP = mkOption {
type = types.bool;
default = false;
@@ -256,17 +330,30 @@ in
# Wait for PostgreSQL to be ready to accept connections.
postStart =
''
while ! ${pkgs.sudo}/bin/sudo -u ${cfg.superUser} psql --port=${toString cfg.port} -d postgres -c "" 2> /dev/null; do
PSQL="${pkgs.sudo}/bin/sudo -u ${cfg.superUser} psql --port=${toString cfg.port}"
while ! $PSQL -d postgres -c "" 2> /dev/null; do
if ! kill -0 "$MAINPID"; then exit 1; fi
sleep 0.1
done
if test -e "${cfg.dataDir}/.first_startup"; then
${optionalString (cfg.initialScript != null) ''
${pkgs.sudo}/bin/sudo -u ${cfg.superUser} psql -f "${cfg.initialScript}" --port=${toString cfg.port} -d postgres
$PSQL -f "${cfg.initialScript}" -d postgres
''}
rm -f "${cfg.dataDir}/.first_startup"
fi
'' + optionalString (cfg.ensureDatabases != []) ''
${concatMapStrings (database: ''
$PSQL -tAc "SELECT 1 FROM pg_database WHERE datname = '${database}'" | grep -q 1 || $PSQL -tAc "CREATE DATABASE ${database}"
'') cfg.ensureDatabases}
'' + ''
${concatMapStrings (user: ''
$PSQL -tAc "SELECT 1 FROM pg_roles WHERE rolname='${user.name}'" | grep -q 1 || $PSQL -tAc "CREATE USER ${user.name}"
${concatStringsSep "\n" (mapAttrsToList (database: permission: ''
$PSQL -tAc "GRANT ${permission} ON ${database} TO ${user.name}"
'') user.ensurePermissions)}
'') cfg.ensureUsers}
'';

unitConfig.RequiresMountsFor = "${cfg.dataDir}";
Loading