diff --git a/nix-system-configs/modules/system/database.nix b/nix-system-configs/modules/system/database.nix index feaf7e2..499e8bc 100644 --- a/nix-system-configs/modules/system/database.nix +++ b/nix-system-configs/modules/system/database.nix @@ -5,6 +5,12 @@ ... }: let choose = paths: builtins.head (builtins.filter (p: builtins.pathExists p) paths); + dummyFileSystems = { + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + }; in { options.local = { hostname = lib.mkOption { @@ -39,10 +45,10 @@ in { (choose [./modules/toolsets/grafana_metric.nix ../toolsets/grafana_metric.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]) - ## 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 = { local.hostname = "nixosdd"; @@ -50,34 +56,6 @@ in { local.userDescription = "NixOS Dedicated Database"; 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 = [ 5432 # PostgreSQL 3306 # MariaDB/MySQL