map through host names to allow for multiple configs
This commit is contained in:
+36
-8
@@ -1,15 +1,43 @@
|
|||||||
{
|
{
|
||||||
description = "A very basic flake";
|
description = "Server Config Controller";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
|
||||||
|
nixvim.url = "github:nix-community/nixvim";
|
||||||
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager/release-24.11";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
disko = {
|
||||||
|
url = "github:nix-community/disko";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs }: {
|
outputs = { self, nixpkgs, nixvim, home-manager, disko }@inputs:
|
||||||
|
let
|
||||||
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
|
nodes = [
|
||||||
|
"nixos-homelab-00"
|
||||||
packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
|
];
|
||||||
|
in {
|
||||||
|
nixosConfigurations = builtins.listToAttrs (map (name: {
|
||||||
|
name = name;
|
||||||
|
value = nixpkgs.lib.nixosSystem {
|
||||||
|
specialArgs = {
|
||||||
|
meta = { hostname = name; };
|
||||||
|
};
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./configuration.nix
|
||||||
|
./hardware-configuration.nix
|
||||||
|
disko.nixosModules.disko
|
||||||
|
home-manager.nixosModules.home-manager {
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.users.sysAdmin = ./home.nix;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}) nodes);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user