Skip to content
This repository was archived by the owner on Jun 12, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ the IP can be found in the following section's systems list.

## Systems

| System | Description | IP |
| ----------------------------------------------- | ------------------------------------------------------------- | ----------------- |
| [axol](./systems/x86_64-linux/axol/default.nix) | Primary server hosting `auxolotl.org` and `chat.auxolotl.org` | `137.184.177.239` |
| System | Description | IP |
| --------------------------------------------------- | ------------------------------------------------------------- | ----------------- |
| [axol](./systems/x86_64-linux/axol/default.nix) | Primary server hosting `auxolotl.org` and `chat.auxolotl.org` | `137.184.177.239` |
| [baxter](./systems/x86_64-linux/baxter/default.nix) | Hosts `git.auxolotl.org` | `209.38.149.197` |
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@

deploy = lib.mkDeploy {
inherit (inputs) self;
overrides = {
axol.hostname = "137.184.177.239";
baxter.hostname = "209.38.149.197";
};
};

checks =
Expand Down
113 changes: 113 additions & 0 deletions modules/nixos/auxolotl/services/forge/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
lib,
pkgs,
config,
...
}: let
cfg = config.auxolotl.services.forge;
in {
options.auxolotl.services.forge = {
enable = lib.mkEnableOption "Forge";

domain = lib.mkOption {
type = lib.types.str;
default = "auxolotl.org";
description = "The domain name for the website.";
};

subdomain = lib.mkOption {
type = lib.types.str;
default = "git";
description = "The subdomain for the website.";
};

port = lib.mkOption {
type = lib.types.port;
default = 3001;
description = "The port for Forgejo to listen on.";
};
};

config = lib.mkIf cfg.enable {
services.forgejo = {
enable = true;

lfs.enable = true;

mailerPasswordFile = "/var/lib/secrets/forgejo-smtp-password";

database = {
type = "postgres";
};

settings = {
DEFAULT = {
APP_NAME = "Auxolotl Forge";
};
cron = {
ENABLE = true;
RUN_AT_START = true;
};
mailer = {
ENABLED = true;
FROM = "git@${cfg.domain}";
PROTOCOL = "smtps";
SMTP_ADDR = "smtp.mailgun.org";
SMTP_PORT = 465;
USER = "git@${cfg.domain}";
};
service = {
ENABLE_CAPTCHA = true;
ENABLE_BASIC_AUTHENTICATION = false;
REGISTER_EMAIL_CONFIRM = true;
ENABLE_NOTIFY_MAIL = true;
DISABLE_REGISTRATION = false;
DEFAULT_ALLOW_CREATE_ORGANIZATION = false;
};
server = {
DOMAIN = "${cfg.subdomain}.${cfg.domain}";
HTTP_PORT = cfg.port;
ROOT_URL = "https://${cfg.subdomain}.${cfg.domain}";
};
repository = {
ENABLE_PUSH_CREATE_USER = true;
ENABLE_PUSH_CREATE_ORG = true;
};
security = {
INSTALL_LOCK = true;
};
indexer = {
REPO_INDEXER_ENABLED = true;
};
session = {
PROVIDER = "db";
};
"repository.pull-request" = {
DEFAULT_MERGE_STYLE = "squash";
};
"repository.signing" = {
SIGNING_KEY = "B46E42EDB01B797029F3D98B1A875715D0C04185";
SIGNING_NAME = "Auxolotl Forge";
SIGNING_EMAIL = "git@${cfg.domain}";
};
};
};

services.nginx = {
enable = true;

virtualHosts = {
"${cfg.subdomain}.${cfg.domain}" = {
forceSSL = true;
enableACME = true;

locations = {
"/" = {
proxyPass = "http://localhost:${builtins.toString cfg.port}";
};
};
};
};
};
};
}
17 changes: 17 additions & 0 deletions modules/nixos/auxolotl/services/ssh/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
lib,
config,
...
}: let
cfg = config.auxolotl.services.ssh;
in {
options.auxolotl.services.ssh = {
enable = lib.mkEnableOption "SSH";
};

config = lib.mkIf cfg.enable {
services.openssh = {
enable = true;
};
};
}
10 changes: 4 additions & 6 deletions modules/nixos/auxolotl/users/infra/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ in {
openssh.authorizedKeys.keys = [
# jakehamilton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NTE5QG9wZW5zc2guY29tAAAAIOhzJ0p9bFRSURUjV05rrt5jCbxPXke7juNbEC9ZJXS/AAAAGXNzaDp0aW55X3l1YmlrZXlfcmVzaWRlbnQ= tiny_yubikey_resident"
# isabel
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMQDiHbMSinj8twL9cTgPOfI6OMexrTZyHX27T8gnMj2"
# minion
"[email protected] AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIIteIdlZv52nUDxW2SUsoJ2NZi/w9j1NZwuHanQ/o/DuAAAAHnNzaDpjb2xsYWJvcmFfeXViaWtleV9yZXNpZGVudA== collabora_yubikey_resident"
"[email protected] AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIJRzQbQjXFpHKtt8lpNKmoNx57+EJ/z3wnKOn3/LjM6cAAAAFXNzaDppeXViaWtleV9yZXNpZGVudA== iyubikey_resident"
"[email protected] AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIOhzJ0p9bFRSURUjV05rrt5jCbxPXke7juNbEC9ZJXS/AAAAGXNzaDp0aW55X3l1YmlrZXlfcmVzaWRlbnQ= tiny_yubikey_resident"
];
};

Expand Down
1 change: 1 addition & 0 deletions systems/x86_64-linux/axol/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
};

services = {
ssh.enable = true;
chat.enable = true;
website.enable = true;
};
Expand Down
46 changes: 46 additions & 0 deletions systems/x86_64-linux/baxter/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# baxter
# 209.38.149.197
{
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/virtualisation/digital-ocean-config.nix")
];

boot.loader.grub.enable = true;

virtualisation.digitalOcean.rebuildFromUserData = false;

networking.firewall.allowedTCPPorts = [
80
443
];

environment.systemPackages = with pkgs; [
neovim
];

auxolotl = {
nix.enable = true;

users.infra.enable = true;

security = {
doas.enable = true;

acme = {
enable = true;
email = "[email protected]";
};
};

services = {
ssh.enable = true;
forge.enable = true;
};
};

system.stateVersion = "23.11";
}