The NixOS module has multiple issues
- 主要语言
- Python
- 星标
- 46.7k
- 派生
- 1.9k
- 平均合并
- 9 天 2 小时
- 30 天内合并 PR
- 4
描述
### Describe the bug
As seen [here](https://github.com/9001/copyparty/blob/hovudstraum/contrib/nixos/modules/copyparty.nix#L121C7-L125C9), some settings are set by default, and notably a pretty important one, `hist`, that sets the cache dir location.
When the user change the settings, the values get overriden, thus breaks thumbnail generation because it then tries to write thumbnails into a .hist folder at the root of the volume, which copyparty needs write access to do so (not the case by default).
Additionally, the module sets some values, such as externalCacheDir or externalStateDir. Not only the user can't override these values, this also means that a user changing the location of `services.copyparty.settings.hist` wouldn't automatically add it to the `BindPaths` of the systemd service, so copyparty wouldn't have access to the folder.
There are probably more issues, this is what I quickly found after trying to find out why my thumbnails wouldn't generate.
### To Reproduce
Set `services.copyparty.settings` to anything, thumbnail generation breaks.
Set `services.copyparty.settings.hist` to anything other than `/var/cache/copyparty`, the systemd service doesn't bind mount that path.
### Expected behavior
The default values of these options should remain (but should be overridable), even if the user sets `services.copyparty.settings`, and the user should be able to change the cache and state directories, which are then reflected into the `config` block of the module.
贡献指南
调研方向
查看 contrib/nixos/modules/copyparty.nix 中的 NixOS 模块,尤其是第 121-125 行。理解该模块如何将用户设置与 defaults 合并,以及 systemd 服务的 BindPaths 是如何生成的。通过修改该模块进行测试,使其在用户覆盖设置时保留 defaults,并确保 hist 目录被正确 bind-mounted。验证更改后 thumbnail 生成可以工作。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- nixos
- 领域
- devops, infrastructure
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 描述清楚
- 新手友好度
- 55/100