nixos-servers/nix/flake/kubenix/default.nix

79 lines
2.3 KiB
Nix
Raw Normal View History

{ self, flake-utils, kubenix, nixhelm, ... }: flake-utils.lib.eachDefaultSystem
(system: {
kubenix = kubenix.packages.${system}.default.override {
specialArgs.flake = self;
module = { kubenix, ... }: {
2024-03-26 19:26:02 +00:00
imports = [
kubenix.modules.k8s
kubenix.modules.helm
2024-03-27 20:20:22 +00:00
./freshrss.nix
./cyberchef.nix
2024-03-27 22:19:47 +00:00
./kms.nix
./inbucket.nix
2024-03-28 20:10:15 +00:00
./radicale.nix
2024-03-28 20:44:21 +00:00
./syncthing.nix
./nextcloud.nix
./pihole.nix
# ./hedgedoc.nix
2024-03-29 12:50:51 +00:00
./paperless-ngx.nix
2024-03-29 13:26:05 +00:00
./kitchenowl.nix
2024-03-29 14:49:34 +00:00
./forgejo.nix
2024-04-06 14:15:01 +00:00
./media.nix
2024-03-26 19:26:02 +00:00
];
kubernetes.kubeconfig = "~/.kube/config";
kubenix.project = "home";
kubernetes = {
customTypes = {
# HACK: These are dummy custom types.
2024-03-26 19:26:02 +00:00
# This is needed, because the CRDs imported as a chart are not available as Nix modules.
# There is no nix-based validation on resources defined using these types!
# See: https://github.com/hall/kubenix/issues/34
2024-03-26 19:26:02 +00:00
ipAddressPool = {
attrName = "ipAddressPools";
group = "metallb.io";
version = "v1beta1";
kind = "IPAddressPool";
};
2024-03-26 19:26:02 +00:00
l2Advertisement = {
attrName = "l2Advertisements";
group = "metallb.io";
version = "v1beta1";
kind = "L2Advertisement";
};
2024-03-27 22:11:34 +00:00
helmChartConfig = {
attrName = "helmChartConfigs";
group = "helm.cattle.io";
version = "v1";
kind = "HelmChartConfig";
};
};
resources = {
2024-03-27 20:23:12 +00:00
ipAddressPools.main.spec.addresses = [ "192.168.30.128-192.168.30.200" ];
2024-03-26 19:26:02 +00:00
l2Advertisements.main.metadata = { };
2024-03-27 22:11:34 +00:00
# Override Traefik's service with a static load balancer IP.
helmChartConfigs.traefik = {
metadata.namespace = "kube-system";
spec.valuesContent = ''
service:
spec:
loadBalancerIP: "192.168.30.128"
'';
};
};
helm.releases.metallb = {
chart = nixhelm.chartsDerivations.${system}.metallb.metallb;
includeCRDs = true;
};
};
};
};
})