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