- Create lib/mkFleet.nix to expose fleet generator as library function
- Allow external flakes to use Athenix's fleet logic with custom inventory
- Export lib output in flake.nix with proper input passing
- Enable usage: nixosConfigurations = athenix.lib.mkFleet { fleet = ...; hwTypes = ...; }
105 lines
3.0 KiB
Nix
105 lines
3.0 KiB
Nix
{
|
|
# ============================================================================
|
|
# Flake Entry Point
|
|
# ============================================================================
|
|
# This file defines the inputs (dependencies) and outputs (configurations)
|
|
# for Athenix. It ties together the hardware, software, and user
|
|
# configurations into deployable systems.
|
|
|
|
inputs = {
|
|
# Core NixOS package repository (Release 25.11)
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
|
|
|
# Older kernel packages for Surface compatibility if needed
|
|
nixpkgs-old-kernel.url = "github:NixOS/nixpkgs/nixos-25.05";
|
|
|
|
# Home Manager for user environment management
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-25.11";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# Disko for declarative disk partitioning
|
|
disko = {
|
|
url = "github:nix-community/disko";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# Hardware quirks and configurations
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
|
|
|
agenix = {
|
|
url = "github:yaxitech/ragenix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# Neovim configuration
|
|
lazyvim-nixvim.url = "github:azuwis/lazyvim-nixvim";
|
|
|
|
# VS Code server for remote development
|
|
vscode-server = {
|
|
url = "github:nix-community/nixos-vscode-server";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# NixOS Generators for creating ISOs, LXC, etc.
|
|
nixos-generators = {
|
|
url = "github:nix-community/nixos-generators";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# WSL Support
|
|
nixos-wsl = {
|
|
url = "github:nix-community/NixOS-WSL/main";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
outputs =
|
|
inputs@{
|
|
self,
|
|
nixpkgs,
|
|
nixpkgs-old-kernel,
|
|
home-manager,
|
|
disko,
|
|
agenix,
|
|
lazyvim-nixvim,
|
|
nixos-hardware,
|
|
vscode-server,
|
|
nixos-generators,
|
|
...
|
|
}:
|
|
let
|
|
fleet = self.lib.mkFleet { inherit inputs; };
|
|
linuxSystem = "x86_64-linux";
|
|
artifacts = import ./installer/artifacts.nix {
|
|
inherit inputs fleet self;
|
|
system = linuxSystem;
|
|
};
|
|
forAllSystems = nixpkgs.lib.genAttrs [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"x86_64-darwin"
|
|
"aarch64-darwin"
|
|
];
|
|
in
|
|
{
|
|
# Formatter for 'nix fmt'
|
|
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
|
|
|
|
# Generate NixOS configurations from fleet generator
|
|
nixosConfigurations = fleet.nixosConfigurations;
|
|
|
|
# Expose artifacts to all systems, but they are always built for x86_64-linux
|
|
packages.${linuxSystem} = artifacts;
|
|
|
|
# Expose host type modules and installer modules for external use
|
|
nixosModules = import ./installer/modules.nix { inherit inputs; };
|
|
|
|
# Library functions
|
|
lib = import ./lib { inherit inputs; };
|
|
|
|
# Templates for external configurations
|
|
templates = import ./templates;
|
|
};
|
|
}
|