fix: run other k3s clusters as kubevirt quests, use the interface provided by kubevirt

This commit is contained in:
Ryan Yin
2024-03-31 23:58:38 +08:00
parent 7486e75016
commit c628eaa6c8
38 changed files with 111 additions and 130 deletions
+2 -1
View File
@@ -5,9 +5,10 @@
attrs = import ./attrs.nix {inherit lib;};
genKubeVirtCoreModule = import ./genKubeVirtCoreModule.nix;
genK3sServerModule = import ./genK3sServerModule.nix;
genK3sAgentModule = import ./genK3sAgentModule.nix;
genKubeVirtHostModule = import ./genKubeVirtHostModule.nix;
genKubeVirtGuestModule = import ./genKubeVirtGuestModule.nix;
# use path relative to the root of the project
relativeToRoot = lib.path.append ../.;
+33
View File
@@ -0,0 +1,33 @@
{
pkgs,
hostName,
networking,
...
}: let
inherit (networking.hostsAddr.${hostName}) iface;
in {
# supported file systems, so we can mount any removable disks with these filesystems
boot.supportedFilesystems = [
"ext4"
"btrfs"
"xfs"
"fat"
"vfat"
"exfat"
];
networking = {
inherit hostName;
inherit (networking) defaultGateway nameservers;
inherit (networking.hostsInterface.${hostName}) interfaces;
networkmanager.enable = false;
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}
-7
View File
@@ -17,13 +17,6 @@ in
nixos-modules
++ [
nixos-generators.nixosModules.all-formats
{
# formatConfigs.iso = {config, ...}: {};
formatConfigs.proxmox = {config, ...}: {
# custom proxmox's image name
proxmox.qemuConf.name = "${config.networking.hostName}-nixos-${config.system.nixos.label}";
};
}
]
++ (
lib.optionals ((lib.lists.length home-modules) > 0)