mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
+ scripts as derivations ~ move home-mananger stuff to the right modules / dot + home-manager ssh config - vim: powerline symbols ~ toggle keyboard with alt+shift + ssh agent at startup ~ retiolum ipv6 ~ texlive packages ~ shell: vim mode + THEMING ~ i3 minimaler + q ~ terminal: use urxvt
77 lines
1.8 KiB
Nix
77 lines
1.8 KiB
Nix
{ 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 = "1jdrbj5bilaaw36s9llnq73bhf8dz5r6c01vx7wl3k1ayvw1mlq9";
|
|
});
|
|
|
|
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
|
|
'';
|
|
};
|
|
};
|
|
}
|