2024-03-24 20:23:17 +00:00
|
|
|
{ self, flake-utils, kubenix, nixhelm, ... }: flake-utils.lib.eachDefaultSystem
|
2024-03-23 16:24:39 +00:00
|
|
|
(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
|
2024-03-27 19:43:59 +00:00
|
|
|
./cyberchef.nix
|
2024-03-27 22:19:47 +00:00
|
|
|
./kms.nix
|
2024-03-28 19:27:36 +00:00
|
|
|
./inbucket.nix
|
2024-03-28 20:10:15 +00:00
|
|
|
./radicale.nix
|
2024-03-28 20:44:21 +00:00
|
|
|
./syncthing.nix
|
|
|
|
./nextcloud.nix
|
2024-03-28 22:05:05 +00:00
|
|
|
./pihole.nix
|
2024-03-29 09:24:54 +00:00
|
|
|
# ./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
|
|
|
];
|
2024-03-23 16:24:39 +00:00
|
|
|
kubernetes.kubeconfig = "~/.kube/config";
|
|
|
|
kubenix.project = "home";
|
|
|
|
|
2024-03-24 20:23:17 +00:00
|
|
|
kubernetes = {
|
2024-03-25 20:25:43 +00:00
|
|
|
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!
|
2024-03-25 20:25:43 +00:00
|
|
|
# See: https://github.com/hall/kubenix/issues/34
|
2024-03-26 19:26:02 +00:00
|
|
|
ipAddressPool = {
|
|
|
|
attrName = "ipAddressPools";
|
2024-03-25 20:25:43 +00:00
|
|
|
group = "metallb.io";
|
|
|
|
version = "v1beta1";
|
|
|
|
kind = "IPAddressPool";
|
|
|
|
};
|
|
|
|
|
2024-03-26 19:26:02 +00:00
|
|
|
l2Advertisement = {
|
|
|
|
attrName = "l2Advertisements";
|
2024-03-25 20:25:43 +00:00
|
|
|
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";
|
|
|
|
};
|
2024-03-25 20:25:43 +00:00
|
|
|
};
|
|
|
|
|
2024-03-24 20:23:17 +00:00
|
|
|
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"
|
|
|
|
'';
|
|
|
|
};
|
2024-03-24 20:23:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
helm.releases.metallb = {
|
|
|
|
chart = nixhelm.chartsDerivations.${system}.metallb.metallb;
|
2024-03-25 20:25:43 +00:00
|
|
|
includeCRDs = true;
|
2024-03-23 16:24:39 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|