|
11 | 11 |
|
12 | 12 | inputs = { |
13 | 13 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; |
| 14 | + colmena.url = "github:zhaofengli/colmena"; |
14 | 15 | sops-nix.url = "github:Mic92/sops-nix"; |
15 | | - nix-minecraft.url = "github:Infinidoge/nix-minecraft"; |
16 | 16 | }; |
17 | 17 |
|
18 | 18 | outputs = |
19 | | - inputs@{ self, nixpkgs, ... }: |
| 19 | + inputs@{ |
| 20 | + self, |
| 21 | + nixpkgs, |
| 22 | + colmena, |
| 23 | + ... |
| 24 | + }: |
20 | 25 | let |
21 | 26 | system = "x86_64-linux"; |
22 | 27 | pkgs = nixpkgs.legacyPackages.${system}; |
23 | 28 | in |
24 | 29 | { |
25 | | - # The itx server hosting most of my homelab. |
26 | | - nixosConfigurations.itxserver = nixpkgs.lib.nixosSystem { |
27 | | - specialArgs = { inherit inputs; }; |
28 | | - modules = [ ./hosts/itxserver/configuration.nix ]; |
| 30 | + # Define a local nix-develop environment |
| 31 | + devShells.${system}.default = pkgs.mkShell { |
| 32 | + buildInputs = [ colmena.packages.${system}.colmena ]; |
| 33 | + }; |
| 34 | + |
| 35 | + # Manage the entire fleet with colmena |
| 36 | + colmenaHive = colmena.lib.makeHive { |
| 37 | + meta = { |
| 38 | + nixpkgs = import nixpkgs { |
| 39 | + inherit system; |
| 40 | + }; |
| 41 | + specialArgs = { inherit inputs; }; |
| 42 | + }; |
| 43 | + |
| 44 | + # The itx server hosting most of my homelab |
| 45 | + alfa = { |
| 46 | + deployment = { |
| 47 | + targetHost = "100.89.38.72"; |
| 48 | + targetUser = "lukas"; |
| 49 | + tags = [ "homelab" ]; |
| 50 | + }; |
| 51 | + |
| 52 | + imports = [ |
| 53 | + ./hosts/itxserver/configuration.nix |
| 54 | + ]; |
| 55 | + }; |
29 | 56 | }; |
30 | 57 |
|
| 58 | + # Although the whole fleet can be managed with colmena, I like to have a |
| 59 | + # vanilla nixos fallback option in case colmena breaks. |
| 60 | + # ---------------------------------------------------------------------- |
| 61 | + |
| 62 | + # The itx server hosting most of my homelab |
31 | 63 | nixosConfigurations.alfa = nixpkgs.lib.nixosSystem { |
32 | 64 | specialArgs = { inherit inputs; }; |
33 | | - modules = [ ./hosts/s-alfa/default.nix ]; |
| 65 | + modules = [ ./hosts/itxserver/configuration.nix ]; |
34 | 66 | }; |
35 | 67 | }; |
36 | 68 | } |
0 commit comments