add firefox declaratively

This commit is contained in:
2025-12-04 14:19:27 +01:00
parent 2853c33455
commit d9d6647b2d
4 changed files with 98 additions and 1 deletions

View File

@@ -118,7 +118,7 @@ in
# DVORAK + NO
xkb.layout = "us,no";
xkb.variant = "dvp,";
xkb.options = "compose:menu, grp:alt_shift_toggle, lv3:ralt_switch";
xkb.options = "compose:alt,grp:alt_shift_toggle,lv3:menu";
exportConfiguration = true;

23
flake.lock generated
View File

@@ -1,5 +1,27 @@
{
"nodes": {
"firefox-addons": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1765080359,
"narHash": "sha256-BvAgmqgswcokD2eWoyO3uB1k1VTdpxDHGSx0RYRFjDg=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "35f8ab2ecd954b3a348aa0e253878211c48a0aa7",
"type": "gitlab"
},
"original": {
"dir": "pkgs/firefox-addons",
"owner": "rycee",
"repo": "nur-expressions",
"type": "gitlab"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
@@ -151,6 +173,7 @@
},
"root": {
"inputs": {
"firefox-addons": "firefox-addons",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nixvim": "nixvim",

View File

@@ -36,6 +36,11 @@
# url = "git+file:///home/fredrikr/Programming/uiua/qotd";
# inputs.nixpkgs.follows = "nixpkgs";
# };
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =

View File

@@ -135,6 +135,7 @@ in
home.sessionVariables = {
EDITOR = "nvim";
MOZ_USE_XINPUT2 = "1";
};
programs.home-manager.enable = true;
@@ -1207,4 +1208,72 @@ in
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36";
};
};
programs.firefox = {
enable = true;
profiles.default = {
id = 0;
name = "default";
isDefault = true;
settings = {
# Memory optimization
"dom.ipc.processCount" = 1;
"dom.ipc.processCount.webIsolated" = 1;
"fission.autostart" = false;
"browser.cache.memory.capacity" = 2097152;
# Hardware acceleration
"gfx.webrender.all" = true;
"media.hardware-video-decoding.force-enabled" = true;
"layers.acceleration.force-enabled" = true;
# UI customization
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"browser.compactmode.show" = true;
# Clean interface
"browser.startup.homepage" = "about:blank";
"browser.newtabpage.enabled" = false;
"browser.newtabpage.activity-stream.feeds.section.highlights" = false;
# Privacy
"privacy.resistFingerprinting" = true;
"dom.security.https_only_mode" = true;
};
# Minimal userChrome.css
userChrome = ''
/* Hide tab bar when single tab */
#tabbrowser-tabs {
visibility: collapse !important;
}
#tabbrowser-tabs[overflow="true"],
#tabbrowser-tabs:not([overflow]) {
visibility: visible !important;
}
/* Auto-hide address bar */
#nav-bar {
margin-top: -40px !important;
transition: margin-top 0.2s ease !important;
}
#navigator-toolbox:hover #nav-bar,
#nav-bar:focus-within {
margin-top: 0px !important;
}
/* Clean minimal look */
#identity-box,
#tracking-protection-icon-container,
#urlbar-zoom-button,
#star-button-box { display: none !important; }
'';
extensions = with inputs.firefox-addons.packages.${pkgs.system}; [
ublock-origin
];
};
};
}