Skip to content

Commit

Permalink
feat: Add Firefox theme
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Jun 11, 2024
1 parent e8ff72d commit 56ad83d
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 3 deletions.
23 changes: 20 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
repo = "Tokyonight-rofi-theme";
flake = false;
};
tokyonight-firefox = {
type = "github";
owner = "D4rkKaizen";
repo = "FirefoxCSS-TokyoNight";
flake = false;
};
};

outputs = inputs@{ self, ... }: {
Expand Down
63 changes: 63 additions & 0 deletions modules/home-manager/firefox.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{ inputs, config, lib, ... }:
let cfg = config.programs.firefox.tokyonight;
in {
options.programs.firefox.tokyonight =
(lib.tn.mkTokyonightOpt "tokyonight firefox") // {
profileName = lib.mkOption {
type = lib.types.str;
description = "The name of your Firefox profile to apply the theme to";
example = "default";
};
extraUserChromeCSS = lib.mkOption {
type = lib.types.lines;
default = "";
example = ''
* {
font-family: 'Some other font';
}
'';
};
extraUserContentCSS = lib.mkOption {
type = lib.types.lines;
description = "Extra CSS to add to userContent.css";
default = "";
example = ''
@-moz-document url("about:home"),
url("about:blank"),
url("about:newtab") {
// remove background
body::before {
background: none!important;
}
}
'';
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
home.file.".mozilla/firefox/default/chrome/firefox-tokyonight-theme" = {
# don't include
source = "${inputs.tokyonight-firefox}/firefox-css/chrome";
recursive = true;
};
programs.firefox.profiles.${cfg.profileName} = {
settings = {
"toolkit.legacyUserProfileCustomizations.stylesheets" =
true; # Enable customChrome.cs
"svg.context-properties.content.enabled" =
true; # Enable SVG context-propertes
};
userChrome = ''
@import "firefox-tokyonight-theme/userChrome.css";
${cfg.extraUserChromeCSS}
'';
userContent = ''
@import "firefox-tokyonight-theme/userContent.css";
${cfg.extraUserContentCSS}
'';
};
})
];
}

0 comments on commit 56ad83d

Please sign in to comment.