Conversation
|
Wonderful! I've recently been thinking about doing this exact thing since I see people accidentally using I'll make a proper review on the 12th 🙂 |
Previously if `_file` was specified by a module: trace: warning: The type `types.string' of option `foo' defined in `/nix/store/yxhm2il5yrb92fldgriw0wyqh2kk9qyc-bug.nix' is deprecated. See NixOS/nixpkgs#66346 for better alternative types. With this change: trace: warning: The type `types.string' of option `foo' defined in `/home/infinisil/src/nixpkgs/bug.nix' is deprecated. See NixOS/nixpkgs#66346 for better alternative types.
see: NixOS/nixpkgs#66346 Use `types.str` when merging makes no sense (ie. "Hello" "World" shouln't become "HelloWorld"), `types.separatedString "${sep}"` when merging should be done (prefer `listOf str` though), and `types.lines` for line based configuration.
|
Even now https://nixos.wiki/wiki/Declaration informs that |
Everyone can edit their, including you. I fixed it now. |
types.string is deprecated. Related: NixOS/nixpkgs#66346
- as per NixOS/nixpkgs#66346 - also disabled gnome-keyring to use keepassxc secret agent instead
There is a deprecation warning, so act on it. ``` evaluation warning: The type `types.string` is deprecated. See NixOS/nixpkgs#66346 for better alternative types. ```
Can you explain why Should it be manually merged with |
|
@DaniD3v |
types.string is deprecated Viz. NixOS/nixpkgs#66346
- evaluation warning: In test `sensuclient': The `machine' attribute in NixOS tests (pkgs.nixosTest / make-test-python.nix / testing-python.nix / makeTest) is deprecated. Please set the equivalent `nodes.machine'. - evaluation warning: The type `types.string` is deprecated. See NixOS/nixpkgs#66346 for better alternative types. - evaluation warning: Module argument `nodes.host1.config` is deprecated. Use `nodes.host1` instead.
- evaluation warning: In test `sensuclient': The `machine' attribute in NixOS tests (pkgs.nixosTest / make-test-python.nix / testing-python.nix / makeTest) is deprecated. Please set the equivalent `nodes.machine'. - evaluation warning: The type `types.string` is deprecated. See NixOS/nixpkgs#66346 for better alternative types. - evaluation warning: Module argument `nodes.host1.config` is deprecated. Use `nodes.host1` instead. (cherry picked from commit 9267841)
Motivation for this change
For almost 6 (!) years now,
types.stringhas been marked as deprecated in the comment above its definition. People keep using this type regardless, and it's getting annoying while reviewing PRs to constantly have to remind people to not use it.This PR does following things:
types.stringin nixpkgs and replace them with a more appropriate typetypes.stringemit a warning upon useThe mass replacement was done all manually, because I needed to decide what the replacement type should be. This was either
types.strwhen merging doesn't make sense (e.g.useroptions)types.separatedString " "if its an option representing command line arguments (ideally it should belistOf strfor new modules)types.linesif it's a line-based configuration format (where joining with newlines makes sense)types.strif it's a different configuration format where concatenation doesn't workPing @Profpatsch @rycee @aanderse @danbst
Things done
I have not tested any of the modules. While there's a very low chance of any of these changes breaking anything, I might have made a mistake somewhere. A double-check would therefore be good.