2020-10-26 02:48:12 -07:00
|
|
|
{ inputs, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
with lib.my;
|
|
|
|
let system = "x86_64-linux";
|
|
|
|
in {
|
|
|
|
mkHost = path: attrs @ { system ? system, ... }:
|
|
|
|
nixosSystem {
|
|
|
|
inherit system;
|
|
|
|
specialArgs = { inherit lib inputs; };
|
|
|
|
modules = [
|
|
|
|
{
|
|
|
|
nixpkgs.pkgs = pkgs;
|
|
|
|
networking.hostName = mkDefault (removeSuffix ".nix" (baseNameOf path));
|
|
|
|
}
|
|
|
|
(filterAttrs (n: v: !elem n [ "system" ]) attrs)
|
2021-01-01 21:26:00 -08:00
|
|
|
../. # /default.nix
|
2020-10-26 02:48:12 -07:00
|
|
|
(import path)
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
mapHosts = dir: attrs @ { system ? system, ... }:
|
|
|
|
mapModules dir
|
|
|
|
(hostPath: mkHost hostPath attrs);
|
|
|
|
}
|