X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=nixops%2Fmodules%2Fdatabases%2Fpostgresql.nix;h=673ced872b23d0dc2a51248d1e613ac06f2dc2cf;hb=587b9e340bb5cb14ca55e62a0498295e702b56c5;hp=7046b4566c2b37dcfd4c6c5fe1e63b7d13f7ccab;hpb=caa08508100ce2307a4c64ff047241572ff85b45;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/nixops/modules/databases/postgresql.nix b/nixops/modules/databases/postgresql.nix index 7046b45..673ced8 100644 --- a/nixops/modules/databases/postgresql.nix +++ b/nixops/modules/databases/postgresql.nix @@ -1,6 +1,5 @@ -{ lib, pkgs, pkgsNext, config, myconfig, mylibs, ... }: +{ lib, pkgs, config, myconfig, mylibs, ... }: let - pkgs = pkgsNext.appendOverlays config.nixpkgs.overlays; cfg = config.services.myDatabases; in { options.services.myDatabases = { @@ -17,28 +16,14 @@ in { config = lib.mkIf cfg.enable { nixpkgs.overlays = [ (self: super: rec { 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 - ]; - }); + postgresql_11 = 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 + ]; + }); }) ]; networking.firewall.allowedTCPPorts = [ 5432 ];