mirror of
https://github.com/michaelthomson0797/nixos-server.git
synced 2025-12-19 11:28:48 +00:00
initial commit
This commit is contained in:
47
flake.nix
Normal file
47
flake.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
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);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user