feat: introduce treefmt and fmt all

This commit is contained in:
steveej 2024-11-15 10:17:56 +01:00
parent 80250b0179
commit 5d5282a914
213 changed files with 4967 additions and 4423 deletions

View file

@ -9,7 +9,8 @@
system,
variables,
...
}: {
}:
{
system.stateVersion = "24.05";
imports = [
@ -48,7 +49,7 @@
boot.loader.grub.efiSupport = false;
# forcing seems required or else there's an error about duplicated devices
boot.loader.grub.devices = lib.mkForce ["/dev/vda"];
boot.loader.grub.devices = lib.mkForce [ "/dev/vda" ];
disko.devices.disk.vda = {
device = "/dev/vda";
@ -64,14 +65,14 @@
size = "100%";
content = {
type = "btrfs";
extraArgs = ["-f"]; # Override existing partition
extraArgs = [ "-f" ]; # Override existing partition
subvolumes = {
# Subvolume name is different from mountpoint
"/rootfs" = {
mountpoint = "/";
};
"/nix" = {
mountOptions = ["noatime"];
mountOptions = [ "noatime" ];
mountpoint = "/nix";
};
"/boot" = {
@ -156,9 +157,7 @@
interface = "eth0";
address = variables.ipv4gateway;
};
nameservers = [
variables.ipv4dns
];
nameservers = [ variables.ipv4dns ];
# these will be configured via nftables
nat.enable = lib.mkForce false;
@ -176,17 +175,20 @@
snippets.nnf-common.enable = true;
zones.wan = {
interfaces = ["eth0"];
interfaces = [ "eth0" ];
};
zones.vpn = {
interfaces = ["wg0" "wg1"];
interfaces = [
"wg0"
"wg1"
];
};
rules = {
to-fw = {
from = "all";
to = ["fw"];
to = [ "fw" ];
verdict = "drop";
allowedTCPPorts = [
@ -202,8 +204,8 @@
};
vpn-to-wan-nat = {
from = ["vpn"];
to = ["wan"];
from = [ "vpn" ];
to = [ "wan" ];
masquerade = true;
verdict = "accept";
};
@ -283,9 +285,7 @@
systemd.network.networks.wg0 = {
enable = true;
matchConfig.Name = "wg0";
address = [
"10.0.1.0/31"
];
address = [ "10.0.1.0/31" ];
routes = [
{
@ -299,9 +299,7 @@
systemd.network.networks.wg1 = {
enable = true;
matchConfig.Name = "wg1";
address = [
"10.0.1.2/31"
];
address = [ "10.0.1.2/31" ];
routes = [
{