mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
Add retiolum config
This commit is contained in:
@@ -11,6 +11,7 @@ in {
|
||||
./configs/graphics.nix
|
||||
./configs/packages.nix
|
||||
./configs/networks.nix
|
||||
./configs/retiolum.nix
|
||||
];
|
||||
|
||||
time.timeZone = "Europe/Berlin";
|
||||
@@ -196,4 +197,11 @@ in {
|
||||
".zshrc".text = "# nothing to see here";
|
||||
};
|
||||
};
|
||||
|
||||
environment.etc = {
|
||||
"tinc/retiolum/rsa_key.priv" = {
|
||||
text = (import ./secrets.nix).retiolum.scardanelli.privateKey;
|
||||
mode = "400";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, config, ... }:
|
||||
let
|
||||
eduroam = (import ../secrets.nix).eduroam;
|
||||
eduroamConfig = {
|
||||
@@ -34,6 +34,17 @@ in {
|
||||
"FlixBus Wi-Fi" = {};
|
||||
};
|
||||
|
||||
networking.retiolum = {
|
||||
scardanelli = {
|
||||
ipv4 = "10.243.2.2";
|
||||
ipv6 = "42:2:5ca:da:3111::1";
|
||||
};
|
||||
homeros = {
|
||||
ipv4 = "10.243.2.1";
|
||||
ipv6 = "42:2::0:3:05::1";
|
||||
};
|
||||
}.${config.networking.hostName};
|
||||
|
||||
services.openvpn.servers = {
|
||||
hu-berlin = {
|
||||
config = ''config ${pkgs.fetchurl {
|
||||
|
||||
76
configs/retiolum.nix
Normal file
76
configs/retiolum.nix
Normal file
@@ -0,0 +1,76 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
netname = "retiolum";
|
||||
cfg = config.networking.retiolum;
|
||||
|
||||
in {
|
||||
options = {
|
||||
networking.retiolum.ipv4 = mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
own ipv4 address
|
||||
'';
|
||||
};
|
||||
networking.retiolum.ipv6 = mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
own ipv6 address
|
||||
'';
|
||||
};
|
||||
networking.retiolum.nodename = mkOption {
|
||||
type = types.str;
|
||||
default = config.networking.hostName;
|
||||
description = ''
|
||||
tinc network name
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
services.tinc.networks.${netname} = {
|
||||
name = cfg.nodename;
|
||||
extraConfig = ''
|
||||
LocalDiscovery = yes
|
||||
ConnectTo = gum
|
||||
ConnectTo = ni
|
||||
ConnectTo = prism
|
||||
ConnectTo = eve
|
||||
AutoConnect = yes
|
||||
'';
|
||||
};
|
||||
|
||||
networking.extraHosts = builtins.readFile (pkgs.fetchurl {
|
||||
name = "retiolum.hosts";
|
||||
url = "https://lassul.us/retiolum.hosts";
|
||||
# FIXME
|
||||
sha256 = "0a0hk2z883i7jkgb7agiwdalpi1brqqjgdn9aw7x99gdl7jwkzc5";
|
||||
});
|
||||
|
||||
environment.systemPackages = [ config.services.tinc.networks.${netname}.package ];
|
||||
|
||||
systemd.services."tinc.${netname}" = {
|
||||
path = with pkgs; [ curl gnutar bzip2 ];
|
||||
preStart = ''
|
||||
curl https://lassul.us/retiolum-hosts.tar.bz2 | tar -xjvf - -C /etc/tinc/${netname}/ || true
|
||||
'';
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 655 ];
|
||||
networking.firewall.allowedUDPPorts = [ 655 ];
|
||||
# services.netdata.portcheck.checks.tinc.port = 655;
|
||||
|
||||
systemd.network.enable = true;
|
||||
systemd.network.networks = {
|
||||
"${netname}".extraConfig = ''
|
||||
[Match]
|
||||
Name = tinc.${netname}
|
||||
[Network]
|
||||
Address=${cfg.ipv4}/12
|
||||
Address=${cfg.ipv6}/16
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user