I work with vscodium instead of vscode, and I’ve been installing it from Flatpak for years.
But recently, I needed to tweak its product.json (file inside the vscodium folder) to install some custom extensions…
I can (could) edit directly /var/lib/flatpak/app/com.vscodium.codium/x86_64/stable/33dbe633c25dd1ece5f188ac991090f5845cbd1fcfa8cb61ef3f068ecf1e7b96/files/share/codium/resources/app/product.json but the modification would be removed on the next flatpak upgrade.
That is why I’m wondering if I could get it done with nixos configuration.nix.
First I would start by adding vscodium to my configuration …
I’m not familiar enough with NixOS to automatically modify the product.json from the installed package. For example, I would like to automatically sed on /nix/store/<vscode-subfolder>/lib/vscode/resources/app/product.json so that the modification would persist over nixos vscode upgrades…
First, is this possible?
And someone could help me on this or point some documentation on how to do it?
And for reference, if you’re confused about anything written above, or want to understand better how to work with nixpkgs, see Nixpkgs Reference Manual
PS I’ve not tested the above, so if there’s issues, please post what you tried and specific errors.
Good catch, I would even use --replace-fail so that I know when the string has changed (--replace is deprecated and --replace-warn/--replace-quiet wouldn’t be loud enough to flag issues in the product.json for my use cases)
I don’t recall if the -fail variant is only present on unstable or not, so it might take a couple months to make its way to stable if so