-
Notifications
You must be signed in to change notification settings - Fork 5
/
flake.nix
84 lines (71 loc) · 2.32 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
description = "k0s - The Zero Friction Kubernetes for NixOS";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
outputs = { nixpkgs, ... }:
let
genPackages = pkgs: rec {
inherit (pkgs.callPackage ./k0s/default.nix {})
k0s_1_27
k0s_1_28
k0s_1_30;
k0s = k0s_1_30;
};
in
rec {
packages =
let
lib = nixpkgs.lib;
allSystems = [ "armv7l-linux" "aarch64-linux" "x86_64-linux" ];
forAllSystems = lib.genAttrs allSystems;
in
forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in genPackages pkgs
);
overlays.default = final: prev: genPackages prev;
nixosConfigurations = {
test = nixpkgs.lib.nixosSystem {
modules = [
{
nixpkgs.system = "x86_64-linux";
nixpkgs.pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [
overlays.default
];
};
}
./nixos/k0s.nix
({ ... }: {
boot.isContainer = true;
services.k0s = {
enable = true;
role = "controller";
# The first controller to bring up does not have a join token,
# it has to be flagged with "isLeader".
# isLeader = true;
spec.api.address = "192.0.2.1";
spec.api.sans = [
"192.0.2.1"
"192.0.2.2"
];
# Test non-default options:
#
# spec.network.provider = "calico";
# spec.network.calico.mode = "bird";
# spec.network.dualStack.enabled = true;
# spec.network.dualStack.IPv6podCIDR = "fd00::/108";
# spec.network.dualStack.IPv6serviceCIDR = "fd01::/108";
# spec.network.controlPlaneLoadBalancing.enabled = true;
# spec.network.nodeLocalLoadBalancing.enabled = true;
# spec.storage.type = "kine";
};
system.stateVersion = "24.05";
})
];
};
};
nixosModules.default = import ./nixos/k0s.nix;
};
}