mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-11 18:23:18 +01:00
34 lines
712 B
Nix
34 lines
712 B
Nix
{ lib, ... }:
|
|
let
|
|
inherit (lib) concatLists mapAttrsToList showOption;
|
|
in
|
|
rec {
|
|
flattenMapServicesConfigToList =
|
|
f: loc: config:
|
|
f loc config
|
|
++ concatLists (
|
|
mapAttrsToList (
|
|
k: v:
|
|
flattenMapServicesConfigToList f (
|
|
loc
|
|
++ [
|
|
"services"
|
|
k
|
|
]
|
|
) v
|
|
) config.services
|
|
);
|
|
|
|
getWarnings = flattenMapServicesConfigToList (
|
|
loc: config: map (msg: "in ${showOption loc}: ${msg}") config.warnings
|
|
);
|
|
|
|
getAssertions = flattenMapServicesConfigToList (
|
|
loc: config:
|
|
map (ass: {
|
|
message = "in ${showOption loc}: ${ass.message}";
|
|
assertion = ass.assertion;
|
|
}) config.assertions
|
|
);
|
|
}
|