feat: format via 'ls **/*.nix | each { |it| nixfmt $it.name }'

This commit is contained in:
Ryan Yin
2025-07-30 12:17:24 +08:00
parent d10b30b06b
commit 13bb77108c
219 changed files with 2103 additions and 1728 deletions

View File

@@ -3,11 +3,13 @@
hostName,
networking,
...
}: let
}:
let
inherit (networking) defaultGateway defaultGateway6 nameservers;
inherit (networking.hostsAddr.${hostName}) iface ipv4;
ipv4WithMask = "${ipv4}/24";
in {
in
{
# supported file systems, so we can mount any removable disks with these filesystems
boot.supportedFilesystems = [
"ext4"
@@ -21,7 +23,10 @@ in {
"nfs" # required by longhorn
];
boot.kernelModules = ["kvm-amd" "vfio-pci"];
boot.kernelModules = [
"kvm-amd"
"vfio-pci"
];
boot.extraModprobeConfig = "options kvm_amd nested=1"; # for amd cpu
boot.kernel.sysctl = {
@@ -93,7 +98,7 @@ in {
ovsbr1 = {
# Attach the interfaces to OVS bridge
# This interface should not used by the host itself!
interfaces.${iface} = {};
interfaces.${iface} = { };
};
};
@@ -102,9 +107,9 @@ in {
# Set the host's address on the OVS bridge interface instead of the physical interface!
systemd.network.networks = {
"10-ovsbr1" = {
matchConfig.Name = ["ovsbr1"];
matchConfig.Name = [ "ovsbr1" ];
networkConfig = {
Address = [ipv4WithMask];
Address = [ ipv4WithMask ];
DNS = nameservers;
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
@@ -124,7 +129,7 @@ in {
linkConfig.RequiredForOnline = "routable";
};
"20-${iface}" = {
matchConfig.Name = [iface];
matchConfig.Name = [ iface ];
networkConfig.LinkLocalAddressing = "no";
# tell networkd ignore this interface.
# it's managed by openvswitch