2021-02-14 22:50:49 +00:00
|
|
|
{ extern
|
|
|
|
, home
|
|
|
|
, lib
|
2020-08-02 04:08:41 +00:00
|
|
|
, nixos
|
2021-01-18 07:37:11 +00:00
|
|
|
, nixos-hardware
|
2021-02-14 22:50:49 +00:00
|
|
|
, override
|
2021-01-19 07:51:23 +00:00
|
|
|
, pkgs
|
2020-08-02 04:08:41 +00:00
|
|
|
, self
|
|
|
|
, system
|
|
|
|
, ...
|
|
|
|
}:
|
2019-12-05 05:36:36 +00:00
|
|
|
let
|
2021-02-02 03:26:47 +00:00
|
|
|
inherit (lib.flk) recImport nixosSystemExtended defaultImports;
|
2020-01-04 05:06:31 +00:00
|
|
|
inherit (builtins) attrValues removeAttrs;
|
2019-12-05 05:36:36 +00:00
|
|
|
|
2021-02-06 20:26:17 +00:00
|
|
|
suites = import ../suites { inherit lib; };
|
2021-02-02 03:26:47 +00:00
|
|
|
|
2020-01-11 06:49:18 +00:00
|
|
|
config = hostName:
|
2021-01-28 02:11:38 +00:00
|
|
|
nixosSystemExtended {
|
2020-01-29 15:50:07 +00:00
|
|
|
inherit system;
|
2019-12-05 05:36:36 +00:00
|
|
|
|
2021-02-05 06:42:46 +00:00
|
|
|
specialArgs = extern.specialArgs // { inherit suites; };
|
2020-12-31 20:42:49 +00:00
|
|
|
|
2020-07-31 04:17:28 +00:00
|
|
|
modules =
|
|
|
|
let
|
2021-02-25 21:47:19 +00:00
|
|
|
core = ../profiles/core;
|
2020-07-31 04:17:28 +00:00
|
|
|
|
2021-02-14 02:38:20 +00:00
|
|
|
modOverrides = { config, overrideModulesPath, ... }:
|
2021-02-04 06:44:58 +00:00
|
|
|
let
|
2021-02-14 02:38:20 +00:00
|
|
|
overrides = import ../overrides;
|
|
|
|
inherit (overrides) modules disabledModules;
|
2021-02-04 06:44:58 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
disabledModules = modules ++ disabledModules;
|
|
|
|
imports = map
|
2021-02-14 02:38:20 +00:00
|
|
|
(path: "${overrideModulesPath}/${path}")
|
2021-02-04 06:44:58 +00:00
|
|
|
modules;
|
|
|
|
};
|
2020-12-31 20:43:34 +00:00
|
|
|
|
2021-02-14 22:50:49 +00:00
|
|
|
global =
|
|
|
|
let
|
|
|
|
inherit (lock) nodes;
|
2020-12-18 20:13:02 +00:00
|
|
|
|
2021-02-14 22:50:49 +00:00
|
|
|
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
|
|
|
|
in
|
|
|
|
{
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
2021-01-17 08:26:38 +00:00
|
|
|
|
2021-02-14 22:50:49 +00:00
|
|
|
hardware.enableRedistributableFirmware = lib.mkDefault true;
|
2020-07-31 04:17:28 +00:00
|
|
|
|
2021-02-14 22:50:49 +00:00
|
|
|
networking.hostName = hostName;
|
2020-07-31 04:17:28 +00:00
|
|
|
|
2021-02-14 22:50:49 +00:00
|
|
|
nix.nixPath = [
|
|
|
|
"nixpkgs=${nixos}"
|
|
|
|
"nixos-config=${self}/compat/nixos"
|
|
|
|
"home-manager=${home}"
|
|
|
|
];
|
2020-08-04 06:11:08 +00:00
|
|
|
|
2021-02-14 22:50:49 +00:00
|
|
|
nixpkgs = { inherit pkgs; };
|
|
|
|
|
|
|
|
nix.registry = {
|
|
|
|
flk.flake = self;
|
|
|
|
|
|
|
|
nixos = {
|
|
|
|
exact = true;
|
2021-03-01 17:03:46 +00:00
|
|
|
from = {
|
|
|
|
id = "nixos";
|
|
|
|
type = "indirect";
|
2021-02-14 22:50:49 +00:00
|
|
|
};
|
|
|
|
to = {
|
2021-03-01 17:03:46 +00:00
|
|
|
inherit (nixos) lastModified narHash rev;
|
2021-02-14 22:50:49 +00:00
|
|
|
|
|
|
|
path = override.outPath;
|
|
|
|
type = "path";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
|
|
|
|
};
|
2020-07-27 04:18:59 +00:00
|
|
|
|
2021-02-03 23:41:21 +00:00
|
|
|
local = {
|
|
|
|
require = [
|
|
|
|
(import "${toString ./.}/${hostName}.nix")
|
|
|
|
];
|
|
|
|
};
|
2020-01-02 02:12:59 +00:00
|
|
|
|
2020-07-31 04:17:28 +00:00
|
|
|
# Everything in `./modules/list.nix`.
|
|
|
|
flakeModules =
|
2021-02-02 03:26:47 +00:00
|
|
|
attrValues self.nixosModules;
|
2020-01-04 03:01:22 +00:00
|
|
|
|
2020-07-31 04:17:28 +00:00
|
|
|
in
|
2020-12-31 21:11:32 +00:00
|
|
|
flakeModules ++ [
|
|
|
|
core
|
|
|
|
global
|
|
|
|
local
|
|
|
|
modOverrides
|
2021-02-04 06:44:58 +00:00
|
|
|
] ++ extern.modules;
|
2019-12-05 05:36:36 +00:00
|
|
|
|
2019-12-14 04:30:43 +00:00
|
|
|
};
|
2019-12-17 23:03:44 +00:00
|
|
|
|
2020-01-04 05:06:31 +00:00
|
|
|
hosts = recImport {
|
|
|
|
dir = ./.;
|
|
|
|
_import = config;
|
|
|
|
};
|
2020-07-31 04:17:28 +00:00
|
|
|
in
|
|
|
|
hosts
|