NixOS-Config/flake.nix

36 lines
885 B
Nix
Raw Permalink Normal View History

2024-05-27 20:26:17 +08:00
{
description = "NixOS System Config";
inputs = {
2025-06-12 00:43:35 +08:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.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 = [
2024-06-14 23:02:50 +08:00
"g1"
2025-10-28 22:45:24 +08:00
"c1"
2025-10-28 23:35:46 +08:00
"c2"
2024-05-27 20:26:17 +08:00
];
2025-10-28 01:51:00 +08:00
nasp = (import ./modules/nasp {
lib = nixpkgs.lib;
});
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
2025-10-28 01:51:00 +08:00
nasp.nixosModules.main
2024-05-27 20:26:17 +08:00
sops-nix.nixosModules.sops
];
};
}) nixos-x86_64-hosts));
};
}