From aadb19ea2901c06447e49b796fc056263c05e8a0 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Mon, 1 Sep 2025 11:46:11 +0700 Subject: [PATCH] feat(infra): bootstrap k3s with FluxCD on pure Nix --- infra/_modules/nixos/flake.nix | 1 + infra/_modules/nixos/profiles/k3s-addons.nix | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 infra/_modules/nixos/profiles/k3s-addons.nix diff --git a/infra/_modules/nixos/flake.nix b/infra/_modules/nixos/flake.nix index e1ea1a3..c2ee074 100644 --- a/infra/_modules/nixos/flake.nix +++ b/infra/_modules/nixos/flake.nix @@ -30,6 +30,7 @@ ./configuration.nix ./disks.nix ./profiles/k3s-server.nix + ./profiles/k3s-addons.nix { networking.hostName = "kube-1"; systemd.network.networks."30-wan" = { diff --git a/infra/_modules/nixos/profiles/k3s-addons.nix b/infra/_modules/nixos/profiles/k3s-addons.nix new file mode 100644 index 0000000..86cea4c --- /dev/null +++ b/infra/_modules/nixos/profiles/k3s-addons.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: + +# TODO figure out if I can do this on all servers without conflict +{ + services = { + k3s = { + manifests = { + flux = { + source = pkgs.fetchurl { + # nix-prefetch-url + url = "https://github.com/fluxcd/flux2/releases/download/v2.6.4/install.yaml"; + sha256 = "1f1smpa5jwmb6x13w2zb8wdp8a4b2i386h6yp6s2frv64fl47l3w"; + }; + }; + }; + }; + }; +} -- 2.51.2