问题描述
通常在构建haskell项目时,我会在使用hpack时碰到存在cabal文件的错误。
niobiumcoconut.cabal was generated with a newer version of hpack,please upgrade and try again.
所以我想,嘿,一种解决方案是将阴谋文件排除在派生之外。我发现了builtins.filterSource
函数。但是我不确定如何从使用nix的文件获取文件扩展名(因此我可以排除*.cabal
个文件。)
解决方法
我认为您正在寻找hasSuffix函数。
,要基于扩展名删除特定文件:
src = lib.cleanSourceWith {
filter = name: type:
!(lib.hasSuffix ".cabal" name) &&
;
src = ./.;
};
此答案由来自functionalprogramming.slack.com的“ Andika Demas Riyandi”提供