devos/hosts/default.nix
Timothy DeHerrera 44bae21564
nix#registry: update names
Continuing the work from 487fa7ea26,
simplify the registry entries a bit more by simply refering to the
input flakes. Also add alias `orch` for easy search `override`.
2021-03-01 20:11:23 -07:00

90 lines
2 KiB
Nix

{ extern
, home
, lib
, nixos
, nixos-hardware
, override
, pkgs
, self
, system
, ...
}:
let
inherit (lib.flk) recImport nixosSystemExtended defaultImports;
inherit (builtins) attrValues removeAttrs;
suites = import ../suites { inherit lib; };
config = hostName:
nixosSystemExtended {
inherit system;
specialArgs = extern.specialArgs // { inherit suites; };
modules =
let
core = ../profiles/core;
modOverrides = { config, overrideModulesPath, ... }:
let
overrides = import ../overrides;
inherit (overrides) modules disabledModules;
in
{
disabledModules = modules ++ disabledModules;
imports = map
(path: "${overrideModulesPath}/${path}")
modules;
};
global = {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
hardware.enableRedistributableFirmware = lib.mkDefault true;
networking.hostName = hostName;
nix.nixPath = [
"nixpkgs=${nixos}"
"nixos-config=${self}/compat/nixos"
"home-manager=${home}"
];
nixpkgs = { inherit pkgs; };
nix.registry = {
devos.flake = self;
nixos.flake = nixos;
override.flake = override;
};
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
};
local = {
require = [
(import "${toString ./.}/${hostName}.nix")
];
};
# Everything in `./modules/list.nix`.
flakeModules =
attrValues self.nixosModules;
in
flakeModules ++ [
core
global
local
modOverrides
] ++ extern.modules;
};
hosts = recImport {
dir = ./.;
_import = config;
};
in
hosts