{ description = "Entrypoint of all nix configurations"; inputs = { darwin.url = "github:lnl7/nix-darwin"; disko.url = "github:nix-community/disko"; hardware.url = "github:nixos/nixos-hardware"; home-manager.url = "github:nix-community/home-manager"; mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; nh.url = "github:viperML/nh"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nix-custom.url = "git+https://forgejo.invariantspace.com/macronova/nix-custom"; sops-nix.url = "github:Mic92/sops-nix"; }; outputs = inputs@{ self, darwin, nixpkgs, nix-custom, ... }: let linuxCfgDir = ./linux; templateDir = ./template; in { nixosConfigurations = builtins.mapAttrs (instance: _: nixpkgs.lib.nixosSystem ({ modules = [ # Import config from folder (linuxCfgDir + "/${instance}") # Setup Nix ({ pkgs, ... }: { networking.hostName = instance; nix = { gc = { automatic = true; options = "--delete-older-than 30d"; }; settings = { experimental-features = [ "nix-command" "flakes" ]; auto-optimise-store = true; }; }; nixpkgs = { config.allowUnfree = true; overlays = [ nix-custom.overlay ]; }; }) ]; specialArgs = { inherit inputs; }; })) (builtins.readDir linuxCfgDir); templates = builtins.mapAttrs (template: _: { path = templateDir + "/${template}"; description = "Template flake setup: ${template}"; }) (builtins.readDir templateDir); }; }