nixos-config/flake.nix

33 lines
869 B
Nix

{
description = "Fudo Host Configuration";
inputs = {
nixpkgs.url = "nixpkgs/nixos-21.05";
hosts.url = "path:../fudo-hosts";
home-manager.url = "github:nix-community/home-manager/release-21.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { nixpkgs, hosts, home-manager, ... }: with builtins; let
mapAttrs = f: m: listToAttrs
(map (k: { name = k; value = f k m.${k}; }) (attrNames m));
in {
nixosConfigurations = mapAttrs (hostname: hostOpts: let
pkgs = import nixpkgs { system = hostOpts.arch; };
in pkgs.lib.nixosSystem {
system = hostOpts.arch;
modules = [
(import ./initialize.nix {
hostname = hostname;
home-manager-package = home-manager;
pkgs = pkgs;
include-secrets = true;
})
];
}) hosts.host-configs;
};
}