-
Notifications
You must be signed in to change notification settings - Fork 38
Add firefox only on non-darwin systems' flake.nix #1019
Conversation
efbdf88
to
7adc59a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the tests still work without Firefox needing to be there? I see geckodriver is still in there. Maybe I put in both without needing to do Firefox at all?
The tests don't work without firefox. I have firefox installed outside of nix (and open at the time of testing) which seems to be the only option for darwin systems short of emulating a linux system |
I found an overlay for firefox on darwin, but I'm not sure how comprehensive you'd like this fix to be or whether you want to trust that outside overlay |
7adc59a
to
c54c737
Compare
Gah, while this builds with nix's geckodriver, it won't run in the tests. It's only running for me with local env geckodriver and firefox. I adjusted the PR to reflect this reality. |
c54c737
to
f7d6f5a
Compare
flake.nix
Outdated
isDarwin = system == "x86_64-darwin" || system == "aarch64-darwin"; | ||
# Add firefox deps only on non-darwin. | ||
# darwin is listed in badPlatforms in pkgs.firefox's meta. | ||
optionalPackages = if isDarwin then [] else [ | ||
pkgs.firefox | ||
pkgs.geckodriver | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've typically seen things done like this before, would it work here?
buildInputs = [
pkgs.bitcoind
clightning-dev
pkgs.openssl
pkgs.zlib
pkgs.postgresql
pkgs.gcc
pkgs.pkg-config
pkgs.poetry
pythonEnv
pkgs.gcc.cc.lib
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.libiconv
];
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works. pushed the change
f7d6f5a
to
c8f255f
Compare
pkgs.firefox's metadata list darwin in badPlatforms. See: https://github.com/NixOS/nixpkgs/blob/d89f18a17e51532ed5f4d45297b0ddf11e46b9c8/pkgs/applications/networking/browsers/firefox/packages.nix#L21 This applies to firefox-119 and may change
c8f255f
to
cd3f007
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
pkgs.firefox's metadata list darwin in badPlatforms.
See: https://github.com/NixOS/nixpkgs/blob/d89f18a17e51532ed5f4d45297b0ddf11e46b9c8/pkgs/applications/networking/browsers/firefox/packages.nix#L21
This applies to firefox-119 and may change
Without this change, using the flake produces the following. I don't think the readme should say darwin has first-class nix support, but this is a nice change to have.