So first everything worked great. I got Firefox installed, with the right extensions and the right settings. Awesome.
Then I wanted to do one more small thing: I wanted to correctly set my userChrome.css and userContent.css files. Then my trouble started. Apparently this can only be done through importing the firefox.nix through the home-manager file home.nix
Now I changed my firefox.nix around and imported it in my home.nix and now the rebuild crashes and I absolutely don’t get why.
This is the import in my home.nix:
imports = [
./firefox.nix
];
The error I’m getting is:
Sep 20 14:08:11 nixos hm-activate-user[2065]: - Move or remove the files below and try again.
Sep 20 14:08:11 nixos hm-activate-user[2065]: - In standalone mode, use 'home-manager switch -b backup' to back up
Sep 20 14:08:11 nixos hm-activate-user[2065]: files automatically.
Sep 20 14:08:11 nixos hm-activate-user[2065]: - When used as a NixOS or nix-darwin module, set
Sep 20 14:08:11 nixos hm-activate-user[2065]: 'home-manager.backupFileExtension'
Sep 20 14:08:11 nixos hm-activate-user[2065]: to, for example, 'backup' and rebuild.
Sep 20 14:08:11 nixos hm-activate-user[2065]: Existing file '/home/user/.mozilla/firefox/profiles.ini' would be clobbered
Sep 20 14:08:11 nixos systemd[1]: home-manager-user.service: Main process exited, code=exited, status=1/FAILURE
Sep 20 14:08:11 nixos systemd[1]: home-manager-user.service: Failed with result 'exit-code'.
Sep 20 14:08:11 nixos systemd[1]: Failed to start Home Manager environment for user.
This is my firefox.nix:
{ config, pkgs, ... }:
let
lock-false = {
Value = false;
Status = "locked";
};
lock-true = {
Value = true;
Status = "locked";
};
in
{
programs = {
firefox = {
enable = true;
languagePacks = [ "en-US" ];
profiles = {
default = {
id = 0;
name = "regen";
isDefault = true;
userChrome = (builtins.readFile ./das_Dotfile/profiles/firefox/userChrome.css);
userContent = (builtins.readFile ./das_Dotfile/profiles/firefox/userContent.css);
};
};
/* ---- POLICIES ---- */
# Check about:policies#documentation for options.
policies = {
DisableTelemetry = true;
DisableFirefoxStudies = true;
DisablePocket = true;
DisplayBookmarksToolbar = "always"; # alternatives: "never" or "newtab"
/* ---- EXTENSIONS ---- */
# Check about:support for extension/add-on ID strings.
# Valid strings for installation_mode are "allowed", "blocked",
# "force_installed" and "normal_installed".
ExtensionSettings = {
"*".installation_mode = "allowed"; # blocks all addons except the ones specified below
# uBlock Origin
"uBlock0@raymondhill.net" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
};
# Firefox Relay
"private-relay@firefox.com" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/private-relay/latest.xpi";
installation_mode = "force_installed";
};
# Bitwarden
"{446900e4-71c2-419f-a6a7-df9c091e268b}" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi";
installation_mode = "force_installed";
};
# I don't care about cookies
"jid1-KKzOGWgsW3Ao4Q@jetpack" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/i-dont-care-about-cookies/latest.xpi";
installation_mode = "force_installed";
};
# Sidebery
"{3c078156-979c-498b-8990-85f7987dd929}" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/sidebery/latest.xpi";
installation_mode = "force_installed";
};
};
/* ---- PREFERENCES ---- */
# Check about:config for options.
Preferences = {
# Convenience
"extensions.pocket.enabled" = lock-false;
"browser.formfill.enable" = lock-false;
"browser.search.suggest.enabled" = lock-false;
"browser.search.suggest.enabled.private" = lock-false;
"browser.urlbar.suggest.searches" = lock-false;
"browser.urlbar.showSearchSuggestionsFirst" = lock-false;
"signon.rememberSignons" = lock-false; # Stop asking to save passwords
"extensions.formautofill.addresses.capture.enabled" = lock-false; # Stop asking to save addresses
# Styling
"browser.compactmode.show" = lock-true;
"toolkit.legacyUserProfileCustomizations.stylesheets" = lock-true; # This is needed for other userX.css files
# Containers
"privacy.userContext.enabled" = lock-true;
"privacy.userContext.ui.enabled" = lock-true;
# Downloads
"browser.download.useDownloadDir" = lock-false;
"browser.download.always_ask_before_handling_new_types" = lock-true;
# Privacy
"privacy.sanitize.sanitizeOnShutdown" = lock-true;
"privacy.clearOnShutdown_v2.cache" = lock-true;
"privacy.clearOnShutdown_v2.historyFormDataAndDownloads" = lock-true;
"privacy.clearOnShutdown_v2.browsingHistoryAndDownloads" = lock-true;
"privacy.clearOnShutdown_v2.downloads" = lock-true;
"privacy.clearOnShutdown_v2.formdata" = lock-true;
"privacy.clearOnShutdown_v2.cookiesAndStorage" = lock-true;
# HTTPS only
"dom.security.https_only_mode" = lock-true;
};
};
};
};
}
I’d really appreciate any tips.