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