Savlage dedicated database nix

This commit is contained in:
Root User 2026-03-20 17:16:42 +01:00
parent c570c8bb89
commit 4aeb2fd7d7
Signed by: root
GPG key ID: 087F0A95E5766D72

View file

@ -5,6 +5,12 @@
... ...
}: let }: let
choose = paths: builtins.head (builtins.filter (p: builtins.pathExists p) paths); choose = paths: builtins.head (builtins.filter (p: builtins.pathExists p) paths);
dummyFileSystems = {
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
};
in { in {
options.local = { options.local = {
hostname = lib.mkOption { hostname = lib.mkOption {
@ -39,10 +45,10 @@ in {
(choose [./modules/toolsets/grafana_metric.nix ../toolsets/grafana_metric.nix]) (choose [./modules/toolsets/grafana_metric.nix ../toolsets/grafana_metric.nix])
(choose [./modules/secrets-config/sops-database.nix ../secrets-config/sops-database.nix]) (choose [./modules/secrets-config/sops-database.nix ../secrets-config/sops-database.nix])
(choose [./modules/system_scripts/gcloud_backup.nix ../system_scripts/gcloud_backup.nix]) (choose [./modules/system_scripts/gcloud_backup.nix ../system_scripts/gcloud_backup.nix])
## TODO: Make this more elegant and less risky for unexpected errors happening. ## TODO: Make this more elegant and less risky for unexpected errors happening.
] ]
++ lib.optional (builtins.pathExists ./hardware-configuration.nix) ./hardware-configuration.nix; ++ lib.optional (builtins.pathExists ./hardware-configuration.nix) ./hardware-configuration.nix
++ lib.optional (!builtins.pathExists ./hardware-configuration.nix) dummyFileSystems;
config = { config = {
local.hostname = "nixosdd"; local.hostname = "nixosdd";
@ -50,34 +56,6 @@ in {
local.userDescription = "NixOS Dedicated Database"; local.userDescription = "NixOS Dedicated Database";
local.address = "10.1.1.251"; local.address = "10.1.1.251";
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
# Filesystems (explicitly configured)
fileSystems."/" = {
device = "/dev/disk/by-uuid/0ebe91dc-d396-43d1-8111-5d48a69868eb";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/0ebe91dc-d396-43d1-8111-5d48a69868eb";
fsType = "btrfs";
options = [ "subvol=@home" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/D517-B83D";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
5432 # PostgreSQL 5432 # PostgreSQL
3306 # MariaDB/MySQL 3306 # MariaDB/MySQL