config/flake.nix

33 lines
855 B
Nix
Raw Normal View History

2024-11-17 20:28:14 +01:00
{
description = "Homelab configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2024-11-22 18:05:37 +01:00
impermanence.url = "github:nix-community/impermanence";
2024-12-26 19:41:49 +01:00
# Sops-nix, a secrets manager
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
2024-11-17 20:28:14 +01:00
};
outputs =
{ self, nixpkgs, ... }@inputs:
let
outputs = self.outputs;
utils = import ./utils.nix { inherit nixpkgs inputs outputs; };
2024-12-26 17:22:00 +01:00
homelabConfig = import ./config.nix;
roles = import ./roles { inherit utils; };
hosts = import ./hosts.nix { inherit homelabConfig roles; };
2024-11-17 20:28:14 +01:00
in
{
2024-12-26 17:22:00 +01:00
nixosConfigurations = nixpkgs.lib.mapAttrs (
2024-12-26 19:20:22 +01:00
hostname: value:
(utils.mkSystem {
inherit hosts;
hostConfig = (value // { inherit hostname; });
})
2024-12-26 17:22:00 +01:00
) hosts;
2024-11-17 20:28:14 +01:00
};
}