flake: refactor host configuration

This commit is contained in:
Bruno BELANYI 2021-02-18 20:19:11 +00:00
parent 0114e7b668
commit 8d3d3521f3

View file

@ -5,11 +5,11 @@
nur.url = "github:nix-community/NUR";
};
outputs = { self, nixpkgs, nur }: {
nixosConfigurations.porthos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules =
[
outputs = { self, nixpkgs, nur }:
let
buildHost = name: system: nixpkgs.lib.nixosSystem {
inherit system;
modules = [
({ pkgs, ... }: {
# Let 'nixos-version --json' know about the Git revision
# of this flake.
@ -19,8 +19,13 @@
else throw "Refusing to build from a dirty Git tree!";
})
{ nixpkgs.overlays = [ nur.overlay ]; }
./porthos.nix
(./. + "/${name}.nix")
];
};
in
{
nixosConfigurations = nixpkgs.lib.mapAttrs buildHost {
porthos = "x86_64-linux";
};
};
};
}