1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/systems/makanek/configuration.nix

144 lines
3.6 KiB
Nix
Raw Normal View History

2020-10-31 20:51:25 +01:00
{
lib,
2022-03-10 21:52:12 +01:00
config,
pkgs,
...
2025-12-27 22:22:54 +01:00
}:
{
2020-10-31 20:51:25 +01:00
imports = [
./gitea.nix
2020-10-31 20:51:25 +01:00
./hardware-configuration.nix
./hedgedoc.nix
2026-02-18 18:18:08 +01:00
# ./menstruation.nix
2022-02-07 11:31:48 +01:00
./moinbot.nix
./monitoring
2025-12-04 16:19:46 +01:00
# ./names.nix
./nextcloud.nix
2022-02-22 20:34:53 +01:00
./radio-news.nix
2024-09-08 19:14:30 +02:00
./scrabble.nix
2024-12-13 13:42:16 +01:00
# ./onlyoffice.nix
./retiolum-map.nix
2025-12-20 11:31:12 +01:00
./oracle
./tt-rss.nix
./weechat.nix
2023-03-20 12:25:43 +01:00
../../configs/tor.nix
2024-10-08 18:51:43 +02:00
../../configs/bots
2020-10-31 20:51:25 +01:00
];
services.restic.backups.niveum = {
initialize = true;
repository = pkgs.lib.niveum.restic.repository;
2022-03-10 21:52:12 +01:00
timerConfig = {
OnCalendar = "daily";
RandomizedDelaySec = "1h";
};
passwordFile = config.age.secrets.restic.path;
paths = [
2022-12-03 08:25:47 +01:00
config.services.postgresqlBackup.location
2023-02-23 16:53:53 +01:00
config.services.nextcloud.home
config.services.grafana.dataDir
config.services.gitea.stateDir
config.services.weechat.root
2025-10-02 18:34:23 +02:00
config.services.nginx.virtualHosts."www.kmein.de".locations."/".root
"/var/lib/weechat"
2023-02-23 16:53:53 +01:00
"/var/lib/codimd"
];
};
2022-05-22 11:47:59 +02:00
niveum.passport = {
enable = true;
introductionHTML = ''
<p>
The machine <tt>makanek</tt> is named after a Levantine type of <a href="https://en.wikipedia.org/wiki/Makanek">sausage</a> (مقانق <i>maqāniq</i>).
</p>
<p>
It runs on <a href="https://www.hetzner.com/cloud">Hetzner cloud</a>.
</p>
<figure>
<img width="200" src="https://www.albawaba.com/sites/default/files/2019-08/makanek-BeFunky-project.jpg" alt="Makanek sausages"/>
<figcaption>Makanek</figcaption>
</figure>
'';
virtualHost = "makanek.r";
services = [
{
title = "restic backup";
description = "This machine backups its state via restic backup.";
}
];
};
networking = {
2025-12-27 22:22:54 +01:00
firewall.allowedTCPPorts = [
80
443
];
hostName = "makanek";
interfaces.ens3.useDHCP = true;
retiolum = pkgs.lib.niveum.retiolumAddresses.makanek;
useDHCP = false;
2021-05-30 12:57:37 +02:00
};
2021-01-31 10:08:09 +01:00
age.secrets = {
2023-02-28 16:45:20 +01:00
retiolum-rsa = {
file = ../../secrets/makanek-retiolum-privateKey-rsa.age;
2023-02-28 16:45:20 +01:00
mode = "400";
2024-06-03 07:27:01 +02:00
owner = "tinc-retiolum";
group = "tinc-retiolum";
2023-02-28 16:45:20 +01:00
};
retiolum-ed25519 = {
file = ../../secrets/makanek-retiolum-privateKey-ed25519.age;
2023-02-28 16:45:20 +01:00
mode = "400";
2024-06-03 07:27:01 +02:00
owner = "tinc-retiolum";
group = "tinc-retiolum";
2023-02-28 16:45:20 +01:00
};
restic.file = ../../secrets/restic.age;
};
2020-10-31 20:51:25 +01:00
system.stateVersion = "20.03";
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
2020-10-31 20:51:25 +01:00
};
security.acme = {
acceptTerms = true;
defaults.email = pkgs.lib.niveum.kieran.email;
2020-10-31 20:51:25 +01:00
};
2023-07-20 19:32:26 +02:00
services.nginx.virtualHosts."www.kmein.de" = {
addSSL = true;
enableACME = true;
2025-10-02 18:34:23 +02:00
locations."/" = {
root = "/var/www/kmein.de";
extraConfig = ''
2025-12-27 22:22:54 +01:00
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization';
2025-10-02 18:34:23 +02:00
2025-12-27 22:22:54 +01:00
# Handle preflight requests
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization';
return 204; # No Content
}
2025-10-02 18:34:23 +02:00
'';
};
2023-07-20 19:32:26 +02:00
};
2022-08-23 19:02:28 +02:00
environment.systemPackages = [
pkgs.vim
pkgs.git
pkgs.tmux
pkgs.python3
pkgs.nix-output-monitor
];
2020-10-31 20:51:25 +01:00
}