mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 08:45:02 +01:00
things
This commit is contained in:
parent
01ce6387da
commit
6d47ea67f0
5 changed files with 29 additions and 26 deletions
|
|
@ -17,7 +17,7 @@
|
|||
# machinesFile = ./machines.client-a;
|
||||
};
|
||||
|
||||
defaults = { pkgs, ... }: {
|
||||
defaults = { pkgs, config, lib, ... }: {
|
||||
# This module will be imported by all hosts
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
|
|
@ -31,6 +31,7 @@
|
|||
"${builtins.fetchTarball "https://github.com/ryantm/agenix/archive/de96bd907d5fbc3b14fc33ad37d1b9a3cb15edc6.tar.gz"}/modules/age.nix" # main 2024-07-26
|
||||
];
|
||||
|
||||
deployment.targetHost = "${config.networking.hostName}.infra.noratrieb.dev";
|
||||
time.timeZone = "Europe/Zurich";
|
||||
users.users.root.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG0n1ikUG9rYqobh7WpAyXrqZqxQoQ2zNJrFPj12gTpP nilsh@PC-Nils'' ];
|
||||
|
||||
|
|
@ -43,22 +44,15 @@
|
|||
dns1 = { name, nodes, modulesPath, ... }: {
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
./modules/contabo
|
||||
./modules/dns
|
||||
];
|
||||
|
||||
# The name and nodes parameters are supported in Colmena,
|
||||
# allowing you to reference configurations in other nodes.
|
||||
networking.hostName = name;
|
||||
|
||||
deployment.targetHost = "dns1.nilstrieb.dev";
|
||||
deployment.tags = [ "dns" "us" ];
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
||||
boot.initrd.kernelModules = [ "nvme" ];
|
||||
fileSystems."/" = { device = "/dev/sda3"; fsType = "ext4"; };
|
||||
};
|
||||
dns2 = { name, nodes, modulesPath, lib, ... }: {
|
||||
imports = [
|
||||
|
|
@ -66,13 +60,8 @@
|
|||
./modules/dns
|
||||
];
|
||||
|
||||
# The name and nodes parameters are supported in Colmena,
|
||||
# allowing you to reference configurations in other nodes.
|
||||
networking.hostName = name;
|
||||
|
||||
deployment.targetHost = "dns2.nilstrieb.dev";
|
||||
deployment.tags = [ "dns" "eu" ];
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
|
|
@ -116,24 +105,15 @@
|
|||
vps1 = { name, nodes, modulesPath, ... }: {
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
./modules/contabo
|
||||
./modules/ingress
|
||||
./modules/widetom
|
||||
];
|
||||
|
||||
age.secrets.docker_registry_password.file = ./secrets/docker_registry_password.age;
|
||||
|
||||
# The name and nodes parameters are supported in Colmena,
|
||||
# allowing you to reference configurations in other nodes.
|
||||
networking.hostName = name;
|
||||
|
||||
deployment.targetHost = "vps1.nilstrieb.dev";
|
||||
deployment.tags = [ "ingress" "eu" "apps" ];
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
||||
boot.initrd.kernelModules = [ "nvme" ];
|
||||
fileSystems."/" = { device = "/dev/sda3"; fsType = "ext4"; };
|
||||
};
|
||||
}
|
||||
|
|
|
|||
7
newinfra/nix/modules/contabo/default.nix
Normal file
7
newinfra/nix/modules/contabo/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Default settings for Contabo VPS.
|
||||
{ ... }: {
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
||||
boot.initrd.kernelModules = [ "nvme" ];
|
||||
fileSystems."/" = { device = "/dev/sda3"; fsType = "ext4"; };
|
||||
}
|
||||
|
|
@ -33,6 +33,7 @@ let
|
|||
localhost.A = [ (a "127.0.0.1") ];
|
||||
newtest.TXT = [ "uwu it works" ];
|
||||
|
||||
# TODO: generate dynamically from IPs...
|
||||
infra.subdomains = {
|
||||
inherit dns1;
|
||||
inherit dns2;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }: {
|
||||
{ pkgs, config, ... }: {
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
22
|
||||
443
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
(
|
||||
builtins.readFile ./Caddyfile +
|
||||
''
|
||||
vps1.nilstrieb.dev {
|
||||
${config.networking.hostName}.infra.noratrieb.dev {
|
||||
root * ${./debugging-page}
|
||||
file_server
|
||||
}
|
||||
|
|
|
|||
15
newinfra/nix/smoke-tests.sh
Executable file
15
newinfra/nix/smoke-tests.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This script does a few basic smoke tests to ensure the servers haven't completely died.
|
||||
|
||||
set -eux
|
||||
|
||||
# Check DNS name servers
|
||||
dig @ns1.noratrieb.dev dns1.infra.noratrieb.dev +noall +answer | grep 154.38.163.74
|
||||
dig @ns2.noratrieb.dev dns1.infra.noratrieb.dev +noall +answer | grep 154.38.163.74
|
||||
|
||||
dig @ns1.noratrieb.dev nilstrieb.dev +noall +answer | grep 185.199.108.153
|
||||
dig @ns2.noratrieb.dev nilstrieb.dev +noall +answer | grep 185.199.108.153
|
||||
|
||||
# Check HTTP responses
|
||||
curl --fail https://vps1.infra.noratrieb.dev
|
||||
Loading…
Add table
Add a link
Reference in a new issue