{ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.09"; inputs.nixpkgs_unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs.nix.url = "github:orbekk/nix/master"; inputs.nix.inputs.nixpkgs.follows = "nixpkgs"; outputs = { self, nixpkgs, nixpkgs_unstable, nix }: { nixosConfigurations = let mkConfig = { hostName , module ? (./. + "/machines/${hostName}.nix") , system ? "x86_64-linux" }: { name = hostName; value = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ module ({config, pkgs, ...}: { # Let 'nixos-version --json' know about the Git revision # of this flake. system.configurationRevision = if self ? rev then self.rev else "DIRTY"; nixpkgs.overlays = [ # Add unstable packages. (final: prev: { unstable = nixpkgs_unstable.legacyPackages."x86_64-linux"; }) # For git+file support with bare repo. nix.overlay (final: prev: { nixFlakes = final.nix; }) ]; }) ]; }; }; myMachines = [ { hostName = "pincer"; module = ./machines/x1-pincer.nix; } { hostName = "dragon"; } { hostName = "firelink"; } ]; in builtins.listToAttrs (map mkConfig myMachines); }; }