Skip to content

Instantly share code, notes, and snippets.

@superherointj
Created June 7, 2021 17:15
Show Gist options
  • Save superherointj/b389fa9d4fdcbe1a5ce2150cf239e9f3 to your computer and use it in GitHub Desktop.
Save superherointj/b389fa9d4fdcbe1a5ce2150cf239e9f3 to your computer and use it in GitHub Desktop.
Flakes p/ Multiplos hosts
{
description = "superherointj NixOS configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs = { nixpkgs = { follows = "nixpkgs"; }; };
};
};
outputs =
inputs@{ self, nixpkgs, home-manager, ... }: {
# Esquema para mapear automaticamente multiplos hosts.
nixosConfigurations = (builtins.mapAttrs (name: value:
(nixpkgs.lib.nixosSystem
(import (./. + "/hosts/${name}/default.nix") {
inherit home-manager;
}))) (builtins.readDir (./hosts)));
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment