2021-02-14 23:50:49 +01:00
|
|
|
{ extern
|
|
|
|
, home
|
|
|
|
, lib
|
2020-08-02 06:08:41 +02:00
|
|
|
, nixos
|
2021-02-14 23:50:49 +01:00
|
|
|
, override
|
2021-01-19 08:51:23 +01:00
|
|
|
, pkgs
|
2020-08-02 06:08:41 +02:00
|
|
|
, self
|
|
|
|
, system
|
|
|
|
, ...
|
|
|
|
}:
|
2019-12-05 06:36:36 +01:00
|
|
|
let
|
2021-03-14 08:10:51 +01:00
|
|
|
inherit (lib) dev;
|
2019-12-05 06:36:36 +01:00
|
|
|
|
2021-02-06 21:26:17 +01:00
|
|
|
suites = import ../suites { inherit lib; };
|
2021-02-02 04:26:47 +01:00
|
|
|
|
2021-03-17 23:41:54 +01:00
|
|
|
modules = {
|
|
|
|
core = ../profiles/core;
|
|
|
|
modOverrides = { config, overrideModulesPath, ... }:
|
|
|
|
let
|
|
|
|
overrides = import ../overrides;
|
|
|
|
inherit (overrides) modules disabledModules;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
disabledModules = modules ++ disabledModules;
|
|
|
|
imports = map
|
|
|
|
(path: "${overrideModulesPath}/${path}")
|
|
|
|
modules;
|
|
|
|
};
|
2021-03-14 08:10:51 +01:00
|
|
|
|
2021-03-17 23:41:54 +01:00
|
|
|
global = {
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
2021-03-14 08:10:51 +01:00
|
|
|
|
2021-03-17 23:41:54 +01:00
|
|
|
hardware.enableRedistributableFirmware = lib.mkDefault true;
|
2021-03-14 08:10:51 +01:00
|
|
|
|
2021-03-17 23:41:54 +01:00
|
|
|
nix.nixPath = [
|
|
|
|
"nixpkgs=${nixos}"
|
|
|
|
"nixos-config=${self}/compat/nixos"
|
|
|
|
"home-manager=${home}"
|
|
|
|
];
|
2021-03-14 08:10:51 +01:00
|
|
|
|
2021-03-17 23:41:54 +01:00
|
|
|
nixpkgs = { inherit pkgs; };
|
2021-03-14 08:10:51 +01:00
|
|
|
|
2021-03-17 23:41:54 +01:00
|
|
|
nix.registry = {
|
|
|
|
devos.flake = self;
|
|
|
|
nixos.flake = nixos;
|
|
|
|
override.flake = override;
|
2021-03-14 08:10:51 +01:00
|
|
|
};
|
|
|
|
|
2021-03-17 23:41:54 +01:00
|
|
|
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
|
|
|
|
};
|
2021-03-14 08:10:51 +01:00
|
|
|
|
2021-03-17 23:41:54 +01:00
|
|
|
# Everything in `./modules/list.nix`.
|
|
|
|
flakeModules = { imports = builtins.attrValues self.nixosModules ++ extern.modules; };
|
|
|
|
};
|
2021-03-14 08:10:51 +01:00
|
|
|
|
|
|
|
specialArgs = extern.specialArgs // { inherit suites; };
|
|
|
|
|
|
|
|
mkHostConfig = hostName:
|
|
|
|
let
|
|
|
|
local = {
|
|
|
|
require = [
|
|
|
|
"${toString ./.}/${hostName}.nix"
|
|
|
|
];
|
|
|
|
|
|
|
|
networking = { inherit hostName; };
|
2021-03-16 20:50:38 +01:00
|
|
|
|
|
|
|
_module.args = {
|
|
|
|
inherit self;
|
2021-03-16 22:22:38 +01:00
|
|
|
hosts = builtins.mapAttrs (_: host: host.config)
|
|
|
|
(removeAttrs hosts [ hostName ]);
|
2021-03-16 20:50:38 +01:00
|
|
|
};
|
2021-03-14 08:10:51 +01:00
|
|
|
};
|
2021-03-17 23:41:54 +01:00
|
|
|
lib = {
|
|
|
|
lib = { inherit specialArgs; };
|
|
|
|
lib.testModule = {
|
|
|
|
imports = builtins.attrValues modules;
|
|
|
|
};
|
|
|
|
};
|
2021-03-14 08:10:51 +01:00
|
|
|
in
|
|
|
|
dev.os.devosSystem {
|
|
|
|
inherit system specialArgs;
|
2021-03-17 23:41:54 +01:00
|
|
|
modules = modules // { inherit local lib; };
|
2019-12-14 05:30:43 +01:00
|
|
|
};
|
2019-12-18 00:03:44 +01:00
|
|
|
|
2021-03-14 08:10:51 +01:00
|
|
|
hosts = dev.os.recImport
|
|
|
|
{
|
|
|
|
dir = ./.;
|
|
|
|
_import = mkHostConfig;
|
|
|
|
};
|
2020-07-31 06:17:28 +02:00
|
|
|
in
|
|
|
|
hosts
|