From caa08508100ce2307a4c64ff047241572ff85b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 24 Mar 2019 23:59:04 +0100 Subject: Upgrade mysql and postgresql --- nixops/modules/databases/mysql.nix | 3 ++- nixops/modules/databases/postgresql.nix | 40 ++++++++++++++++++++------------- 2 files changed, 27 insertions(+), 16 deletions(-) (limited to 'nixops/modules/databases') diff --git a/nixops/modules/databases/mysql.nix b/nixops/modules/databases/mysql.nix index 635f212..39d25d3 100644 --- a/nixops/modules/databases/mysql.nix +++ b/nixops/modules/databases/mysql.nix @@ -1,5 +1,6 @@ -{ lib, pkgs, config, myconfig, mylibs, ... }: +{ lib, pkgs, pkgsNext, config, myconfig, mylibs, ... }: let + pkgs = pkgsNext.appendOverlays config.nixpkgs.overlays; cfg = config.services.myDatabases; in { options.services.myDatabases = { diff --git a/nixops/modules/databases/postgresql.nix b/nixops/modules/databases/postgresql.nix index f839d63..7046b45 100644 --- a/nixops/modules/databases/postgresql.nix +++ b/nixops/modules/databases/postgresql.nix @@ -1,5 +1,6 @@ -{ lib, pkgs, config, myconfig, mylibs, ... }: +{ lib, pkgs, pkgsNext, config, myconfig, mylibs, ... }: let + pkgs = pkgsNext.appendOverlays config.nixpkgs.overlays; cfg = config.services.myDatabases; in { options.services.myDatabases = { @@ -15,20 +16,29 @@ in { config = lib.mkIf cfg.enable { nixpkgs.overlays = [ (self: super: rec { - postgresql = postgresql111; - postgresql111 = super.postgresql100.overrideAttrs(old: rec { - passthru = old.passthru // { psqlSchema = "11.0"; }; - name = "postgresql-11.1"; - src = self.fetchurl { - url = "mirror://postgresql/source/v11.1/${name}.tar.bz2"; - sha256 = "026v0sicsh7avzi45waf8shcbhivyxmi7qgn9fd1x0vl520mx0ch"; - }; - configureFlags = old.configureFlags ++ [ "--with-pam" ]; - buildInputs = (old.buildInputs or []) ++ [ self.pam ]; - patches = old.patches ++ [ - ./postgresql_run_socket_path.patch - ]; - }); + postgresql = postgresql_11; + postgresql_11 = if builtins.hasAttr "postgresql_11" super + then super.postgresql_11.overrideAttrs(old: rec { + passthru = old.passthru // { psqlSchema = "11.0"; }; + configureFlags = old.configureFlags ++ [ "--with-pam" ]; + buildInputs = (old.buildInputs or []) ++ [ self.pam ]; + patches = old.patches ++ [ + ./postgresql_run_socket_path.patch + ]; + }) + else super.postgresql100.overrideAttrs(old: rec { + passthru = old.passthru // { psqlSchema = "11.0"; }; + name = "postgresql-11.1"; + src = self.fetchurl { + url = "mirror://postgresql/source/v11.1/${name}.tar.bz2"; + sha256 = "026v0sicsh7avzi45waf8shcbhivyxmi7qgn9fd1x0vl520mx0ch"; + }; + configureFlags = old.configureFlags ++ [ "--with-pam" ]; + buildInputs = (old.buildInputs or []) ++ [ self.pam ]; + patches = old.patches ++ [ + ./postgresql_run_socket_path.patch + ]; + }); }) ]; networking.firewall.allowedTCPPorts = [ 5432 ]; -- cgit v1.2.3