mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 05:36:59 +01:00
Move Synapse on hcloud and deploy it with Terraform + NixOs
This commit is contained in:
parent
8d543677c9
commit
c76ade9c29
14 changed files with 396 additions and 37 deletions
34
db1.nix
Normal file
34
db1.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ modulesPath, pkgs, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; };
|
||||
|
||||
# Set NIX_PATH to be the same as the Terraform module
|
||||
# nix.nixPath = [ "nixpkgs=${pkgs}" ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
htop
|
||||
];
|
||||
boot.cleanTmpDir = true;
|
||||
networking.hostName = "db1";
|
||||
networking.domain = "banditlair.com";
|
||||
networking.firewall.allowPing = true;
|
||||
networking.firewall.interfaces."enp7s0".allowedTCPPorts = [ 5432 ];
|
||||
services.openssh.enable = true;
|
||||
users.users.root.openssh.authorizedKeys.keyFiles = [
|
||||
./ssh_keys/phfroidmont-desktop.pub
|
||||
];
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
package = pkgs.postgresql_12;
|
||||
initialScript = "/var/keys/postgres-init.sql";
|
||||
enableTCPIP = true;
|
||||
authentication = ''
|
||||
host all all 10.0.1.0/24 md5
|
||||
'';
|
||||
};
|
||||
users.users.postgres.extraGroups = [ "keys" ];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue