lib/home-manager: update function names

This commit is contained in:
Gabriel Arazas 2024-02-14 21:15:15 +08:00
parent 92e92997bd
commit 3822562638
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -6,7 +6,7 @@ rec {
Checks if there is the `osConfig` attribute and get the attribute path from Checks if there is the `osConfig` attribute and get the attribute path from
its system configuration. its system configuration.
*/ */
getOSConfigPath = hasNixOSConfigAttr =
# The configuration attribute set of the home-manager configuration. # The configuration attribute set of the home-manager configuration.
attrs: attrs:
@ -15,10 +15,21 @@ rec {
# The default value when `attrPath` is missing. # The default value when `attrPath` is missing.
default: default:
attrs ? osConfig && lib.attrByPath attrPath default attrs; attrs ? nixosConfig && lib.attrByPath attrPath default attrs;
hasDarwinConfigAttr =
# The configuration attribute set of the home-manager configuration.
attrs:
# A list of strings representing the attribute path.
attrPath:
# The default value when `attrPath` is missing.
default:
attrs ? darwinConfig && lib.attrByPath attrPath default attrs;
/* /*
A quick function to check if the optional system module is enabled. A quick function to check if the optional NixOS system module is enabled.
*/ */
hasOSModuleEnabled = hasOSModuleEnabled =
# The configuration attribute set of the home-manager configuration. # The configuration attribute set of the home-manager configuration.
@ -26,5 +37,5 @@ rec {
# A list of strings representing the attribute path. # A list of strings representing the attribute path.
attrPath: attrPath:
getOSConfigPath attrs attrPath false; hasNixOSConfigAttr attrs attrPath false;
} }