NixServerConfig/flake.nix

34 lines
842 B
Nix

{
description = "My homelab config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
agenix.url = "github:ryantm/agenix";
};
outputs = { self, nixpkgs, agenix, ... }:
let
system = "x86_64-linux";
lib = nixpkgs.lib;
mkHost = hostName: nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit hostName; };
modules = [
./configuration.nix
(./. + "/host/hard-${hostName}.nix")
agenix.nixosModules.default
{
networking.hostName = hostName;
environment.systemPackages = [ agenix.packages.${system}.default ];
}
];
};
hosts = [
"ThinkCentre-Server-004"
"VPS-Server-005"
];
in {
nixosConfigurations = lib.genAttrs hosts mkHost;
};
}