added stuff

This commit is contained in:
Charlie Root 2024-04-09 23:11:33 +02:00
commit 9d0ebdfbd0
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,21 @@
{lib, ...}: let
inherit (lib) mkModule;
in {
options.modules.system.services = {
# binary cache backends
bincache = {
harmonia = mkModule {
name = "Harmonia";
type = "binary cache";
host = "[::]";
port = 5000;
};
atticd = mkModule {
name = "Atticd";
type = "binary cache";
port = 8100;
};
};
};
}

View file

@ -0,0 +1,38 @@
{lib, ...}: let
inherit (lib) mkModule;
in {
options.modules.system.services = {
# database backends
database = {
mysql = mkModule {
name = "MySQL";
type = "database";
port = 3306;
};
mongodb = mkModule {
name = "MongoDB";
type = "database";
port = 27017;
};
redis = mkModule {
name = "Redis";
type = "database";
port = 6379;
};
postgresql = mkModule {
name = "PostgreSQL";
type = "database";
port = 5432;
};
garage = mkModule {
name = "Garage";
type = "S3 storage";
port = 5432;
};
};
};
}

View file

@ -0,0 +1,79 @@
{lib, ...}: let
inherit (lib) mkEnableOption mkModule;
in {
imports = [
./bincache.nix
./databases.nix
./monitoring.nix
./networking.nix
./social.nix
];
options.modules.system = {
services = {
mailserver.enable = mkEnableOption "nixos-mailserver service";
mkm.enable = mkEnableOption "mkm-ticketing service";
nextcloud = mkModule {
name = "Nextcloud";
type = "cloud storage";
};
nginx = mkModule {
name = "Nginx";
type = "webserver";
};
vaultwarden = mkModule {
name = "Vaultwarden";
type = "password manager";
port = 8222;
host = "127.0.0.1";
};
forgejo = mkModule {
name = "Forgejo";
type = "forge";
port = 7000;
};
quassel = mkModule {
name = "Quassel";
type = "IRC";
port = 4242;
};
jellyfin = mkModule {
name = "Jellyfin";
type = "media";
port = 8096;
};
searxng = mkModule {
name = "Searxng";
type = "meta search engine";
port = 8888;
};
miniflux = mkModule {
name = "Miniflux";
type = "RSS reader";
};
reposilite = mkModule {
name = "Reposilite";
port = 8084;
};
elasticsearch = mkModule {
name = "Elasticsearch";
port = 9200;
};
kanidm = mkModule {
name = "Kanidm";
port = 8443;
};
};
};
}

View file

@ -0,0 +1,26 @@
{
config,
lib,
...
}: let
inherit (lib) mkEnableOption;
sys = config.modules.system;
cfg = sys.services;
# mkEnableOption is the same as mkEnableOption but with the default value being equal to cfg.monitoring.enable
mkEnableOption' = desc: mkEnableOption "${desc}" // {default = cfg.monitoring.enable;};
in {
options.modules.system.services = {
# monitoring tools
# TODO: how do I mkModule those? they feature multiple host-specific parts
# that need to be adressed
monitoring = {
enable = mkEnableOption "system monitoring stack";
prometheus.enable = mkEnableOption' "Prometheus monitoring service";
grafana.enable = mkEnableOption' "Grafana monitoring service";
loki.enable = mkEnableOption' "Loki monitoring service";
uptime-kuma.enable = mkEnableOption' "Uptime Kuma monitoring service";
};
};
}

View file

@ -0,0 +1,25 @@
{lib, ...}: let
inherit (lib) mkEnableOption mkModule;
inherit (lib.types) str;
in {
options.modules.system.services = {
# networking
networking = {
wireguard.enable = mkEnableOption "Wireguard service";
headscale = mkModule {
name = "Headscale";
type = "networking";
port = 8085;
/*
extraOptions = {
domain = mkOption {
type = str;
example = "headscale.example.com";
description = "The domain name to use for headscale";
};
};
*/
};
};
};
}

View file

@ -0,0 +1,18 @@
{lib, ...}: let
inherit (lib) mkModule;
in {
options.modules.system.services = {
# self-hosted/decentralized social networks
social = {
mastodon = mkModule {
name = "Mastodon";
type = "social";
};
matrix = mkModule {
name = "Matrix";
type = "social";
port = 8008;
};
};
};
}