nix/flake.nix

51 lines
1.4 KiB
Nix

{
description = "nix los hier";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
nixpkgs,
agenix,
disko,
...
}@inputs:
let
uncurry = f: args: f (builtins.elemAt args 0) (builtins.elemAt args 1) (builtins.elemAt args 2);
mkSystem = host: sys: state: {
"${host}" = nixpkgs.lib.nixosSystem {
system = sys;
specialArgs = inputs;
modules = [
(./hosts + "/${host}")
{ system.stateVersion = state; }
agenix.nixosModules.default
disko.nixosModules.disko
{
nixpkgs.hostPlatform = nixpkgs.lib.mkDefault sys;
environment.systemPackages = [ agenix.packages.${sys}.default ];
}
];
};
};
in
{
nixosConfigurations = nixpkgs.lib.mergeAttrsList (
nixpkgs.lib.forEach [
[ "APPA" "x86_64-linux" "23.05" ]
[ "MOMO" "aarch64-linux" "25.11" ]
[ "PABU" "x86_64-linux" "24.05" ]
] (uncurry mkSystem)
);
};
}