diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-04-10 01:22:16 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-04-10 01:22:16 +0200 |
commit | 9f16e659f129dd8acab7d086ef9822673a01ba06 (patch) | |
tree | e457a3aa743bf31f67d09ee9569bbda3cd5bf152 /modules/private/databases | |
parent | a071d8a6af7b8130047b3997c34b15f71089a4e5 (diff) | |
download | Nix-9f16e659f129dd8acab7d086ef9822673a01ba06.tar.gz Nix-9f16e659f129dd8acab7d086ef9822673a01ba06.tar.zst Nix-9f16e659f129dd8acab7d086ef9822673a01ba06.zip |
Stop using overlays in the middle of modules
Diffstat (limited to 'modules/private/databases')
-rw-r--r-- | modules/private/databases/default.nix | 4 | ||||
-rw-r--r-- | modules/private/databases/postgresql_replication.nix | 13 |
2 files changed, 8 insertions, 9 deletions
diff --git a/modules/private/databases/default.nix b/modules/private/databases/default.nix index c4a023a..6cd6feb 100644 --- a/modules/private/databases/default.nix +++ b/modules/private/databases/default.nix | |||
@@ -10,10 +10,6 @@ in | |||
10 | }; | 10 | }; |
11 | }; | 11 | }; |
12 | 12 | ||
13 | config.nixpkgs.overlays = lib.mkIf cfg.enable [ (self: super: { | ||
14 | postgresql = self.postgresql_11_custom; | ||
15 | }) ]; | ||
16 | |||
17 | config.myServices.databases = lib.mkIf cfg.enable { | 13 | config.myServices.databases = lib.mkIf cfg.enable { |
18 | mariadb = { | 14 | mariadb = { |
19 | enable = true; | 15 | enable = true; |
diff --git a/modules/private/databases/postgresql_replication.nix b/modules/private/databases/postgresql_replication.nix index 7172c5e..6ac2455 100644 --- a/modules/private/databases/postgresql_replication.nix +++ b/modules/private/databases/postgresql_replication.nix | |||
@@ -11,6 +11,13 @@ in | |||
11 | Base path to put the replications | 11 | Base path to put the replications |
12 | ''; | 12 | ''; |
13 | }; | 13 | }; |
14 | mainPackage = lib.mkOption { | ||
15 | type = lib.types.package; | ||
16 | default = pkgs.postgresql; | ||
17 | description = '' | ||
18 | Postgresql package available in shell | ||
19 | ''; | ||
20 | }; | ||
14 | hosts = lib.mkOption { | 21 | hosts = lib.mkOption { |
15 | default = {}; | 22 | default = {}; |
16 | description = '' | 23 | description = '' |
@@ -43,10 +50,6 @@ in | |||
43 | }; | 50 | }; |
44 | 51 | ||
45 | config = lib.mkIf cfg.enable { | 52 | config = lib.mkIf cfg.enable { |
46 | nixpkgs.overlays = [ (self: super: { | ||
47 | postgresql = self.postgresql_11_custom; | ||
48 | }) ]; | ||
49 | |||
50 | users.users.postgres = { | 53 | users.users.postgres = { |
51 | name = "postgres"; | 54 | name = "postgres"; |
52 | uid = config.ids.uids.postgres; | 55 | uid = config.ids.uids.postgres; |
@@ -57,7 +60,7 @@ in | |||
57 | extraGroups = [ "keys" ]; | 60 | extraGroups = [ "keys" ]; |
58 | }; | 61 | }; |
59 | users.groups.postgres.gid = config.ids.gids.postgres; | 62 | users.groups.postgres.gid = config.ids.gids.postgres; |
60 | environment.systemPackages = [ pkgs.postgresql ]; | 63 | environment.systemPackages = [ cfg.mainPackage ]; |
61 | 64 | ||
62 | secrets.keys = lib.flatten (lib.mapAttrsToList (name: hcfg: [ | 65 | secrets.keys = lib.flatten (lib.mapAttrsToList (name: hcfg: [ |
63 | { | 66 | { |