19 lines
600 B
Nix
19 lines
600 B
Nix
{ lib, config, sourcepath, ... }: # 声明你可能需要的参数
|
|
{
|
|
options = {
|
|
# 使用一个独特的顶层选项名,如 myLib
|
|
home-libs = lib.mkOption {
|
|
type = lib.types.attrsOf lib.types.anything;
|
|
default = { };
|
|
description = "Home manager custom utility functions.";
|
|
};
|
|
};
|
|
|
|
config.home-libs = {
|
|
# path 参数目前无法通过内置函数的方式获取
|
|
# 需要是相对于 flake 的相对路径,直接由目录开始不需要加 `./`。
|
|
mkOutOfStoreSymlink = path:
|
|
config.home-libs.mkOutOfStoreSymlink "${sourcepath}/${path}";
|
|
};
|
|
}
|