mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-29 05:41:52 +02:00
30 lines
699 B
Nix
30 lines
699 B
Nix
{
|
|
config,
|
|
pkgs,
|
|
myvars,
|
|
mylib,
|
|
...
|
|
}: let
|
|
hostName = "k3s-test-1-master-2"; # define your hostname.
|
|
|
|
coreModule = mylib.genKubeVirtGuestModule {
|
|
inherit pkgs hostName;
|
|
inherit (myvars) networking;
|
|
};
|
|
k3sModule = mylib.genK3sServerModule {
|
|
inherit pkgs;
|
|
kubeconfigFile = "/home/${myvars.username}/.kube/config";
|
|
tokenFile = config.age.secrets."k3s-test-1-token".path;
|
|
# use my own domain & kube-vip's virtual IP for the API server
|
|
# so that the API server can always be accessed even if some nodes are down
|
|
masterHost = "test-cluster-1.writefor.fun";
|
|
};
|
|
in {
|
|
imports =
|
|
(mylib.scanPaths ./.)
|
|
++ [
|
|
coreModule
|
|
k3sModule
|
|
];
|
|
}
|