抽象mkOutOfStoreSymlink,为以后更新为引用相对路径做准备
This commit is contained in:
18
libs/home-libs.nix
Normal file
18
libs/home-libs.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ 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}";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user