Skip to content

progs: firefox: *.userChrome may be path or drv #6761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

spikespaz
Copy link
Member

@spikespaz spikespaz commented Apr 5, 2025

Description

This allows programs.firefox.profiles.*.userChrome to be set to a:
derivation, path/path-like string to directory or file, or multiline
text to be used as content verbatim.

This allows setting, for example(s):

programs.firefox.profiles."jacob.default".userChrome = pkgs.wavefox;
programs.firefox.profiles."jacob.default".userChrome =
    "${pkgs.wavefox}/userChrome.css";

Checklist

  • (Painstakingly) Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all
    or nix build --reference-lock-file flake.lock ./tests#test-all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

@spikespaz spikespaz force-pushed the u/jacob/firefox-profiles-userchrome-source branch 2 times, most recently from e11ac94 to a846d21 Compare April 7, 2025 03:33
spikespaz added a commit to spikespaz/dotfiles that referenced this pull request Apr 9, 2025
@spikespaz spikespaz force-pushed the u/jacob/firefox-profiles-userchrome-source branch from a846d21 to 1eb6ddd Compare April 10, 2025 02:21
@spikespaz spikespaz marked this pull request as draft April 10, 2025 02:39
@spikespaz spikespaz force-pushed the u/jacob/firefox-profiles-userchrome-source branch from 1eb6ddd to 37548f8 Compare April 10, 2025 02:48
@spikespaz spikespaz marked this pull request as ready for review April 10, 2025 02:48
@spikespaz spikespaz force-pushed the u/jacob/firefox-profiles-userchrome-source branch from 37548f8 to 4e03b78 Compare April 10, 2025 02:50
This allows `programs.firefox.profiles.*.userChrome` to be set to a:
derivation, path/path-like string to directory or file, or multiline
text to be used as content verbatim.

This allows setting, for example(s):
```nix
programs.firefox.profiles."jacob.default".userChrome = pkgs.wavefox;
programs.firefox.profiles."jacob.default".userChrome =
    "${pkgs.wavefox}/userChrome.css";
```
@spikespaz spikespaz force-pushed the u/jacob/firefox-profiles-userchrome-source branch from 4e03b78 to 920637d Compare April 16, 2025 15:37
@spikespaz
Copy link
Member Author

Removed accidental VS Code workspace change. Should be good now.

Copy link
Collaborator

@khaneliman khaneliman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this actually allows me to remove some hacky stuff I had to do with my configuration for installing a theme.

@khaneliman khaneliman merged commit 7ede02c into nix-community:master Apr 16, 2025
3 checks passed
khaneliman added a commit to khaneliman/khanelinix that referenced this pull request Apr 16, 2025
Supported in nix-community/home-manager#6761 We
can use the path to also copy the images over to the proper location, as
well.
@antonmosich
Copy link
Contributor

antonmosich commented Apr 16, 2025

This broke my config, in which I set

programs.firefox.profiles.<name>.userChrome = ''
<css>
'';

The error says that the string doesn't represent an absolute path.

It seems to fail while executing lib.pathIsDirectory.

@khaneliman
Copy link
Collaborator

This broke my config, in which I set

programs.firefox.profiles.<name>.userChrome = ''
<css>
'';

The error says that the string doesn't represent an absolute path.

It seems to fail while executing lib.pathIsDirectory.

Oops, thought we had basic tests already.. I'll add some tests and fix it.

@spikespaz
Copy link
Member Author

Setting a string for me worked, pathIsDirectory should return null. It's possible that I misremember and cherry-picked the wrong commit.

@jvanbruegge
Copy link
Contributor

The function seems to get tripped up by a URL, it complains about the first line of this:

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */

#webrtcIndicator {
  display: none !important;
}

@khaneliman
Copy link
Collaborator

I have a fix, just finishing up unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants