nixos-flake/hosts/pinix/configuration.nix

70 lines
1.7 KiB
Nix

{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
../common.nix
./hardware-configuration.nix
];
hardware = {
raspberry-pi."4".apply-overlays-dtmerge.enable = true;
deviceTree = {
enable = true;
filter = "*rpi-4-*.dtb";
overlays = [
{
name = "w1-gpio";
dtboFile = ./w1-gpio.dtbo;
}
];
};
};
boot.kernelModules = [ "pwm_bcm2835" "w1-gpio" ];
#hardware = {
# raspberry-pi."4".apply-overlays-dtmerge.enable = true;
# deviceTree = {
# enable = true;
# filter = "*rpi-4-*.dtb";
# };
# };
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
boot.loader.grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf
boot.loader.generic-extlinux-compatible.enable = true;
networking.hostName = "pinix";
networking.firewall = {
allowedUDPPorts = [ 51820 ]; # Clients and peers can use the same port, see listenport
};
networking.networkmanager.enable = true;
networking.wireguard.interfaces = {
wg0 = {
ips = [ "10.100.0.3/24" ];
listenPort = 51820;
privateKeyFile = "/home/dm/.wireguard/pinix";
peers = [
{ # dmeiburg
publicKey = "jc61U+bmIT8lNxirhjrxpB+rELLUoPhLmUKvUpo/OjY=";
allowedIPs = [ "10.100.0.0/24"];
endpoint = "152.53.0.23:51820";
persistentKeepalive = 25;
}
];
};
};
environment.systemPackages = with pkgs; [
libraspberrypi
raspberrypi-eeprom
];
system.stateVersion = "24.05"; # Did you read the comment?
}