infra/roles/hetzner-network.nix
Jonas Chevalier 37e48b712e
move things around a bit ()
* keep ./services for instances

./profiles is for config-only modules

./services are like profiles, but configure a single instance of a
service. Those are fronted by Nginx as the load-balancer and have a DNS
entry as well.

* ci: build build03 as well

* move hydra to services

* move matterbridge to services

* move marvin-mk2 to services

* build01: share the remainder profiles

* build02: use the nix-community-cache

* fixup kexec

* rename profiles to roles

* README: sync with reality
2021-03-07 16:28:44 +00:00

51 lines
1.1 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.networking.nix-community;
in {
options = {
networking.nix-community.ipv4.address = mkOption {
type = types.str;
};
networking.nix-community.ipv4.cidr = mkOption {
type = types.str;
default = "26";
};
networking.nix-community.ipv4.gateway = mkOption {
type = types.str;
};
networking.nix-community.ipv6.address = mkOption {
type = types.str;
};
networking.nix-community.ipv6.cidr = mkOption {
type = types.str;
default = "64";
};
networking.nix-community.ipv6.gateway = mkOption {
type = types.str;
default = "fe80::1";
};
};
config = {
networking.usePredictableInterfaceNames = false;
networking.dhcpcd.enable = false;
systemd.network = {
enable = true;
networks."eth0".extraConfig = ''
[Match]
Name = eth0
[Network]
Address = ${cfg.ipv6.address}/${cfg.ipv6.cidr}
Gateway = ${cfg.ipv6.gateway}
Address = ${cfg.ipv4.address}/${cfg.ipv4.cidr}
Gateway = ${cfg.ipv4.gateway}
'';
};
};
}