2021-12-27 04:37:57 +01:00
|
|
|
{ depot, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (depot.users.grfn)
|
|
|
|
terraform
|
2022-01-30 17:06:58 +01:00
|
|
|
;
|
2021-12-27 04:37:57 +01:00
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
in
|
|
|
|
terraform.workspace "bbbg"
|
|
|
|
{
|
2021-12-27 04:37:57 +01:00
|
|
|
plugins = (p: with p; [
|
|
|
|
aws
|
|
|
|
cloudflare
|
|
|
|
]);
|
2022-01-30 17:06:58 +01:00
|
|
|
}
|
|
|
|
{
|
2021-12-27 04:37:57 +01:00
|
|
|
machine = terraform.nixosMachine {
|
|
|
|
name = "bbbg";
|
|
|
|
instanceType = "t3a.small";
|
|
|
|
rootVolumeSizeGb = 250;
|
|
|
|
extraIngressPorts = [ 80 443 ];
|
|
|
|
configuration = { pkgs, lib, config, depot, ... }: {
|
|
|
|
imports = [
|
|
|
|
./module.nix
|
|
|
|
"${depot.third_party.agenix.src}/modules/age.nix"
|
|
|
|
];
|
|
|
|
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
recommendedTlsSettings = true;
|
|
|
|
recommendedOptimisation = true;
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
networking.firewall.enable = false;
|
|
|
|
|
|
|
|
programs.zsh.enable = true;
|
|
|
|
|
|
|
|
users.users.grfn = {
|
|
|
|
isNormalUser = true;
|
|
|
|
initialPassword = "password";
|
|
|
|
extraGroups = [
|
|
|
|
"wheel"
|
|
|
|
"networkmanager"
|
|
|
|
"audio"
|
|
|
|
"docker"
|
|
|
|
];
|
|
|
|
shell = pkgs.zsh;
|
|
|
|
openssh.authorizedKeys.keys = [
|
|
|
|
depot.users.grfn.keys.main
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
security.sudo.extraRules = [{
|
2022-01-30 17:06:58 +01:00
|
|
|
groups = [ "wheel" ];
|
|
|
|
commands = [{ command = "ALL"; options = [ "NOPASSWD" ]; }];
|
2021-12-27 04:37:57 +01:00
|
|
|
}];
|
|
|
|
|
|
|
|
nix.gc = {
|
|
|
|
automatic = true;
|
|
|
|
dates = "weekly";
|
|
|
|
options = "--delete-older-than 30d";
|
|
|
|
};
|
|
|
|
|
|
|
|
age.secrets = {
|
|
|
|
bbbg.file =
|
|
|
|
depot.users.grfn.secrets."bbbg.age";
|
|
|
|
};
|
|
|
|
|
|
|
|
services.bbbg.enable = true;
|
|
|
|
services.bbbg.database.enable = true;
|
|
|
|
services.bbbg.proxy.enable = true;
|
|
|
|
services.bbbg.domain = "bbbg.gws.fyi";
|
|
|
|
|
2022-01-04 14:22:30 +01:00
|
|
|
security.acme.defaults.email = "root@gws.fyi";
|
2021-12-27 04:37:57 +01:00
|
|
|
security.acme.acceptTerms = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
dns = {
|
|
|
|
data.cloudflare_zone.gws-fyi = {
|
|
|
|
name = "gws.fyi";
|
|
|
|
};
|
|
|
|
|
|
|
|
resource.cloudflare_record.bbbg = {
|
|
|
|
zone_id = "\${data.cloudflare_zone.gws-fyi.id}";
|
|
|
|
name = "bbbg";
|
|
|
|
type = "A";
|
|
|
|
value = "\${aws_instance.bbbg_machine.public_ip}";
|
|
|
|
proxied = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|