From f82e204bf90bcc92abbffa6c86897ecec571a4ce Mon Sep 17 00:00:00 2001 From: ooks-io Date: Fri, 1 Mar 2024 23:44:16 +1300 Subject: [PATCH] feat(schizofox): initial schizofox config has issues, requires further work --- flake.nix | 5 +- home/modules/desktop/browser/default.nix | 9 +++ .../desktop/browser/schizofox/default.nix | 71 +++++++++++++++++++ home/profile/hyprland/default.nix | 2 +- 4 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 home/modules/desktop/browser/schizofox/default.nix diff --git a/flake.nix b/flake.nix index 923dac7..0de1c63 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,10 @@ url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; }; - + schizofox = { + url = "github:schizofox/schizofox"; + inputs.nixpkgs.follows = "nixpkgs"; + }; hyprwm-contrib = { url = "github:hyprwm/contrib"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/home/modules/desktop/browser/default.nix b/home/modules/desktop/browser/default.nix index 73f79ff..ead3948 100644 --- a/home/modules/desktop/browser/default.nix +++ b/home/modules/desktop/browser/default.nix @@ -3,6 +3,7 @@ imports = [ ./firefox + ./schizofox #./chrome -- still needs to be implemented #./brave -- still needs tio be implemented ]; @@ -16,5 +17,13 @@ description = "Set Firefox as default browser"; }; }; + schizofox = { + enable = lib.mkEnableOption "Enable schizofox browser"; + default = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Set schizofox as default browser"; + }; + }; }; } diff --git a/home/modules/desktop/browser/schizofox/default.nix b/home/modules/desktop/browser/schizofox/default.nix new file mode 100644 index 0000000..4a8bea7 --- /dev/null +++ b/home/modules/desktop/browser/schizofox/default.nix @@ -0,0 +1,71 @@ +{ inputs, config, lib, ... }: + +let + cfg = config.homeModules.desktop.browser.schizofox; + inherit (config.colorscheme) colors; +in + +{ + imports = [inputs.schizofox.homeManagerModule]; + + config = lib.mkIf cfg.enable { + home.sessionVariables.BROWSER = lib.mkIf cfg.default "firefox"; + programs.schizofox = { + enable = true; + theme = { + font = "${config.fontProfiles.regular.family}"; + colors = { + background-darker = "${colors.base00}"; + background = "${colors.base01}"; + foreground = "${colors.base07}"; + }; + }; + + security = { + sanitizeOnShutdown = false; + sandbox = true; + noSessionRestore = false; + userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0"; + }; + + misc = { + drmFix = true; + disableWebgl = false; + }; + + extensions = { + extraExtensions = let + mkUrl = name: "https://addons.mozilla.org/firefox/downloads/latest/${name}/latest.xpi"; + extensions = [ + { + id = "1018e4d6-728f-4b20-ad56-37578a4de76"; + name = "flagfox"; + } + { + id = "{c2c003ee-bd69-42a2-b0e9-6f34222cb046}"; + name = "auto-tab-discard"; + } + { + id = "{d634138d-c276-4fc8-924b-40a0ea21d284}"; + name = "1password-x-password-manager"; + } + { + id = "{a4c4eda4-fb84-4a84-b4a1-f7c1cbf2a1ad}"; + name = "refined-github-"; + } + { + id = "sponsorBlocker@ajay.app"; + name = "sponsorblock"; + } + { + id = "{tridactyl.vim@cmcaine.co.uk}"; + name = "tridactyl-vim"; + } + ]; + extraExtensions = builtins.foldl' (acc: ext: acc // {ext.id = {install_url = mkUrl ext.name;};}) {} extensions; + in + extraExtensions; + }; + }; + }; +} diff --git a/home/profile/hyprland/default.nix b/home/profile/hyprland/default.nix index 95b7194..b5da432 100644 --- a/home/profile/hyprland/default.nix +++ b/home/profile/hyprland/default.nix @@ -20,7 +20,7 @@ in communication = { discord.enable = true; }; - browser.firefox = { + browser.schizofox = { enable = true; default = true; };