2023-10-27 12:29:45 +03:00
|
|
|
|
{ config, pkgs, lib, secrets, ... }:
|
2023-08-31 18:28:25 +03:00
|
|
|
|
|
2023-09-08 21:07:54 +03:00
|
|
|
|
let
|
|
|
|
|
my = import ../..;
|
|
|
|
|
ipv6_subnet = "2a05:3580:e41a:d600";
|
|
|
|
|
ipv6_prefix = 64;
|
|
|
|
|
ipv4_gateway = "192.168.1.1";
|
|
|
|
|
ipv4_address = "192.168.1.3";
|
|
|
|
|
ipv4_prefix = 24;
|
2023-08-31 18:28:25 +03:00
|
|
|
|
in {
|
2023-09-06 16:10:11 +03:00
|
|
|
|
imports = [ my.modules ../../hardware/rpi4.nix ];
|
2023-08-31 18:28:25 +03:00
|
|
|
|
|
|
|
|
|
networking.hostName = "rubusidaeus";
|
|
|
|
|
|
|
|
|
|
my.laptop.enable = false;
|
2023-09-01 07:13:07 +03:00
|
|
|
|
my.git.enable = false;
|
2023-08-31 18:28:25 +03:00
|
|
|
|
my.roles = {
|
|
|
|
|
design.enable = false;
|
|
|
|
|
devel.enable = false;
|
|
|
|
|
gaming.enable = false;
|
|
|
|
|
graphical.enable = false;
|
2023-11-30 16:17:10 +03:00
|
|
|
|
graphical.basic.enable = false;
|
2023-08-31 18:28:25 +03:00
|
|
|
|
latex.enable = false;
|
|
|
|
|
media-client.enable = false;
|
2023-11-30 17:20:49 +03:00
|
|
|
|
ntp-server.enable = true;
|
2023-08-31 18:28:25 +03:00
|
|
|
|
torrent.enable = false;
|
|
|
|
|
virtualisation.enable = false;
|
2023-12-17 10:57:18 +03:00
|
|
|
|
yggdrasil-peer.enable = true;
|
2023-09-07 17:32:56 +03:00
|
|
|
|
|
2023-12-17 17:25:24 +03:00
|
|
|
|
server = {
|
|
|
|
|
ivabus-dev.enable = true;
|
|
|
|
|
slides-ivabus-dev.enable = true;
|
2023-12-20 20:17:29 +03:00
|
|
|
|
urouter = {
|
|
|
|
|
enable = true;
|
|
|
|
|
settings = {
|
|
|
|
|
alias = [
|
|
|
|
|
{
|
2023-12-21 19:07:22 +03:00
|
|
|
|
uri = "/";
|
2024-01-21 09:14:14 +03:00
|
|
|
|
alias = {
|
|
|
|
|
html = ''
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
<title>@ivabus</title>
|
|
|
|
|
<style>
|
|
|
|
|
@font-face {
|
|
|
|
|
font-family: "JetBrains Mono";
|
|
|
|
|
src: url(https://ivabus.dev/assets/fonts/JetBrainsMono-VariableFont_wght.ttf)format("truetype")
|
|
|
|
|
}
|
|
|
|
|
body {
|
|
|
|
|
width: 300px;
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
margin-right: auto;
|
|
|
|
|
background-color: #24273a;
|
|
|
|
|
color: #cad3f5;
|
|
|
|
|
font-family: "JetBrains Mono";
|
|
|
|
|
}
|
|
|
|
|
h1 {
|
|
|
|
|
font-size: 24pt;
|
|
|
|
|
}
|
|
|
|
|
ul {
|
|
|
|
|
background-color: #363a4f;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
padding: 16px;
|
|
|
|
|
padding-bottom: 8px;
|
|
|
|
|
list-style-type: none;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
a {
|
|
|
|
|
color: #cad3f5;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
}
|
|
|
|
|
li {
|
|
|
|
|
background-color: #494d64;
|
|
|
|
|
font-size: 14pt;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
padding: 8px;
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
}
|
|
|
|
|
a:hover {
|
|
|
|
|
color: #f4dbd6;
|
|
|
|
|
}
|
|
|
|
|
li:hover {
|
|
|
|
|
background-color: #5b6078;
|
|
|
|
|
color: #f4dbd6;
|
|
|
|
|
}
|
|
|
|
|
@media all and (max-width:300px) {
|
|
|
|
|
body {
|
|
|
|
|
width: auto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<h1 align="center">@ivabus</h1>
|
|
|
|
|
<ul>
|
|
|
|
|
<a href="https://ivabus.dev/"><li>Website</li></a>
|
|
|
|
|
<a href="https://t.me/dev_fumo"><li>/dev/fumo</li></a>
|
|
|
|
|
<a href="https://t.me/musicativabus"><li>/var/music@ivabus</li></a>
|
|
|
|
|
<a href="https://github.com/ivabus"><li>GitHub</li></a>
|
|
|
|
|
<a href="https://social.treehouse.systems/@ivabus"><li>Mastodon</li></a>
|
|
|
|
|
<a href="https://vk.com/ivabus"><li>VK</li></a>
|
|
|
|
|
<li class="link">ivabus at ivabus.dev</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</body>
|
|
|
|
|
</html>'';
|
|
|
|
|
};
|
2023-12-20 20:17:29 +03:00
|
|
|
|
}
|
|
|
|
|
{
|
2023-12-21 19:07:22 +03:00
|
|
|
|
uri = "/";
|
|
|
|
|
alias = { file = "dotfiles"; };
|
|
|
|
|
agent = { regex = "^curl/[0-9].[0-9].[0-9]$"; };
|
2023-12-20 20:17:29 +03:00
|
|
|
|
}
|
|
|
|
|
{
|
2023-12-21 19:07:22 +03:00
|
|
|
|
uri = "d";
|
|
|
|
|
alias = { file = "dotfiles"; };
|
2023-12-20 20:17:29 +03:00
|
|
|
|
}
|
|
|
|
|
{
|
2023-12-21 19:07:22 +03:00
|
|
|
|
uri = "e";
|
|
|
|
|
alias = { file = "env"; };
|
2023-12-20 20:17:29 +03:00
|
|
|
|
}
|
|
|
|
|
{
|
2023-12-21 19:07:22 +03:00
|
|
|
|
uri = "nix";
|
|
|
|
|
alias = { file = "nix"; };
|
2023-12-20 20:17:29 +03:00
|
|
|
|
}
|
|
|
|
|
{
|
2023-12-21 19:07:22 +03:00
|
|
|
|
uri = "truth";
|
|
|
|
|
alias = { file = "truth.py"; };
|
2023-12-20 20:17:29 +03:00
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
dir = "/var/urouter";
|
|
|
|
|
port = 8090;
|
|
|
|
|
address = "0.0.0.0";
|
|
|
|
|
};
|
2023-12-17 17:25:24 +03:00
|
|
|
|
};
|
2023-08-31 18:28:25 +03:00
|
|
|
|
};
|
|
|
|
|
|
2023-10-03 17:15:14 +03:00
|
|
|
|
my.users = {
|
|
|
|
|
ivabus.enable = true;
|
|
|
|
|
user.enable = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
my.features.secrets = true;
|
|
|
|
|
|
2023-09-08 21:07:54 +03:00
|
|
|
|
networking = {
|
|
|
|
|
useNetworkd = false;
|
|
|
|
|
useDHCP = false;
|
|
|
|
|
interfaces = {
|
|
|
|
|
end0 = {
|
|
|
|
|
ipv6.addresses = [{
|
|
|
|
|
address = "${ipv6_subnet}::1337";
|
|
|
|
|
prefixLength = ipv6_prefix;
|
|
|
|
|
}];
|
|
|
|
|
ipv4.addresses = [{
|
|
|
|
|
address = ipv4_address; # Ughhhhh yep, flat network
|
|
|
|
|
prefixLength = ipv4_prefix;
|
|
|
|
|
}];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
defaultGateway = ipv4_gateway; # should set this things through let...
|
|
|
|
|
};
|
2023-08-31 18:28:25 +03:00
|
|
|
|
|
2023-12-22 07:30:15 +03:00
|
|
|
|
# 2 gig of ram is not enough
|
2023-12-24 08:49:24 +03:00
|
|
|
|
swapDevices = [{
|
2023-12-22 07:30:15 +03:00
|
|
|
|
device = "/var/lib/swapfile";
|
2023-12-24 08:49:24 +03:00
|
|
|
|
size = 16 * 1024;
|
|
|
|
|
}];
|
2023-12-22 07:30:15 +03:00
|
|
|
|
|
2023-10-27 12:29:45 +03:00
|
|
|
|
# Semi-static configuration, needs rethinking
|
|
|
|
|
services.nginx = {
|
|
|
|
|
virtualHosts."iva.bz" = {
|
2023-12-20 20:17:29 +03:00
|
|
|
|
locations."/".proxyPass = "http://localhost:8090";
|
2023-10-27 12:29:45 +03:00
|
|
|
|
enableACME = true;
|
|
|
|
|
addSSL = true;
|
2023-12-10 09:36:24 +03:00
|
|
|
|
http3 = true;
|
2023-10-27 12:29:45 +03:00
|
|
|
|
serverAliases = [ "www.iva.bz" ];
|
|
|
|
|
};
|
|
|
|
|
virtualHosts."xn--80acbx2cl.xn--p1ai" = {
|
|
|
|
|
locations."/".proxyPass = "http://${secrets.maas-address}:8083";
|
|
|
|
|
enableACME = true;
|
|
|
|
|
addSSL = true;
|
2023-12-10 09:36:24 +03:00
|
|
|
|
http3 = true;
|
2023-10-27 12:29:45 +03:00
|
|
|
|
serverAliases = [ "ивабус.рф" ];
|
|
|
|
|
};
|
2023-10-27 13:14:19 +03:00
|
|
|
|
virtualHosts."music.ivabus.dev" = {
|
|
|
|
|
locations."/".proxyPass = "http://${secrets.maas-address}:4533";
|
|
|
|
|
enableACME = true;
|
|
|
|
|
forceSSL = true;
|
2023-12-10 09:36:24 +03:00
|
|
|
|
http3 = true;
|
2023-10-27 13:14:19 +03:00
|
|
|
|
};
|
2023-11-01 21:42:41 +03:00
|
|
|
|
virtualHosts."storage.ivabus.dev" = {
|
|
|
|
|
locations."/".proxyPass = "http://${secrets.maas-address}:80";
|
|
|
|
|
enableACME = true;
|
|
|
|
|
forceSSL = true;
|
2023-12-10 09:36:24 +03:00
|
|
|
|
http3 = true;
|
2023-11-01 21:42:41 +03:00
|
|
|
|
};
|
|
|
|
|
virtualHosts."git.ivabus.dev" = {
|
|
|
|
|
locations."/".proxyPass = "http://${secrets.maas-address}:3000";
|
|
|
|
|
enableACME = true;
|
|
|
|
|
forceSSL = true;
|
2023-12-10 09:36:24 +03:00
|
|
|
|
http3 = true;
|
2023-11-01 21:42:41 +03:00
|
|
|
|
};
|
2023-10-27 12:29:45 +03:00
|
|
|
|
};
|
|
|
|
|
|
2023-08-31 18:28:25 +03:00
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
|
system.stateVersion = "23.05";
|
|
|
|
|
}
|
|
|
|
|
|