Make firefox module compatible with nixos hosts
This commit is contained in:
parent
3e40d04572
commit
c85ea77b73
2 changed files with 175 additions and 150 deletions
|
|
@ -22,6 +22,12 @@
|
|||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Firefox configuration
|
||||
programs.firefox-custom = {
|
||||
enable = true;
|
||||
package = null; # Use system Firefox on Darwin
|
||||
};
|
||||
|
||||
home.username = "yanlin";
|
||||
home.homeDirectory = "/Users/yanlin";
|
||||
home.stateVersion = "24.05";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,24 @@
|
|||
{ config, pkgs, lib, ... }@args:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.firefox-custom;
|
||||
in
|
||||
|
||||
{
|
||||
options.programs.firefox-custom = {
|
||||
enable = mkEnableOption "Firefox browser configuration";
|
||||
|
||||
package = mkOption {
|
||||
type = types.nullOr types.package;
|
||||
default = null;
|
||||
example = "pkgs.firefox";
|
||||
description = "Firefox package to use. Set to null on Darwin to use system Firefox, or pkgs.firefox on NixOS.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Create userChrome.css to hide Firefox View button
|
||||
home.file."${config.home.homeDirectory}/.mozilla/firefox/yanlin/chrome/userChrome.css".text = ''
|
||||
/* Hide Firefox View button */
|
||||
|
|
@ -17,7 +35,7 @@
|
|||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
package = null;
|
||||
package = cfg.package;
|
||||
|
||||
profiles.yanlin = {
|
||||
id = 0;
|
||||
|
|
@ -159,4 +177,5 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue