nixpkgs/nixos/nixos-core.nix

39 lines
935 B
Nix
Raw Normal View History

2021-12-03 12:01:13 +00:00
{ lib }:
let
inherit (lib.nixos) publicModules evalModules core;
in {
publicModules = {
# Attributes that refer to modules that are unique to certain kinds of systems.
# For instance, some systems are bootable, some can rebuild themselves, whereas
# need only very minimal facilities.
# These form the public interface to the module graph.
invokeNixpkgs = ./modules/misc/nixpkgs.nix;
invokeNixpkgsImpure = { modules, ... }: {
imports = [ modules.invokeNixpkgs ];
nixpkgs.system = builtins.currentSystem;
};
2021-12-03 12:21:16 +00:00
etc = ./modules/system/etc/etc.nix;
2021-12-03 12:01:13 +00:00
};
evalModules = {
prefix ? [],
modules ? [],
specialArgs ? {},
}: lib.evalModules {
inherit prefix;
modules = modules;
specialArgs = {
modulesPath = builtins.toString ../modules;
modules = publicModules;
} // specialArgs;
};
core = module: evalModules {
modules = [ module ];
};
}