finished mc config

This commit is contained in:
Chris Kruining 2024-09-10 23:59:12 +02:00
parent bbf6d19757
commit 2505f0ea2e
6 changed files with 228 additions and 69 deletions

View file

@ -5,9 +5,9 @@ let
inherit (lib.modules) mkIf mkMerge;
inherit (lib.strings) concatStrings;
cfg = config.modules.desktop.browsers.firefox;
cfg = config.modules.desktop.browsers.zen;
in {
options.modules.desktop.browsers.firefox = let
options.modules.desktop.browsers.zen = let
inherit (lib.options) mkEnableOption;
inherit (lib.types) attrsOf oneOf bool int lines str;
inherit (lib.my) mkOpt mkOpt';
@ -37,62 +37,56 @@ in {
inherit (inputs.zen.packages.${pkgs.system}.specific) zen;
in [
zen
(makeDesktopItem {
name = "zen";
desktopName = "Zen";
genericName = "Launch a Zen instance";
icon = "zen";
exec = "${lib.getExe zen-bin}";
categories = ["Network" "WebBrowser"];
})
# (makeDesktopItem {
# name = "zen";
# desktopName = "Zen";
# genericName = "Launch a Zen instance";
# icon = "zen";
# exec = "${lib.getExe zen-bin}";
# categories = ["Network" "WebBrowser"];
# })
];
# Use a stable profile name so we can target it in themes
home.file = let
cfgPath = ".mozilla/firefox";
in {
firefox-profiles = {
target = "${cfgPath}/profiles.ini";
text = ''
[Profile0]
Name=default
IsRelative=1
Path=${cfg.profileName}.default
Default=1
[General]
StartWithLastProfile=1
Version=2
'';
};
user-js = mkIf (cfg.settings != {} || cfg.extraConfig != "") {
target = "${cfgPath}/${cfg.profileName}.default/user.js";
text = ''
${concatStrings (mapAttrsToList (name: value: ''
user_pref("${name}", ${toJSON value});
'')
cfg.settings)}
${cfg.extraConfig}
'';
};
user-chrome = mkIf (cfg.userChrome != "") {
target = "${cfgPath}/${cfg.profileName}.default/chrome/userChrome.css";
text = cfg.userChrome;
};
user-content = mkIf (cfg.userContent != "") {
target = "${cfgPath}/${cfg.profileName}.default/chrome/userContent.css";
text = cfg.userContent;
};
};
})
(mkIf cfg.privacy.enable {
user.packages = attrValues {
inherit (pkgs) librewolf;
};
# home.file = let
# cfgPath = ".mozilla/firefox";
# in {
# firefox-profiles = {
# target = "${cfgPath}/profiles.ini";
# text = ''
# [Profile0]
# Name=default
# IsRelative=1
# Path=${cfg.profileName}.default
# Default=1
#
# [General]
# StartWithLastProfile=1
# Version=2
# '';
# };
#
# user-js = mkIf (cfg.settings != {} || cfg.extraConfig != "") {
# target = "${cfgPath}/${cfg.profileName}.default/user.js";
# text = ''
# ${concatStrings (mapAttrsToList (name: value: ''
# user_pref("${name}", ${toJSON value});
# '')
# cfg.settings)}
# ${cfg.extraConfig}
# '';
# };
#
# user-chrome = mkIf (cfg.userChrome != "") {
# target = "${cfgPath}/${cfg.profileName}.default/chrome/userChrome.css";
# text = cfg.userChrome;
# };
#
# user-content = mkIf (cfg.userContent != "") {
# target = "${cfgPath}/${cfg.profileName}.default/chrome/userContent.css";
# text = cfg.userContent;
# };
# };
})
];
}