caveman: init

This commit is contained in:
Astro 2022-11-03 20:49:26 +01:00
parent 11f8d0684b
commit 3306894c72
3 changed files with 1532 additions and 1 deletions

View File

@ -35,6 +35,17 @@
rust-overlay.follows = "rust-overlay";
};
};
caveman = {
url = "git+https://gitea.c3d2.de/astro/caveman.git?ref=main";
inputs = {
nixpkgs.follows = "nixos";
utils.follows = "flake-utils";
fenix.follows = "fenix";
fenix.inputs.nixpkgs.follows = "nixpkgs";
naersk.follows = "naersk";
naersk.inputs.nixpkgs.follows = "nixpkgs";
};
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixos";
@ -163,7 +174,7 @@
};
};
outputs = inputs@{ self, fenix, harmonia, heliwatch, microvm, naersk, nixos, nixos-hardware, nixos-unstable, oparl-scraper, scrapers, secrets, skyflake, sshlogd, sops-nix, spacemsg, ticker, tigger, yammat, zentralwerk, ... }:
outputs = inputs@{ self, fenix, harmonia, heliwatch, microvm, naersk, nixos, nixos-hardware, nixos-unstable, caveman, oparl-scraper, scrapers, secrets, skyflake, sshlogd, sops-nix, spacemsg, ticker, tigger, yammat, zentralwerk, ... }:
let
inherit (nixos) lib;
forAllSystems = lib.genAttrs [ "aarch64-linux" "x86_64-linux" ];
@ -968,6 +979,14 @@
];
};
caveman = nixosSystem' {
modules = [
self.nixosModules.microvm
caveman.nixosModule
./hosts/caveman
];
};
};
nixosModule = self.nixosModules.c3d2;

48
hosts/caveman/default.nix Normal file
View File

@ -0,0 +1,48 @@
{ config, ... }:
{
system.stateVersion = "22.05";
c3d2.hq.statistics.enable = true;
c3d2.deployment = {
server = "server10";
mounts = [ "etc" "var"];
};
microvm = {
vcpu = 16;
mem = 6 * 1024;
};
networking = {
hostName = "caveman";
firewall.allowedTCPPorts = [ 80 443 ];
};
services.caveman = {
redis.maxmemory = config.microvm.mem * 1024 * 1024 * 3 / 2;
hunter = {
enable = true;
settings = {
max_workers = config.microvm.vcpu * 2;
hosts = with builtins;
filter isString (
split "\n" (
readFile ./mastodon-instances.txt
)
);
};
};
};
# services = {
# nginx = rec {
# enable = true;
# virtualHosts."" = {
# default = true;
# forceSSL = true;
# enableACME = true;
# };
# };
# };
}

File diff suppressed because it is too large Load Diff