nix-config/hosts/containers/freifunk/configuration.nix

61 lines
1.5 KiB
Nix

{ config, pkgs, lib, ... }:
let
meshInterface = "bmx";
in {
imports = [
<nixpkgs/nixos/modules/profiles/minimal.nix>
<lib>
<lib/lxc-container.nix>
<lib/shared.nix>
];
c3d2 = {
isInHq = false;
enableHail = false;
};
networking.hostName = "freifunk";
networking.useNetworkd = true;
networking.nameservers = [ "172.20.73.8" "9.9.9.9" ];
# Required for krops
services.openssh.enable = true;
environment.systemPackages = with pkgs; [ git tcpdump ];
systemd.network.networks = {
"10-bmx" = {
enable = true;
matchConfig = { Name = meshInterface; };
networkConfig = {
Address = "10.200.0.15/16";
};
};
"20-core" = {
enable = true;
matchConfig = { Name = "core"; };
networkConfig = {
Address = "172.20.72.40/26";
Gateway = "172.20.72.7";
};
};
};
systemd.services.bmxd =
let
bmxd = import (toString <lib/pkgs/bmxd.nix>) { inherit pkgs; };
in {
after = [ "systemd-networkd.service" ];
wantedBy = [ "network.target" ];
serviceConfig = {
ExecStart = "${bmxd}/sbin/bmxd --no_fork 1 --throw-rules 0 --prio-rules 0 dev=${meshInterface} /linklayer 0";
Restart = "always";
};
};
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "20.03"; # Did you read the comment?
}