not needed anymore
This commit is contained in:
parent
a871d120f5
commit
ca4a9803b6
48
goodhm.nix
48
goodhm.nix
@ -1,48 +0,0 @@
|
||||
hm:
|
||||
|
||||
{ configuration
|
||||
, pkgs
|
||||
, inputs ? { }
|
||||
}:
|
||||
|
||||
with pkgs.lib;
|
||||
let
|
||||
collectFailed = cfg:
|
||||
map (x: x.message) (filter (x: !x.assertion) cfg.assertions);
|
||||
|
||||
showWarnings = res:
|
||||
let
|
||||
f = w: x: builtins.trace "[1;31mwarning: ${w}[0m" x;
|
||||
in
|
||||
fold f res res.config.warnings;
|
||||
|
||||
extendedLib = import "${hm}/modules/lib/stdlib-extended.nix" pkgs.lib;
|
||||
|
||||
hmModules =
|
||||
import "${hm}/modules/modules.nix" {
|
||||
inherit pkgs;
|
||||
check = true;
|
||||
useNixpkgsModule = false;
|
||||
lib = extendedLib;
|
||||
};
|
||||
|
||||
rawModule = extendedLib.evalModules {
|
||||
modules = [ configuration ] ++ hmModules;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
modulesPath = "${hm}/modules";
|
||||
};
|
||||
};
|
||||
|
||||
module = showWarnings (
|
||||
let
|
||||
failed = collectFailed rawModule.config;
|
||||
failedStr = concatStringsSep "\n" (map (x: "- ${x}") failed);
|
||||
in
|
||||
if failed == [ ]
|
||||
then rawModule
|
||||
else throw "\nFailed assertions:\n${failedStr}"
|
||||
);
|
||||
|
||||
in
|
||||
module.config.home.activationPackage
|
Loading…
Reference in New Issue
Block a user