ark/hosts/default.nix

50 lines
1.1 KiB
Nix
Raw Normal View History

args@{ home, nixpkgs, self, ... }:
let
inherit (nixpkgs) lib;
utils = import ../lib/utils.nix { inherit lib; };
inherit (utils) recImport;
2019-12-31 04:00:09 +03:00
2020-01-04 08:06:31 +03:00
inherit (builtins) attrValues removeAttrs;
config = hostName:
lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs.usr = { inherit utils; };
modules = let
inherit (home.nixosModules) home-manager;
core = ../profiles/core.nix;
global = {
networking.hostName = hostName;
2019-12-16 07:36:05 +03:00
nix.nixPath = [
"nixpkgs=${nixpkgs}"
"nixos-config=/etc/nixos/configuration.nix"
"nixpkgs-overlays=/etc/nixos/overlays"
2019-12-16 07:36:05 +03:00
];
system.configurationRevision = self.rev;
2019-12-31 03:45:30 +03:00
nixpkgs.overlays = self.overlays;
};
local = import "${toString ./.}/${hostName}.nix";
# Everything in `./modules/list.nix`.
flakeModules =
attrValues (removeAttrs self.nixosModules [ "profiles" ]);
in flakeModules ++ [ core global local home-manager ];
};
2020-01-04 08:06:31 +03:00
hosts = recImport {
dir = ./.;
_import = config;
};
in hosts