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