refactor(database): modularize

This commit is contained in:
2026-09-28 23:25:12 +02:00
parent 06f1412930
commit 5b480bd0d6
4 changed files with 50 additions and 19 deletions
+14 -19
View File
@@ -1,26 +1,21 @@
{ { lib, ... }:
config,
lib,
pkgs,
...
}:
{ {
options.database = { options.database = {
mssql.enable = lib.mkEnableOption "MSSQL"; mssql = {
postgresql.enable = lib.mkEnableOption "PostgreSQL"; enable = lib.mkEnableOption "MSSQL";
redis.enable = lib.mkEnableOption "Redis"; };
postgresql = {
enable = lib.mkEnableOption "PostgreSQL";
};
redis = {
enable = lib.mkEnableOption "Redis";
};
}; };
config = lib.mkMerge [ imports = [
(lib.mkIf config.database.mssql.enable { ./mssql.nix
home.packages = with pkgs; [ (config.nixgl.wrap dbeaver-bin) ]; ./postgresql.nix
}) ./redis.nix
(lib.mkIf config.database.postgresql.enable {
home.packages = with pkgs; [ (config.nixgl.wrap pgadmin4-desktopmode) ];
})
(lib.mkIf config.database.redis.enable {
home.packages = with pkgs; [ redis ];
})
]; ];
} }
+12
View File
@@ -0,0 +1,12 @@
{
config,
lib,
pkgs,
...
}:
{
config = lib.mkIf config.database.mssql.enable {
home.packages = with pkgs; [ (config.nixgl.wrap dbeaver-bin) ];
};
}
+12
View File
@@ -0,0 +1,12 @@
{
config,
lib,
pkgs,
...
}:
{
config = lib.mkIf config.database.postgresql.enable {
home.packages = with pkgs; [ (config.nixgl.wrap pgadmin4-desktopmode) ];
};
}
+12
View File
@@ -0,0 +1,12 @@
{
config,
lib,
pkgs,
...
}:
{
config = lib.mkIf config.database.redis.enable {
home.packages = with pkgs; [ redis ];
};
}