Setup mail server and restructure some things
This commit is contained in:
parent
502e5194dc
commit
ba43f2ed5c
90 changed files with 512 additions and 66 deletions
40
config/hosts/hydra/configuration.nix
Normal file
40
config/hosts/hydra/configuration.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ ... }:
|
||||
{
|
||||
boot = {
|
||||
loader.grub = {
|
||||
enable = true;
|
||||
device = "/dev/vda";
|
||||
};
|
||||
|
||||
binfmt.emulatedSystems = [
|
||||
"armv6l-linux"
|
||||
"armv7l-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "hydra";
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 8443 ];
|
||||
};
|
||||
};
|
||||
|
||||
nix = {
|
||||
settings.allowed-uris = "http:// https://";
|
||||
buildMachines = [
|
||||
{
|
||||
hostName = "localhost";
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"armv6l-linux"
|
||||
"armv7l-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
}
|
9
config/hosts/hydra/default.nix
Normal file
9
config/hosts/hydra/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./configuration.nix
|
||||
./hydra.nix
|
||||
./nix-serve.nix
|
||||
./nginx.nix
|
||||
];
|
||||
}
|
14
config/hosts/hydra/hydra.nix
Normal file
14
config/hosts/hydra/hydra.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ ... }:
|
||||
{
|
||||
services.hydra = {
|
||||
enable = true;
|
||||
hydraURL = "https://hydra.nekover.se";
|
||||
listenHost = "localhost";
|
||||
port = 3001;
|
||||
useSubstitutes = true;
|
||||
notificationSender = "hydra@robot.grzb.de";
|
||||
extraConfig = "
|
||||
binary_cache_public_uri = https://nix-cache.nekover.se
|
||||
";
|
||||
};
|
||||
}
|
42
config/hosts/hydra/nginx.nix
Normal file
42
config/hosts/hydra/nginx.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ ... }:
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts = {
|
||||
"hydra.nekover.se" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
listen = [{
|
||||
addr = "0.0.0.0";
|
||||
port = 80;
|
||||
}];
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:3001";
|
||||
};
|
||||
extraConfig = ''
|
||||
listen 0.0.0.0:8443 http2 ssl proxy_protocol;
|
||||
|
||||
set_real_ip_from 10.202.41.100;
|
||||
real_ip_header proxy_protocol;
|
||||
'';
|
||||
};
|
||||
"nix-cache.nekover.se" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
listen = [ {
|
||||
addr = "0.0.0.0";
|
||||
port = 80;
|
||||
}];
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:5005";
|
||||
};
|
||||
extraConfig = ''
|
||||
listen 0.0.0.0:8443 http2 ssl proxy_protocol;
|
||||
|
||||
set_real_ip_from 10.202.41.100;
|
||||
real_ip_header proxy_protocol;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
9
config/hosts/hydra/nix-serve.nix
Normal file
9
config/hosts/hydra/nix-serve.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ ... }:
|
||||
{
|
||||
services.nix-serve = {
|
||||
enable = true;
|
||||
port = 5005;
|
||||
bindAddress = "localhost";
|
||||
secretKeyFile = "/secrets/signing-key.secret";
|
||||
};
|
||||
}
|
11
config/hosts/hydra/secrets.nix
Normal file
11
config/hosts/hydra/secrets.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ ... }:
|
||||
{
|
||||
deployment.keys."signing-key.secret" = {
|
||||
keyCommand = [ "env" "GNUPGHOME=/home/yuri/.passinfra_gnupg" "PASSWORD_STORE_DIR=/home/yuri/pass/infra" "pass" "hydra/signing-key" ];
|
||||
destDir = "/secrets";
|
||||
user = "root";
|
||||
group = "root";
|
||||
permissions = "0640";
|
||||
uploadAt = "pre-activation";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue