2024-10-03 15:10:04 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
inputs,
|
|
|
|
...
|
|
|
|
}: let
|
2024-10-03 12:40:37 +02:00
|
|
|
sshKeys = import ../../crypto/ssh-keys.nix;
|
|
|
|
in {
|
2024-09-29 19:41:01 +02:00
|
|
|
imports = [
|
|
|
|
./hardware-configuration.nix
|
2024-10-03 11:47:42 +02:00
|
|
|
../../common/base.nix
|
2024-09-05 20:49:12 +02:00
|
|
|
];
|
|
|
|
|
2024-10-03 12:21:57 +02:00
|
|
|
networking = {
|
|
|
|
hostName = "vulpecula";
|
|
|
|
|
|
|
|
firewall = {
|
|
|
|
allowedTCPPorts = [
|
|
|
|
80
|
|
|
|
443
|
2024-10-03 15:10:04 +02:00
|
|
|
# 22
|
2024-10-03 12:21:57 +02:00
|
|
|
];
|
|
|
|
allowedUDPPorts = [
|
|
|
|
# 8080 # ?
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-10-03 15:10:04 +02:00
|
|
|
# Disable systemd-boot, use grub instead
|
2024-10-03 12:12:35 +02:00
|
|
|
boot = {
|
2024-10-03 12:14:24 +02:00
|
|
|
loader.systemd-boot.enable = lib.mkForce false;
|
2024-10-03 12:12:35 +02:00
|
|
|
initrd = {
|
2024-10-03 12:15:02 +02:00
|
|
|
enable = lib.mkForce true;
|
2024-10-03 12:14:24 +02:00
|
|
|
systemd.enable = lib.mkForce false;
|
2024-10-03 12:12:35 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
boot.loader.grub.device = "/dev/sda";
|
2024-10-03 11:43:27 +02:00
|
|
|
|
2024-10-03 15:10:04 +02:00
|
|
|
users.users.tasia = {
|
2024-10-03 12:39:52 +02:00
|
|
|
isNormalUser = true;
|
|
|
|
description = "Tasia";
|
|
|
|
extraGroups = ["networkmanager" "wheel" "dialout"];
|
|
|
|
initialPassword = "correcthorsebatterystaple";
|
|
|
|
openssh.authorizedKeys.keys = [
|
|
|
|
sshKeys.tasia.yaseen
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-10-03 13:11:58 +02:00
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
2024-10-03 13:52:46 +02:00
|
|
|
recommendedProxySettings = true;
|
|
|
|
recommendedTlsSettings = true;
|
2024-10-03 13:11:58 +02:00
|
|
|
virtualHosts."vulpecula.zone" = {
|
|
|
|
addSSL = true;
|
|
|
|
enableACME = true;
|
2024-10-03 14:53:38 +02:00
|
|
|
root = inputs.vulpecula-zone.packages.x86_64-linux.default;
|
2024-10-03 14:51:45 +02:00
|
|
|
};
|
|
|
|
virtualHosts."tasiaiso.vulpecula.zone" = {
|
|
|
|
addSSL = true;
|
|
|
|
enableACME = true;
|
2024-10-03 14:53:38 +02:00
|
|
|
root = inputs.tasiaiso-vulpecula-zone.packages.x86_64-linux.default;
|
2024-10-03 13:11:58 +02:00
|
|
|
};
|
|
|
|
virtualHosts."git.vulpecula.zone" = {
|
|
|
|
addSSL = true;
|
|
|
|
enableACME = true;
|
2024-10-03 15:10:04 +02:00
|
|
|
locations."/".proxyPass = "http://localhost:${toString config.services.forgejo.settings.server.HTTP_PORT}";
|
2024-10-03 13:11:58 +02:00
|
|
|
};
|
2024-10-03 12:49:42 +02:00
|
|
|
};
|
|
|
|
|
2024-10-03 15:10:04 +02:00
|
|
|
# change when ppl can make their own website
|
2024-10-03 13:05:05 +02:00
|
|
|
security.acme = {
|
|
|
|
acceptTerms = true;
|
|
|
|
defaults.email = "tasiaiso@proton.me";
|
|
|
|
};
|
|
|
|
|
2024-10-03 13:11:58 +02:00
|
|
|
services.forgejo = {
|
|
|
|
enable = true;
|
|
|
|
database.type = "postgres";
|
|
|
|
# Enable support for Git Large File Storage
|
|
|
|
lfs.enable = true;
|
|
|
|
settings = {
|
|
|
|
server = {
|
|
|
|
DOMAIN = "git.vulpecula.zone";
|
|
|
|
# You need to specify this to remove the port from URLs in the web UI.
|
|
|
|
ROOT_URL = "https://git.vulpecula.zone/";
|
|
|
|
HTTP_PORT = 62101;
|
|
|
|
};
|
|
|
|
# You can temporarily allow registration to create an admin user.
|
2024-10-03 14:01:29 +02:00
|
|
|
service.DISABLE_REGISTRATION = true;
|
2024-10-03 13:11:58 +02:00
|
|
|
# Add support for actions, based on act: https://github.com/nektos/act
|
|
|
|
# actions = {
|
|
|
|
# ENABLED = true;
|
|
|
|
# DEFAULT_ACTIONS_URL = "github";
|
|
|
|
# };
|
|
|
|
# Sending emails is completely optional
|
|
|
|
# You can send a test email from the web UI at:
|
|
|
|
# Profile Picture > Site Administration > Configuration > Mailer Configuration
|
|
|
|
# mailer = {
|
|
|
|
# ENABLED = true;
|
|
|
|
# SMTP_ADDR = "mail.example.com";
|
|
|
|
# FROM = "noreply@${srv.DOMAIN}";
|
|
|
|
# USER = "noreply@${srv.DOMAIN}";
|
|
|
|
# };
|
|
|
|
};
|
|
|
|
# mailerPasswordFile = config.age.secrets.forgejo-mailer-password.path;
|
|
|
|
};
|
|
|
|
|
2024-10-03 15:10:04 +02:00
|
|
|
# services.gitea-actions-runner = {
|
|
|
|
# package = pkgs.forgejo-actions-runner;
|
|
|
|
# instances.default = {
|
|
|
|
# enable = true;
|
|
|
|
# name = "monolith";
|
|
|
|
# url = "https://git.vulpecula.zone";
|
|
|
|
# # Obtaining the path to the runner token file may differ
|
|
|
|
# tokenFile = config.age.secrets.forgejo-runner-token.path;
|
|
|
|
# labels = [
|
|
|
|
# "ubuntu-latest:docker://node:16-bullseye"
|
|
|
|
# "ubuntu-22.04:docker://node:16-bullseye"
|
|
|
|
# "ubuntu-20.04:docker://node:16-bullseye"
|
|
|
|
# "ubuntu-18.04:docker://node:16-buster"
|
|
|
|
# ## optionally provide native execution on the host:
|
|
|
|
# # "native:host"
|
|
|
|
# ];
|
|
|
|
# };
|
|
|
|
# };
|
|
|
|
|
|
|
|
services.grafana = {
|
|
|
|
enable = false;
|
|
|
|
settings.server = {
|
|
|
|
domain = "grafana.vulpecula.zone";
|
|
|
|
http_port = 62102;
|
|
|
|
http_addr = "0.0.0.0";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.prometheus = {
|
|
|
|
enable = false;
|
|
|
|
port = 62103;
|
|
|
|
retentionTime = "60d";
|
|
|
|
|
|
|
|
exporters = {
|
|
|
|
node = {
|
|
|
|
enable = false;
|
|
|
|
enabledCollectors = ["systemd"];
|
|
|
|
port = 62104;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
scrapeConfigs = [
|
|
|
|
{
|
|
|
|
job_name = "vulpecula";
|
|
|
|
static_configs = [
|
|
|
|
{
|
|
|
|
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-10-03 13:11:58 +02:00
|
|
|
|
2024-09-29 19:41:01 +02:00
|
|
|
boot.tmp.cleanOnBoot = true;
|
|
|
|
zramSwap.enable = true;
|
|
|
|
networking.domain = "";
|
2024-10-03 12:39:52 +02:00
|
|
|
# users.users.root.openssh.authorizedKeys.keys = [''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILLyDLtqUhEQwIsPx0XgQ9OJb2+XxL+2ra4goNJEgwf0 tasia@yaseen'' ];
|
2024-09-05 20:49:12 +02:00
|
|
|
system.stateVersion = "24.05";
|
|
|
|
}
|