{"id":22898886,"url":"https://github.com/dwarfmaster/arkenfox-nixos","last_synced_at":"2025-04-06T20:09:33.667Z","repository":{"id":50313992,"uuid":"468730445","full_name":"dwarfmaster/arkenfox-nixos","owner":"dwarfmaster","description":"Utilities to use arkenfox/user.js in NixOS","archived":false,"fork":false,"pushed_at":"2025-03-23T01:44:49.000Z","size":578,"stargazers_count":79,"open_issues_count":5,"forks_count":16,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-30T19:11:22.572Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dwarfmaster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-11T11:49:26.000Z","updated_at":"2025-03-22T16:35:57.000Z","dependencies_parsed_at":"2023-09-25T10:57:26.314Z","dependency_job_id":"f9cbb94a-77e9-43cf-8c6f-256b38db7473","html_url":"https://github.com/dwarfmaster/arkenfox-nixos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwarfmaster%2Farkenfox-nixos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwarfmaster%2Farkenfox-nixos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwarfmaster%2Farkenfox-nixos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwarfmaster%2Farkenfox-nixos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwarfmaster","download_url":"https://codeload.github.com/dwarfmaster/arkenfox-nixos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543589,"owners_count":20955865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T00:35:17.020Z","updated_at":"2025-04-06T20:09:33.645Z","avatar_url":"https://github.com/dwarfmaster.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Arkenfox user.js module for NixOS + home-manager\n\n## Motivation\n\nFirefox's `user.js` can be used to store preferences and settings for Firefox,\nbut it is painful to manually edit. There is a popular `user.js` optimised for\nease of edition and hardening :\n[Arkenfox's](https://github.com/arkenfox/user.js).\n\nIf one want to directly use it, there already is an option in home-manager to\nuse a `user.js` : `programs.firefox.profiles.\u003cname\u003e.extraConfig` and\n`programs.firefox.profiles.\u003cname\u003e.settings`.\n\nThe problem with directly using Arkenfox's `user.js` is that handling updates to\nfile after having gone through it to edit your preferences is a bit of a pain.\nIn order to improve the situation, we implemented a script that parses\nArkenfox's `user.js` and generate a home-manager module that allows setting the\npreferences using the merge algorithm of the NixOS module system. Furthermore,\nit keeps the edits outside the generated module. Any drift between the\nsettings and the `user.js` will be caught by the module type-system.\n\n## Outputs\n\nThis flake exports a few things :\n- the script used for the extraction as `packages.\u003csystem\u003e.arkenfox-extractor`.\n- the home-manager module as `hmModules.arkenfox`.\n- a rendered documentation of each supported `user.js` version as\n  `packages.\u003csystem\u003e.arkenfox-v\u003cversion\u003e-doc-static`. Here version can be either\n  a numeric one like `103_0` or `master`.\n\n## Home-manager module\n\nTo enable the module, you need to set both `programs.firefox.arkenfox.enable` to\ntrue and `programs.firefox.arkenfox.version` to the version you want to use.\nIdeally the version used is the same as Firefox's, but may differ if arkenfox\nhasn't yet been updated, or you want to keep your previous settings with the new\nFirefox version. In the case the versions do not match, a warning will be\ndisplayed when generating the configuration.\n\nThen the settings can be set profile-by-profile using\n`programs.firefox.profiles.\u003cname\u003e.arkenfox`. The `user.js` file is subdivided\ninto sections, subsections and individual settings that all have a default\nvalue, and may be commented or not. All this is present in the module. A setting\ncan be set with `\u003csection-number\u003e.\u003csubsection-number\u003e.\u003csetting-name\u003e.value` and\nenabled with `\u003csection-number\u003e.\u003csubsection-number\u003e.\u003csetting-name\u003e.enable`.\nSections and subsections can also be enabled and disabled. A setting value is\nonly set if both its sections and subsection are enabled. Furthermore, a top\nlevel `enable` flag is present.\n\nSince Arkenfox's settings are *very* opinionated and shouldn't be used unless\nthey've been reviewed and agreed with, both the top level `enable` flag and all\nsections `enable` flags are false by default. On the other hand, the\nsubsections `enable` flags are true by default. There is a `enableAllSections`\ntop level flag that makes all sections enabled by default if this is what you\nwant.\n\nFor example, if you want to enable the `TOPLEVEL`, `STARTUP` and `GEOLOCATION`\nsections, but still have Firefox check if it is the default browser, and you\nwant to enable the search region setting that is commented in the default\n`user.js` but keep its value, you would do:\n\n```nix\n{\n  programs.firefox = {\n    enable = true;\n    arkenfox = {\n      enable = true;\n      version = \"103.0\";\n    };\n    \n    profiles.Default.arkenfox = {\n      enable = true;\n      \"0000\".enable = true;\n      \"0001\" = {\n        enable = true;\n        \"0101\".\"browser.shell.checkDefaultBrowser\".value = true;\n      };\n      \"0002\" = {\n        enable = true;\n        \"0204\".\"browser.search.region\".enable = true;\n      };\n    };\n  };\n}\n```\n\n## Documentation\n\nFinding the section and subsection numbers and the option names can be a bit\ncomplicated. The authoritative source of truth is of course the `user.js` file\non Arkenfox's GitHub, which you should read, at least the section you enable.\nFor better usability, the metadata extracted is also used to generate a HTML\nfile that may be more agreeable looking through.\n\nTargets `programs.\u003csystem\u003e.arkenfox-v\u003cversion\u003e-doc-static` will build this\n`html` file. An example of a rendered documentation (WARNING: often outdated)\ncan be found [there](https://arkenfox.dwarfmaster.net). Each setting is\npresented as a table with a checkbox indicating if it is enabled by default, its\nname, and its default value.\n\nYou can build the documentation without copying the flake using (for example):\n```shell\nnix build \"github:dwarfmaster/arkenfox-nixos#arkenfox-v103_0-doc-static\"\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwarfmaster%2Farkenfox-nixos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwarfmaster%2Farkenfox-nixos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwarfmaster%2Farkenfox-nixos/lists"}