dwarfmaster / arkenfox-nixos

Utilities to use arkenfox/user.js in NixOS
MIT License
67 stars 11 forks source link

Evaluation error: `error: attribute 'meta' already defined` #20

Closed azahi closed 1 year ago

azahi commented 1 year ago

Latest commit introduced an error for me:

[azahi@eonwe:~/src/nixfiles]$ nixos-rebuild build --flake .
building the system configuration...
error: attribute 'meta' already defined at /nix/store/6374accpf21d1l5w5f2dbg51vbb5q4x9-user.js:2468:7

       at /nix/store/6374accpf21d1l5w5f2dbg51vbb5q4x9-user.js:2451:7:

         2450|       ];
         2451|       meta = {
             |       ^
         2452|         title = "disable Form Autofill";
(use '--show-trace' to show detailed location information)

Full trace is here, if required. My config is here, just in case.

dwarfmaster commented 1 year ago

I can reproduce the error with nix build ".#arkenfox-v109_0-doc-static. It is caused by the presence of this snippet in arkenfox's user.js:

/* 5017: disable Form Autofill
 * If .supportedCountries includes your region (browser.search.region) and .supported
 * is "detect" (default), then the UI will show. Stored data is not secure, uses JSON
 * [NOTE] Heuristics controls Form Autofill on forms without @autocomplete attributes
 * [SETTING] Privacy & Security>Forms and Autofill>Autofill addresses
 * [1] https://wiki.mozilla.org/Firefox/Features/Form_Autofill ***/
   // user_pref("extensions.formautofill.addresses.enabled", false); // [FF55+]
   // user_pref("extensions.formautofill.creditCards.enabled", false); // [FF56+]
   // user_pref("extensions.formautofill.heuristics.enabled", false); // [FF55+]
/* 5017: limit events that can cause a pop-up ***/

The fact that there is /* 5017 twice trips up my parser and results in the nix file generated being incorrect.

dwarfmaster commented 1 year ago

Should be fixed by 8df5aaf7162aa7306814e43fa10db7b31aa0b18d. Now the extractor keeps tracks of the sections number it has seen and in case of duplicates add -1, -2... as suffix to the numbers. I'll let you confirm it works for you and close the issue afterwards.

azahi commented 1 year ago

Yep, this works now. Cheers.