build failure: `cannot coerce an integer to a string`
tried to update my flake from ba73719e673e7c2d89ac2f8df0bc0d48983e4907 to 62382bccfce7ddd67d7419fb90cc5b3cd437b17f
i believe this is an oversight from #812? not sure
relevant log output:
```
… while evaluating a path segment
at /nix/store/366ad1aagjvy6aa82lcgl9s9xmmbi9gp-source/pkgs/buildCatppuccinPort/package.nix:22:85:
21| version =
22| args.version or ("0" + lib.optionalString (lastModified != null) "-unstable-${lastModified}");
| ^
23|
error: cannot coerce an integer to a string: 1769270365
```
it failed on my invocation of a custom grub port, defined [here](https://github.com/w-lfchen/nixos-configs/blob/447b571a9eabede5afdfcc3d942dc07c55f92bb8/modules/nixos/boot.nix#L24).
i'm not sure whether this is supported or the correct way to override sources, and all i remember from writing that code is that it took me a bit to find a working solution.
fix should be straightforward, simply adding a `builtins.toString` should be enough if i'm not mistaken? i'll open a pr later if i find the time
```
nix repl
Lix 2.96.0-dev-pre20260408-dev_bc9fb56
Type :? for help.
nix-repl> "${5}"
error:
… while evaluating a path segment
at «string»:1:3:
1| "${5}"
| ^
error: cannot coerce an integer to a string: 5
nix-repl> "${builtins.toString 5}"
"5"
```
lix version:
```
nix --version
nix (Lix, like Nix) 2.96.0-dev-pre20260408-dev_bc9fb56
System type: x86_64-linux
```
关闭于 2026-05-01 9 条评论