ark/hosts/default.nix

91 lines
1.9 KiB
Nix
Raw Normal View History

{ extern
, home
, lib
, nixos
, nixos-hardware
, override
, pkgs
, self
, system
, ...
}:
let
inherit (lib.flk) recImport nixosSystemExtended defaultImports;
2020-01-04 08:06:31 +03:00
inherit (builtins) attrValues removeAttrs;
2021-02-06 23:26:17 +03:00
suites = import ../suites { inherit lib; };
config = hostName:
2021-01-28 05:11:38 +03:00
nixosSystemExtended {
inherit system;
2021-02-05 09:42:46 +03:00
specialArgs = extern.specialArgs // { inherit suites; };
2020-12-31 23:42:49 +03:00
2020-07-31 07:17:28 +03:00
modules =
let
core = ../profiles/core;
2020-07-31 07:17:28 +03:00
2021-02-14 05:38:20 +03:00
modOverrides = { config, overrideModulesPath, ... }:
let
2021-02-14 05:38:20 +03:00
overrides = import ../overrides;
inherit (overrides) modules disabledModules;
in
{
disabledModules = modules ++ disabledModules;
imports = map
2021-02-14 05:38:20 +03:00
(path: "${overrideModulesPath}/${path}")
modules;
};
global = {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
2020-07-31 07:17:28 +03:00
hardware.enableRedistributableFirmware = lib.mkDefault true;
2020-07-31 07:17:28 +03:00
networking.hostName = hostName;
2020-08-04 09:11:08 +03:00
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;
};
2021-02-04 02:41:21 +03:00
local = {
require = [
"${toString ./.}/${hostName}.nix"
2021-02-04 02:41:21 +03:00
];
};
2020-07-31 07:17:28 +03:00
# Everything in `./modules/list.nix`.
flakeModules =
attrValues self.nixosModules;
2020-07-31 07:17:28 +03:00
in
2021-01-01 00:11:32 +03:00
flakeModules ++ [
core
global
local
modOverrides
] ++ extern.modules;
};
2020-01-04 08:06:31 +03:00
hosts = recImport {
dir = ./.;
_import = config;
};
2020-07-31 07:17:28 +03:00
in
hosts