snowfield/machines/tower/default.nix

192 lines
4.1 KiB
Nix
Raw Normal View History

{
pkgs,
inputs,
profiles,
...
}:
2023-01-06 23:41:53 +01:00
{
2024-05-18 22:04:14 +02:00
imports = [
./hardware.nix
./home-julien.nix
2024-08-03 11:06:14 +02:00
./forgejo-runner.nix
2024-05-18 22:04:14 +02:00
];
2023-01-06 23:41:53 +01:00
2024-08-10 17:56:30 +02:00
machine.meta = {
arch = "x86_64-linux";
nixpkgs_version = inputs.nixpkgs;
hm_version = inputs.home-manager;
2024-09-02 16:42:35 +02:00
profiles = with profiles; [
vm-simple-network
server
2024-12-07 01:03:20 +01:00
behind-sniproxy
2024-09-02 16:42:35 +02:00
];
2024-08-12 18:12:00 +02:00
ips = {
public.ipv4 = "82.67.34.230";
local.ipv4 = "192.168.0.103";
vpn.ipv4 = "100.100.45.9";
public.ipv6 = "2a01:e0a:de4:a0e1:8ec7:b5d2:f663:a67a";
vpn.ipv6 = "fd7a:115c:a1e0::9";
2024-08-10 17:56:30 +02:00
};
};
2023-01-06 23:41:53 +01:00
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true;
2024-03-30 21:52:56 +01:00
networking.hostName = "tower";
2023-01-06 23:41:53 +01:00
2024-05-25 17:50:22 +02:00
networking.useNetworkd = true;
2023-01-06 23:41:53 +01:00
time.timeZone = "Europe/Paris";
2023-01-19 19:18:08 +01:00
luj.buildbot.enable = true;
luj.nginx.enable = true;
2024-05-18 22:04:14 +02:00
environment.systemPackages = with pkgs; [
tailscale
git
];
2023-01-06 23:41:53 +01:00
services.tailscale.enable = true;
2023-01-19 19:18:08 +01:00
services.openssh.extraConfig = ''
2023-01-06 23:41:53 +01:00
HostCertificate /etc/ssh/ssh_host_ed25519_key-cert.pub
HostKey /etc/ssh/ssh_host_ed25519_key
TrustedUserCAKeys /etc/ssh/ssh_user_key.pub
MaxAuthTries 20
'';
console.keyMap = "fr";
services.openssh.enable = true;
2024-05-18 22:04:14 +02:00
programs.ssh.knownHosts."darwin-build-box.winter.cafe".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB0io9E0eXiDIEHvsibXOxOPveSjUPIr1RnNKbUkw3fD";
2023-06-02 07:28:50 +02:00
2024-05-18 22:04:14 +02:00
services.nginx.virtualHosts."photos.julienmalka.me" = {
enableACME = true;
forceSSL = true;
root = "/srv/photos";
};
2023-06-02 07:28:50 +02:00
2023-05-13 21:33:35 +02:00
nix = {
distributedBuilds = true;
buildMachines = [
2023-06-09 10:57:00 +02:00
{
hostName = "epyc.infra.newtype.fr";
maxJobs = 100;
2024-05-18 22:04:14 +02:00
systems = [
"x86_64-linux"
"aarch64-linux"
];
2023-06-09 10:57:00 +02:00
sshUser = "root";
sshKey = "/home/julien/.ssh/id_ed25519";
2024-05-18 22:04:14 +02:00
supportedFeatures = [
"nixos-test"
"benchmark"
"big-parallel"
"kvm"
];
2023-06-09 10:57:00 +02:00
speedFactor = 2;
}
2023-06-02 07:28:50 +02:00
{
hostName = "darwin-build-box.winter.cafe";
maxJobs = 4;
sshKey = "/home/julien/.ssh/id_ed25519";
sshUser = "julienmalka";
2024-05-18 22:04:14 +02:00
systems = [
"aarch64-darwin"
"x86_64-darwin"
];
2023-06-02 07:28:50 +02:00
}
2023-05-13 21:33:35 +02:00
];
};
programs.ssh.extraConfig = ''
Host lambda
IdentityFile /home/julien/.ssh/id_ed25519
2023-06-10 23:50:31 +02:00
HostName lambda.luj
2023-05-13 21:33:35 +02:00
User root
Port 45
'';
2023-11-16 19:29:17 +01:00
services.nix-gitlab-runner = {
enable = true;
registrationConfigFile = "/var/lib/gitlab-runner/gitlab_runner";
2024-05-18 22:04:14 +02:00
packages = with pkgs; [
coreutils
su
bash
git
];
2023-11-16 19:29:17 +01:00
};
services.nginx.virtualHosts."phd.julienmalka.me" = {
2023-11-21 11:16:03 +01:00
basicAuthFile = "/home/gitlab-runner/nginx_auth";
2023-11-16 19:29:17 +01:00
enableACME = true;
forceSSL = true;
2023-11-21 11:16:03 +01:00
extraConfig = ''
autoindex on;
autoindex_localtime on;
'';
2023-11-16 19:29:17 +01:00
root = "/home/gitlab-runner/artifacts";
};
2023-11-21 11:16:03 +01:00
systemd.services.nginx.serviceConfig.ProtectHome = "read-only";
systemd.services.nginx.serviceConfig.ReadWritePaths = [ "/home/gitlab-runner/artifacts" ];
2023-07-16 14:48:10 +02:00
services.grafana.enable = true;
services.grafana.settings.server.http_port = 3000;
2023-07-26 19:35:08 +02:00
services.prometheus = {
enable = true;
pushgateway.enable = true;
scrapeConfigs = [
{
job_name = "push";
2024-05-18 22:04:14 +02:00
static_configs = [ { targets = [ "127.0.0.1:9091" ]; } ];
2023-07-26 19:35:08 +02:00
}
];
};
2023-07-16 14:48:10 +02:00
services.nginx.virtualHosts."data.julienmalka.me" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:3000";
proxyWebsockets = true;
};
};
services.nginx.virtualHosts."prometheus.julienmalka.me" = {
forceSSL = true;
enableACME = true;
locations."/" = {
2023-07-16 16:08:20 +02:00
proxyPass = "http://localhost:9090";
2023-07-16 14:48:10 +02:00
};
};
2023-07-16 16:08:20 +02:00
services.nginx.virtualHosts."push.julienmalka.me" = {
forceSSL = true;
enableACME = true;
locations."/" = {
2023-07-26 19:35:08 +02:00
proxyPass = "http://localhost:9091";
2023-07-16 16:08:20 +02:00
};
};
2023-07-16 14:48:10 +02:00
2024-05-18 22:04:14 +02:00
networking.firewall.allowedTCPPorts = [
80
443
1810
9989
];
networking.firewall.allowedUDPPorts = [
80
443
1810
9989
];
2023-05-20 21:47:36 +02:00
2023-01-06 23:41:53 +01:00
system.stateVersion = "22.11"; # Did you read the comment?
}