homelab framework module init (everything is a mess)
This commit is contained in:
parent
0347f4d325
commit
bcbcc8b17b
94 changed files with 7289 additions and 436 deletions
59
colmena.nix
Normal file
59
colmena.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# colmena.nix - Separate file to keep flake.nix clean
|
||||
{
|
||||
inputs,
|
||||
outputs,
|
||||
}: let
|
||||
inherit (inputs.nixpkgs) lib;
|
||||
|
||||
# Helper to create a host configuration
|
||||
mkHost = {
|
||||
hostname,
|
||||
profile ? "proxmox-vm",
|
||||
modules ? [],
|
||||
specialArgs ? {},
|
||||
}: {
|
||||
imports =
|
||||
[
|
||||
# Base profile (determines hardware/platform specifics)
|
||||
(./. + "/profiles/${profile}.nix")
|
||||
# Host-specific configuration
|
||||
(./. + "/hosts/${hostname}")
|
||||
# Additional modules
|
||||
]
|
||||
++ modules;
|
||||
|
||||
# Pass through special args and our outputs
|
||||
_module.args =
|
||||
specialArgs
|
||||
// {
|
||||
inherit inputs outputs;
|
||||
};
|
||||
};
|
||||
in {
|
||||
meta = {
|
||||
nixpkgs = import inputs.nixpkgs {
|
||||
system = "x86_64-linux";
|
||||
overlays = [
|
||||
outputs.overlays.additions
|
||||
outputs.overlays.modifications
|
||||
outputs.overlays.unstable-packages
|
||||
inputs.colmena.overlays.default
|
||||
];
|
||||
};
|
||||
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
};
|
||||
|
||||
defaults = import ./hosts/default.nix;
|
||||
|
||||
# Define your hosts
|
||||
sandbox = mkHost {
|
||||
hostname = "sandbox";
|
||||
profile = "proxmox-vm";
|
||||
};
|
||||
|
||||
photos = mkHost {
|
||||
hostname = "photos";
|
||||
profile = "proxmox-vm";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue