NixOS-Config/flake.nix

37 lines
842 B
Nix
Raw Normal View History

2024-05-27 20:26:17 +08:00
{
description = "NixOS System Config";
inputs = {
2024-06-09 15:38:35 +08:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
2024-05-27 20:26:17 +08:00
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, sops-nix, ... }@inputs:
let
nixos-x86_64-hosts = [
"g2"
2024-06-13 20:16:57 +08:00
"g5"
2024-06-13 20:53:47 +08:00
"g6"
2024-06-13 12:48:00 +08:00
"g7"
2024-06-12 13:50:52 +08:00
"g10"
2024-06-11 22:58:29 +08:00
"g11"
"g12"
2024-06-09 15:38:35 +08:00
"g14"
2024-05-27 20:26:17 +08:00
];
in
{
nixosConfigurations = {
} // (builtins.listToAttrs (builtins.map (host: {
name = host;
value = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/${host}/configuration.nix
sops-nix.nixosModules.sops
];
};
}) nixos-x86_64-hosts));
};
}