mirror of
https://github.com/michaelthomson0797/nixos-server.git
synced 2025-12-19 03:18:49 +00:00
48 lines
1.0 KiB
Nix
48 lines
1.0 KiB
Nix
{
|
|
description = "Michael's NixOS Homelab Flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
disko = {
|
|
url = "github:nix-community/disko";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs = inputs @ {
|
|
nixpkgs,
|
|
disko,
|
|
...
|
|
}: let
|
|
nodes = [
|
|
"patrick"
|
|
"spongebob"
|
|
"larry"
|
|
];
|
|
k3sToken = "FILL THIS IN";
|
|
publicKey = "FILL THIS IN";
|
|
serverAddr = "https://192.168.2.100:6443";
|
|
in {
|
|
nixosConfigurations = builtins.listToAttrs (map (name: {
|
|
name = name;
|
|
value = nixpkgs.lib.nixosSystem {
|
|
specialArgs = {
|
|
inherit inputs;
|
|
meta = {
|
|
hostname = name;
|
|
k3sToken = k3sToken;
|
|
publicKey = publicKey;
|
|
serverAddr = serverAddr;
|
|
};
|
|
};
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
disko.nixosModules.disko
|
|
./hosts/${name}/configuration.nix
|
|
];
|
|
};
|
|
})
|
|
nodes);
|
|
};
|
|
}
|