mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 22:57:55 +00:00
20 lines
484 B
Nix
20 lines
484 B
Nix
|
# Custom libraries for home-manager library.
|
||
|
{ lib }:
|
||
|
|
||
|
{
|
||
|
/*
|
||
|
Checks if there is the `osConfig` attribute and get the attribute path from
|
||
|
its system configuration.
|
||
|
*/
|
||
|
getOSConfigPath =
|
||
|
# 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 ? osConfig && lib.attrByPath attrPath default attrs;
|
||
|
}
|