lib/home-manager: init

This commit is contained in:
Gabriel Arazas 2023-12-19 17:59:55 +08:00
parent 5f70747853
commit 8ec51bff48
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 23 additions and 1 deletions

19
lib/home-manager.nix Normal file
View File

@ -0,0 +1,19 @@
# 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;
}

View File

@ -43,7 +43,10 @@ in
mkImage = { pkgs ? null, extraModules ? [ ], format ? "iso" }: mkImage = { pkgs ? null, extraModules ? [ ], format ? "iso" }:
inputs.nixos-generators.nixosGenerate { inputs.nixos-generators.nixosGenerate {
inherit pkgs format; inherit pkgs format;
lib = pkgs.lib.extend extendLib; lib = pkgs.lib.extend (self: super:
import ./. { lib = super; }
// import ./private.nix { lib = self; }
// import ./home-manager.nix { lib = self; });
modules = extraModules; modules = extraModules;
}; };