# SPDX-FileCopyrightText: 2020 Luke Granger-Brown # # SPDX-License-Identifier: Apache-2.0 { depot, lib, pkgs, rebuilder, config, ... }: let inherit (depot.ops) secrets; in { imports = [ ../lib/bgp.nix ]; boot.initrd.availableKernelModules = [ "ata_piix" "sd_mod" "sr_mod" "virtio_scsi" "virtio_pci" ]; fileSystems = { "/" = { device = "/dev/disk/by-uuid/fafafa2b-ec19-40ae-bd04-cc286beb2946"; fsType = "ext4"; }; }; swapDevices = [ { device = "/dev/disk/by-uuid/9920239c-492f-4f79-8a06-8f412d047605"; } ]; nix.maxJobs = lib.mkDefault 2; # Use GRUB2. boot.loader.grub.enable = true; boot.loader.grub.version = 2; boot.loader.grub.device = "/dev/sda"; # Networking! networking = { hostName = "ixvm-fra01"; # Define your hostname. domain = "as205479.net"; nameservers = ["8.8.8.8" "8.8.4.4"]; useDHCP = false; defaultGateway = { address = "141.98.136.97"; interface = "ens-inet"; }; defaultGateway6 = { address = "2a09:11c0:f1:bc0b::1"; interface = "ens-inet"; }; interfaces = { ens-inet = { ipv4.addresses = [ { address = "141.98.136.124"; prefixLength = 27; } ]; ipv6.addresses = [ { address = "2a09:11c0:f1:bc0b::2"; prefixLength = 64; } ]; }; ens-kleyrex = { ipv4.addresses = [ { address = "193.189.83.41"; prefixLength = 23; } ]; ipv6.addresses = [ { address = "2001:7f8:33::a120:5479:1"; prefixLength = 48; } ]; }; ens-locix = { ipv4.addresses = [ { address = "185.1.166.219"; prefixLength = 23; } ]; ipv6.addresses = [ { address = "2001:7f8:f2:e1::a20:5479:1"; prefixLength = 48; } ]; }; ens-nlix = { ipv4.addresses = [ { address = "193.239.118.225"; prefixLength = 22; } ]; ipv6.addresses = [ { address = "2001:7f8:13::a520:5479:1"; prefixLength = 64; } ]; }; }; }; services.udev.extraRules = '' ATTR{address}=="00:50:56:a3:b0:5e", NAME="ens-inet" ATTR{address}=="00:50:56:a3:27:bd", NAME="ens-kleyrex" ATTR{address}=="00:50:56:a3:95:72", NAME="ens-locix" ATTR{address}=="00:50:56:a3:6e:0f", NAME="ens-nlix" ''; environment.systemPackages = with pkgs; []; # Define a user account. users.users = { lukegb.extraGroups = [ "networkmanager" "bird2" ]; }; services.lukegbgp = let local = { asn = 205479; }; in { enable = true; config = { local = { routerID = "141.98.136.124"; }; peering = { ixvm = { local = local // { v4 = "141.98.136.124"; v6 = "2a09:11c0:f1:bc0b::2"; }; remote = { asn = 56381; export_community = 2000; routers = [{ v4 = "141.98.136.97"; v6 = "2a09:11c0:f1:bc0b::1"; } { v4 = "141.98.136.126"; v6 = "2a09:11c0:f1:bc0b::3"; }]; }; }; kleyrex = { local = local // { v4 = "193.189.83.41"; v6 = "2001:7f8:33::a120:5479:1"; }; remote = { asn = 31142; export_community = 2001; routers = [{ v4 = "193.189.82.251"; v6 = "2001:7f8:33::a103:1142:1"; } { v4 = "193.189.82.252"; v6 = "2001:7f8:33::a103:1142:2"; } { v4 = "193.189.82.253"; v6 = "2001:7f8:33::a103:1142:3"; }]; }; }; locix = { local = local // { v4 = "185.1.166.219"; v6 = "2001:7f8:f2:e1::a20:5479:1"; }; remote = { asn = 202409; export_community = 2002; routers = [{ v4 = "185.1.166.100"; v6 = "2001:7f8:f2:e1::babe:1"; } { v4 = "185.1.166.200"; v6 = "2001:7f8:f2:e1::dead:1"; } { v4 = "185.1.166.254"; v6 = "2001:7f8:f2:e1::be5a"; }]; }; }; nlix = { local = local // { v4 = "193.239.118.225"; v6 = "2001:7f8:13::a520:5479:1"; }; remote = { asn = 34307; export_community = 2003; routers = [{ v4 = "193.239.116.255"; v6 = "2001:7f8:13::a503:4307:1"; } { enabled = false; v4 = "193.239.117.0"; v6 = "2001:7f8:13::a503:4307:2"; }]; }; }; }; }; }; system.stateVersion = "20.03"; }