mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
lib/home-manager: add hasOSModuleEnabled
This commit is contained in:
parent
ab6cab736d
commit
cf5ad9ce3c
@ -1,7 +1,7 @@
|
|||||||
# Custom libraries for home-manager library.
|
# Custom libraries for home-manager library.
|
||||||
{ lib }:
|
{ lib }:
|
||||||
|
|
||||||
{
|
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.
|
||||||
@ -16,4 +16,15 @@
|
|||||||
# The default value when `attrPath` is missing.
|
# The default value when `attrPath` is missing.
|
||||||
default:
|
default:
|
||||||
attrs ? osConfig && lib.attrByPath attrPath default attrs;
|
attrs ? osConfig && lib.attrByPath attrPath default attrs;
|
||||||
|
|
||||||
|
/*
|
||||||
|
A quick function to check if the optional system module is enabled.
|
||||||
|
*/
|
||||||
|
hasOSModuleEnabled =
|
||||||
|
# The configuration attribute set of the home-manager configuration.
|
||||||
|
attrs:
|
||||||
|
|
||||||
|
# A list of strings representing the attribute path.
|
||||||
|
attrPath:
|
||||||
|
getOSConfigPath attrs attrPath false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user