homelab framework module init (everything is a mess)
Some checks failed
Test / tests (push) Has been cancelled
/ OpenTofu (push) Has been cancelled

This commit is contained in:
plasmagoat 2025-07-28 02:05:13 +02:00
parent 0347f4d325
commit bcbcc8b17b
94 changed files with 7289 additions and 436 deletions

View file

@ -27,18 +27,18 @@
# systems,
sops-nix,
# home-manager,
colmena,
simple-nixos-mailserver,
...
} @ inputs: let
inherit (self) outputs;
lib = nixpkgs.lib;
# Supported systems for your flake packages, shell, etc.
systems = [
"x86_64-linux"
];
# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;
forAllSystems = lib.genAttrs systems;
in {
# Custom packages
# Accessible through 'nix build', 'nix shell', etc
@ -54,33 +54,35 @@
# Reusable nixos modules
nixosModules = import ./modules/nixos;
colmenaHive = colmena.lib.makeHive self.outputs.colmena;
colmena = {
meta = {
nixpkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
colmenaHive = inputs.colmena.lib.makeHive self.outputs.colmena;
colmena = import ./colmena.nix {inherit inputs outputs;};
colmena.overlays.default
# Development shells
devShells = forAllSystems (
system: let
inherit (inputs.colmena.packages."${pkgs.system}") colmena;
pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.mkShell {
packages = with pkgs; [
# colmena
sops
age
nix-output-monitor
jq
ssh-to-age # For converting SSH keys to age keys
];
config.allowUnfree = true;
shellHook = ''
echo "🏠 Homelab Development Environment"
echo "Available commands:"
echo " colmena apply - Deploy all hosts"
echo " colmena apply --on HOST - Deploy specific host"
echo " sops secrets/secrets.yaml - Edit secrets"
echo ""
'';
};
specialArgs = {
inherit inputs outputs;
};
};
defaults = import ./machines/_default/configuration.nix;
sandbox = import ./machines/sandbox/configuration.nix;
auth = import ./machines/auth/configuration.nix;
mail = import ./machines/mail/configuration.nix;
monitor = import ./machines/monitor/configuration.nix;
photos = import ./machines/photos/configuration.nix;
};
}
);
};
}