modules: introduce more arguments at top-level

This commit is contained in:
Tobias Happ 2021-12-12 00:18:41 +01:00
parent 7bae16e16d
commit 403336d4c4

View file

@ -1,6 +1,12 @@
# Copyright (c) 2019-2020, see AUTHORS. Licensed under MIT License, see LICENSE. # Copyright (c) 2019-2020, see AUTHORS. Licensed under MIT License, see LICENSE.
{ pkgs ? import <nixpkgs> { }, home-manager-path ? <home-manager>, config ? null, isFlake ? false }: { config ? null
, extraModules ? [ ]
, extraSpecialArgs ? { }
, pkgs ? import <nixpkgs> { }
, home-manager-path ? <home-manager>
, isFlake ? false
}:
with pkgs.lib; with pkgs.lib;
@ -16,12 +22,17 @@ let
rawModule = evalModules { rawModule = evalModules {
modules = [ modules = [
{ {
_module.args.home-manager-path = home-manager-path; _module.args =
_module.args.pkgs = mkDefault pkgs; {
_module.args.isFlake = isFlake; inherit home-manager-path isFlake;
pkgs = mkDefault pkgs;
}
// extraSpecialArgs;
} }
configModule configModule
] ++ import ./module-list.nix { inherit pkgs isFlake; }; ]
++ extraModules
++ import ./module-list.nix { inherit pkgs isFlake; };
}; };
failedAssertions = map (x: x.message) (filter (x: !x.assertion) rawModule.config.assertions); failedAssertions = map (x: x.message) (filter (x: !x.assertion) rawModule.config.assertions);