aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules/databases
diff options
context:
space:
mode:
Diffstat (limited to 'nixops/modules/databases')
-rw-r--r--nixops/modules/databases/mysql.nix3
-rw-r--r--nixops/modules/databases/postgresql.nix40
2 files changed, 27 insertions, 16 deletions
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 @@
1{ lib, pkgs, config, myconfig, mylibs, ... }: 1{ lib, pkgs, pkgsNext, config, myconfig, mylibs, ... }:
2let 2let
3 pkgs = pkgsNext.appendOverlays config.nixpkgs.overlays;
3 cfg = config.services.myDatabases; 4 cfg = config.services.myDatabases;
4in { 5in {
5 options.services.myDatabases = { 6 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 @@
1{ lib, pkgs, config, myconfig, mylibs, ... }: 1{ lib, pkgs, pkgsNext, config, myconfig, mylibs, ... }:
2let 2let
3 pkgs = pkgsNext.appendOverlays config.nixpkgs.overlays;
3 cfg = config.services.myDatabases; 4 cfg = config.services.myDatabases;
4in { 5in {
5 options.services.myDatabases = { 6 options.services.myDatabases = {
@@ -15,20 +16,29 @@ in {
15 16
16 config = lib.mkIf cfg.enable { 17 config = lib.mkIf cfg.enable {
17 nixpkgs.overlays = [ (self: super: rec { 18 nixpkgs.overlays = [ (self: super: rec {
18 postgresql = postgresql111; 19 postgresql = postgresql_11;
19 postgresql111 = super.postgresql100.overrideAttrs(old: rec { 20 postgresql_11 = if builtins.hasAttr "postgresql_11" super
20 passthru = old.passthru // { psqlSchema = "11.0"; }; 21 then super.postgresql_11.overrideAttrs(old: rec {
21 name = "postgresql-11.1"; 22 passthru = old.passthru // { psqlSchema = "11.0"; };
22 src = self.fetchurl { 23 configureFlags = old.configureFlags ++ [ "--with-pam" ];
23 url = "mirror://postgresql/source/v11.1/${name}.tar.bz2"; 24 buildInputs = (old.buildInputs or []) ++ [ self.pam ];
24 sha256 = "026v0sicsh7avzi45waf8shcbhivyxmi7qgn9fd1x0vl520mx0ch"; 25 patches = old.patches ++ [
25 }; 26 ./postgresql_run_socket_path.patch
26 configureFlags = old.configureFlags ++ [ "--with-pam" ]; 27 ];
27 buildInputs = (old.buildInputs or []) ++ [ self.pam ]; 28 })
28 patches = old.patches ++ [ 29 else super.postgresql100.overrideAttrs(old: rec {
29 ./postgresql_run_socket_path.patch 30 passthru = old.passthru // { psqlSchema = "11.0"; };
30 ]; 31 name = "postgresql-11.1";
31 }); 32 src = self.fetchurl {
33 url = "mirror://postgresql/source/v11.1/${name}.tar.bz2";
34 sha256 = "026v0sicsh7avzi45waf8shcbhivyxmi7qgn9fd1x0vl520mx0ch";
35 };
36 configureFlags = old.configureFlags ++ [ "--with-pam" ];
37 buildInputs = (old.buildInputs or []) ++ [ self.pam ];
38 patches = old.patches ++ [
39 ./postgresql_run_socket_path.patch
40 ];
41 });
32 }) ]; 42 }) ];
33 43
34 networking.firewall.allowedTCPPorts = [ 5432 ]; 44 networking.firewall.allowedTCPPorts = [ 5432 ];