mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
41 lines
1.2 KiB
Nix
41 lines
1.2 KiB
Nix
{
|
|
systemConfig,
|
|
gensokyo-zone,
|
|
lib,
|
|
modulesPath,
|
|
...
|
|
}: let
|
|
inherit (gensokyo-zone.lib) unmerged;
|
|
inherit (lib.modules) mkIf mkMerge mkDefault;
|
|
inherit (lib.attrsets) mapAttrsToList;
|
|
inherit (systemConfig) proxmox;
|
|
in {
|
|
imports = [
|
|
(modulesPath + "/virtualisation/proxmox-lxc.nix")
|
|
];
|
|
|
|
services.getty.autologinUser = mkDefault "root";
|
|
documentation.enable = mkDefault false;
|
|
|
|
environment.variables = {
|
|
# nix default is way too big
|
|
GC_INITIAL_HEAP_SIZE = mkDefault "8M";
|
|
};
|
|
|
|
proxmoxLXC.privileged = mkIf (proxmox.container.enable && proxmox.container.privileged) true;
|
|
|
|
systemd.network = mkIf proxmox.enabled (mkMerge (mapAttrsToList (_: interface:
|
|
mkIf (interface.enable && interface.networkd.enable) {
|
|
networks.${interface.networkd.name} = unmerged.mergeAttrs interface.networkd.networkSettings;
|
|
})
|
|
proxmox.network.interfaces));
|
|
|
|
networking.firewall.interfaces = let
|
|
inherit (proxmox.network) internal;
|
|
intConditions = ["iifname ${internal.interface.name}"];
|
|
in
|
|
mkIf (internal.interface != null) {
|
|
lan.nftables.conditions = intConditions;
|
|
local.nftables.conditions = intConditions;
|
|
};
|
|
}
|