diff --git a/flake.lock b/flake.lock index 7a82d26..e1a2e8f 100644 --- a/flake.lock +++ b/flake.lock @@ -280,6 +280,27 @@ "type": "github" } }, + "flake-parts_5": { + "inputs": { + "nixpkgs-lib": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1659877975, @@ -1157,6 +1178,28 @@ "type": "github" } }, + "nur": { + "inputs": { + "flake-parts": "flake-parts_5", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix_4" + }, + "locked": { + "lastModified": 1737225765, + "narHash": "sha256-wyJcROV/d6POpZRlfk79EWsRHZH0iP6aC5uhmM1cH98=", + "owner": "nix-community", + "repo": "NUR", + "rev": "7c2500d3cc3a1d4f51493ba208721ea7c2a4380f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, "nuschtosSearch": { "inputs": { "flake-utils": "flake-utils_9", @@ -1259,6 +1302,7 @@ "nixpkgs-vscodium": "nixpkgs-vscodium", "nixpkgs-wayland": "nixpkgs-wayland", "nixvim": "nixvim", + "nur": "nur", "ofi-pass": "ofi-pass", "openvscode-server": "openvscode-server", "prs": "prs", @@ -1268,7 +1312,7 @@ "rperf": "rperf", "sops-nix": "sops-nix", "srvos": "srvos", - "treefmt-nix": "treefmt-nix_4", + "treefmt-nix": "treefmt-nix_5", "yofi": "yofi" } }, @@ -1519,6 +1563,27 @@ } }, "treefmt-nix_4": { + "inputs": { + "nixpkgs": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733222881, + "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "49717b5af6f80172275d47a418c9719a31a78b53", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_5": { "inputs": { "nixpkgs": [ "nixpkgs" diff --git a/flake.nix b/flake.nix index 02c982c..de419fc 100644 --- a/flake.nix +++ b/flake.nix @@ -106,6 +106,11 @@ url = "github:jmgilman/nixago"; inputs.nixpkgs.follows = "nixpkgs"; }; + + nur = { + url = "github:nix-community/NUR"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = diff --git a/nix/home-manager/profiles/wayland-desktop.nix b/nix/home-manager/profiles/wayland-desktop.nix index 4f8fc22..2f0d2ee 100644 --- a/nix/home-manager/profiles/wayland-desktop.nix +++ b/nix/home-manager/profiles/wayland-desktop.nix @@ -47,14 +47,18 @@ in # TODO: whwat's this for? # wltype - pavucontrol - playerctl - pasystray qt5.qtwayland qt6.qtwayland # libsForQt5.qt5.qtwayland # libsForQt6.qt6.qtwayland + # audio + playerctl + helvum + pasystray + sonusmix + pwvucontrol + # probably required by flameshot # xdg-desktop-portal xdg-desktop-portal-wlr # grim diff --git a/nix/home-manager/programs/firefox.nix b/nix/home-manager/programs/firefox.nix index d07f3aa..170c89c 100644 --- a/nix/home-manager/programs/firefox.nix +++ b/nix/home-manager/programs/firefox.nix @@ -1,4 +1,274 @@ -{ pkgs, ... }: +{ + repoFlake, + pkgs, + config, + lib, + ... +}: +let + # Search extension names with below command: + # nix flake show --json "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons" --all-systems | jq -r '.packages."x86_64-linux" | keys[]' | rg QUERY + ryceeAddons = with repoFlake.inputs.nur.legacyPackages.${pkgs.system}.repos.rycee.firefox-addons; [ + ublock-origin + + # bypass-paywalls-clean (can't use, was creating popups) + consent-o-matic + terms-of-service-didnt-read + + auto-tab-discard + + # redirector # For nixos wiki + darkreader + + facebook-container + control-panel-for-twitter + # containerise + facebook-tracking-removal + vimium + cookie-autodelete + auto-tab-discard + ]; + + customAddons = [ + + ]; + + search = { + force = true; + default = "DuckDuckGo"; + privateDefault = "DuckDuckGo"; + }; + + mkProfile = + override: + lib.recursiveUpdate { + extensions = ryceeAddons ++ customAddons; + inherit search; + + settings = { + # automatically enable extensions + "extensions.autoDisableScopes" = 0; + + "middlemouse.paste" = false; + + "browser.download.useDownloadDir" = false; + "browser.tabs.insertAfterCurrent" = true; + "browser.tabs.warnOnClose" = true; + "browser.toolbars.bookmarks.visibility" = "never"; + "browser.quitShortcut.disabled" = false; + + # restore the previous session automatically + "browser.startup.page" = 3; + "browser.sessionstore.resume_from_crash" = true; + "browser.sessionstore.restore_pinned_tabs_on_demand" = true; + "browser.sessionstore.restore_on_demand" = true; + + "browser.urlbar.suggest.bookmark" = true; + "browser.urlbar.suggest.engines" = true; + "browser.urlbar.suggest.history" = true; + "browser.urlbar.suggest.openpage" = true; + "browser.urlbar.suggest.topsites" = false; + "browser.urlbar.trimHttps" = true; + + "sidebar.position_start" = false; + "findbar.highlightAll" = true; + + "browser.tabs.hoverPreview.enabled" = true; + + # Disable fx accounts + "identity.fxaccounts.enabled" = false; + # Disable "save password" prompt + "signon.rememberSignons" = false; + # Harden + "privacy.trackingprotection.enabled" = true; + "dom.security.https_only_mode" = true; + + # Disable irritating first-run stuff + "browser.disableResetPrompt" = true; + "browser.download.panel.shown" = true; + "browser.feeds.showFirstRunUI" = false; + "browser.messaging-system.whatsNewPanel.enabled" = false; + "browser.rights.3.shown" = true; + "browser.shell.checkDefaultBrowser" = false; + "browser.shell.defaultBrowserCheckCount" = 1; + "browser.startup.homepage_override.mstone" = "ignore"; + "browser.uitour.enabled" = false; + "startup.homepage_override_url" = ""; + "trailhead.firstrun.didSeeAboutWelcome" = true; + "browser.bookmarks.restore_default_bookmarks" = false; + "browser.bookmarks.addedImportButton" = true; + + # Disable "Save to Pocket" or Pocket entirely + "extensions.pocket.enabled" = false; + + # Disable telemetry + "toolkit.telemetry.enabled" = false; + "toolkit.telemetry.unified" = false; + "toolkit.telemetry.archive.enabled" = false; + "datareporting.healthreport.uploadEnabled" = false; + "app.shield.optoutstudies.enabled" = false; + "browser.discovery.enabled" = false; + "browser.newtabpage.activity-stream.feeds.telemetry" = false; + "browser.newtabpage.activity-stream.telemetry" = false; + "browser.ping-centre.telemetry" = false; + "datareporting.healthreport.service.enabled" = false; + "datareporting.policy.dataSubmissionEnabled" = false; + "datareporting.sessions.current.clean" = true; + "devtools.onboarding.telemetry.logged" = false; + "toolkit.telemetry.bhrPing.enabled" = false; + "toolkit.telemetry.firstShutdownPing.enabled" = false; + "toolkit.telemetry.hybridContent.enabled" = false; + "toolkit.telemetry.newProfilePing.enabled" = false; + "toolkit.telemetry.prompted" = 2; + "toolkit.telemetry.rejected" = true; + "toolkit.telemetry.reportingpolicy.firstRun" = false; + "toolkit.telemetry.server" = ""; + "toolkit.telemetry.shutdownPingSender.enabled" = false; + "toolkit.telemetry.unifiedIsOptIn" = false; + "toolkit.telemetry.updatePing.enabled" = false; + + # Disable any feeds on the new tab page + "browser.newtabpage.activity-stream.showTopSites" = false; + "browser.newtabpage.activity-stream.default.sites" = lib.mkForce [ ]; + "browser.newtabpage.activity-stream.discoverystream.enabled" = false; + "browser.newtabpage.activity-stream.feeds.topsites" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts" = false; + "browser.newtabpage.blocked" = lib.genAttrs [ + # Youtube + "26UbzFJ7qT9/4DhodHKA1Q==" + # Facebook + "4gPpjkxgZzXPVtuEoAL9Ig==" + # Wikipedia + "eV8/WsSLxHadrTL1gAxhug==" + # Reddit + "gLv0ja2RYVgxKdp0I5qwvA==" + # Amazon + "K00ILysCaEq8+bEqV/3nuw==" + # Twitter + "T9nJot5PurhJSy8n038xGA==" + ] (_: 1); + "browser.topsites.blockedSponsors" = [ + "adidas" + "temuaffiliateprogram.pxf" + "s.click.aliexpress" + ]; + + # enable userChrome + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + }; + + userChrome = + let + name = override.color or colors.grey; + value = colorValues."${name}".normal; + valueBright = colorValues."${name}".bright; + valueDark = colorValues."${name}".dark; + in + '' + /* TODO: set regular toolbar background color */ + + /* default */ + #TabsToolbar { + background: ${valueDark} !important; + } + + /* default tab */ + #TabsToolbar #tabbrowser-tabs .tabbrowser-tab .tab-content { + background: ${value} !important; + } + + /* selected tab */ + #TabsToolbar #tabbrowser-tabs .tabbrowser-tab[selected] .tab-content { + background: ${valueBright} !important; + } + + /* hovered tab */ + #TabsToolbar #tabbrowser-tabs .tabbrowser-tab:hover:not([selected]) .tab-content { + background: ${valueBright} !important; + } + + /* unloaded/pending tab */ + #TabsToolbar #tabbrowser-tabs .tabbrowser-tab[pending] .tab-content { + background: ${valueDark} !important; + } + ''; + + # /* new tab */ + # #TabsToolbar #tabbrowser-tabs #tabs-newtab-button .toolbarbutton-icon { + # background: unset !important; + # } + + # #TabsToolbar #tabbrowser-tabs #tabs-newtab-button { + # /* background: var(--default_tabs_bg_newtab) !important; + # } + + # /* hovered new tab */ + # #TabsToolbar #tabbrowser-tabs #tabs-newtab-button:hover { + # background: var(--default_tabs_bg_newtab_hovered) !important; + # } + + } (builtins.removeAttrs override [ "color" ]); + + # TODO: insert the id automatically + mkProfiles = attrs: builtins.mapAttrs (_k: v: v) attrs; + + colors = builtins.mapAttrs (name: _: name) colorValues; + + colorValues = { + blue = { + normal = "#37adff"; + bright = "#00acff"; # Brighter blue + dark = "#2c8dd3"; # Darker blue + }; + green = { + normal = "#51cd00"; + bright = "#5ae200"; # Brighter green + dark = "#45ad00"; # Darker green + }; + orange = { + normal = "#ff9800"; + bright = "#ffb74d"; # Brighter orange + dark = "#c76a00"; # Darker orange + }; + red = { + normal = "#f6685e"; + bright = "#ff4336"; # Brighter red + dark = "#aa463f"; # Darker red + }; + yellow = { + normal = "#ffeb3b"; + bright = "#fff350"; # Brighter yellow + dark = "#c6a700"; # Darker yellow + }; + purple = { + normal = "#9c27b0"; + bright = "#ab47bc"; # Brighter purple + dark = "#7b1fa2"; # Darker purple + }; + pink = { + normal = "#e91e63"; + bright = "#ff6090"; # Brighter pink + dark = "#c2185b"; # Darker pink + }; + brown = { + normal = "#795548"; + bright = "#a88b6f"; # Brighter brown + dark = "#4e3b30"; # Darker brown + }; + grey = { + normal = "#9e9e9e"; + bright = "#bdbdbd"; # Brighter grey + dark = "#757575"; # Darker grey + }; + teal = { + normal = "#009688"; + bright = "#26c6da"; # Brighter teal + dark = "#00796b"; # Darker teal + }; + }; + +in { programs.librewolf = { enable = false; @@ -6,7 +276,77 @@ programs.firefox = { enable = true; package = pkgs.firefox-esr-128; + + profiles = mkProfiles { + "personal" = mkProfile { + id = 0; + isDefault = true; + color = colors.blue; + }; + "personal-finance" = mkProfile { + id = 1; + color = colors.green; + }; + "business" = mkProfile { + id = 2; + color = colors.teal; + }; + "dev-admin" = mkProfile { + id = 3; + color = colors.teal; + }; + "dev-holo" = mkProfile { + id = 4; + color = colors.red; + }; + "dev-infra" = mkProfile { + id = 5; + color = colors.yellow; + }; + "justyna" = mkProfile { + id = 6; + color = colors.pink; + }; + "justyna-office" = mkProfile { + id = 7; + color = colors.pink; + }; + }; + }; - # home.file.".mozilla/native-messaging-hosts/passff.json".source = "${pkgs.passff-host}/share/passff-host/passff.json"; + # create one desktop entry for each profile + xdg.desktopEntries = lib.mapAttrs' ( + k: _v: + lib.nameValuePair "firefox-profile-${k}" { + categories = [ + "Network" + "WebBrowser" + ]; + exec = "${lib.getExe config.programs.firefox.package} -P ${k}"; + genericName = "Web Browser"; + icon = + builtins.replaceStrings [ ".desktop" ] [ "" ] + config.programs.firefox.package.desktopItem.name; + mimeType = [ + "text/html" + "text/xml" + "application/xhtml+xml" + "application/vnd.mozilla.xul+xml" + "x-scheme-handler/http" + "x-scheme-handler/https" + ]; + name = "Firefox: ${k}"; + startupNotify = true; + settings.StartupWMClass = + # To group windows of different profiles. + # Set WM_CLASS on Xorg using --class, set app-id on Wayland using --name. + #if profile.name == "default" + #then "firefox" + #else "firefox-${profile.name}"; + "firefox"; + terminal = false; + type = "Application"; + } + ) config.programs.firefox.profiles; } diff --git a/nix/os/devices/steveej-x13s/configuration.nix b/nix/os/devices/steveej-x13s/configuration.nix index 25ed3a8..a4746dc 100644 --- a/nix/os/devices/steveej-x13s/configuration.nix +++ b/nix/os/devices/steveej-x13s/configuration.nix @@ -87,7 +87,6 @@ # TODO: broken with: v4l2loopback-0.13.2-6.13.0-rc3.drv # make: *** [Makefile:53: v4l2loopback.ko] Error 2 # ../../snippets/obs-studio.nix - { services.openssh.enable = true; services.openssh.settings.PermitRootLogin = "yes"; @@ -227,9 +226,9 @@ loader.efi.efiSysMountPoint = "/boot"; blacklistedKernelModules = [ "wwan" - "qcom_soundwire" - "snd_soc_qcom_sdw" - "snd_soc_sc8280xp" + # "qcom_soundwire" + # "snd_soc_qcom_sdw" + # "snd_soc_sc8280xp" ]; }; diff --git a/nix/os/devices/steveej-x13s/flake.lock b/nix/os/devices/steveej-x13s/flake.lock index a50936c..91c87e3 100644 --- a/nix/os/devices/steveej-x13s/flake.lock +++ b/nix/os/devices/steveej-x13s/flake.lock @@ -44,11 +44,11 @@ ] }, "locked": { - "lastModified": 1735468753, - "narHash": "sha256-2dt1nOe9zf9pDkf5Kn7FUFyPRo581s0n90jxYXJ94l0=", + "lastModified": 1737038063, + "narHash": "sha256-rMEuiK69MDhjz1JgbaeQ9mBDXMJ2/P8vmOYRbFndXsk=", "owner": "nix-community", "repo": "disko", - "rev": "84a5b93637cc16cbfcc61b6e1684d626df61eb21", + "rev": "bf0abfde48f469c256f2b0f481c6281ff04a5db2", "type": "github" }, "original": { @@ -164,15 +164,15 @@ ] }, "locked": { - "lastModified": 1735381016, - "narHash": "sha256-CyCZFhMUkuYbSD6bxB/r43EdmDE7hYeZZPTCv0GudO4=", - "owner": "nix-community", + "lastModified": 1737233786, + "narHash": "sha256-WO6owkCecetn7bbu/ofy8aftO3rPCHUeq5GlVLsfS4M=", + "owner": "steveej-forks", "repo": "home-manager", - "rev": "10e99c43cdf4a0713b4e81d90691d22c6a58bdf2", + "rev": "40ecdf4fc8bb698b8cbdb2ddb0ed5b1868e43c1a", "type": "github" }, "original": { - "owner": "nix-community", + "owner": "steveej-forks", "ref": "master", "repo": "home-manager", "type": "github" @@ -181,16 +181,16 @@ "linux-jhovold": { "flake": false, "locked": { - "lastModified": 1734949573, - "narHash": "sha256-m1O1PLTDYrpt62+aj850I/xBLKbAulx+JlXj99KWjfw=", + "lastModified": 1736759316, + "narHash": "sha256-cNqR3H797YcCsHutwNGdV+u6T0AUh17TGev/LCqNCy8=", "owner": "jhovold", "repo": "linux", - "rev": "2f0b291243ef93a37f93608d373e21a322af41a2", + "rev": "1ca98ace316a107b488b33959ce012b5875edbef", "type": "github" }, "original": { "owner": "jhovold", - "ref": "wip/sc8280xp-6.13-rc4", + "ref": "wip/sc8280xp-6.13-rc7", "repo": "linux", "type": "github" } @@ -264,11 +264,11 @@ "x13s-bt-linux-firmware": "x13s-bt-linux-firmware" }, "locked": { - "lastModified": 1734962407, - "narHash": "sha256-UjVcYBzg0WJh8cGH67JYZRm5BFPemQFGkEUFPJh0SXc=", + "lastModified": 1737021191, + "narHash": "sha256-w4B4UHtCH3+gX8qTl2m6RURCB7OyKjSy1SMr/Q4aB0w=", "ref": "bump", - "rev": "5583f444c6abb38ca88cf2046bb792bea01a5496", - "revCount": 132, + "rev": "00a940407a7ccc144d887e25c7568c1573c488ce", + "revCount": 134, "type": "git", "url": "https://forgejo.www.stefanjunker.de/steveej/nixos-x13s.git" }, @@ -308,11 +308,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1735412871, - "narHash": "sha256-Qoz0ow6jDGUIBHxduc7Y1cjYFS71tvEGJV5Src/mj98=", + "lastModified": 1737165118, + "narHash": "sha256-s40Kk/OulP3J/1JvC3VT16U4r/Xw6Qdi7SRw3LYkPWs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9f94733f93e4fe6e82f516efae007096e4ab5a21", + "rev": "6a3ae7a5a12fb8cac2d59d7df7cbd95f9b2f0566", "type": "github" }, "original": { @@ -324,11 +324,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1733759999, - "narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=", + "lastModified": 1736274150, + "narHash": "sha256-kucNsE9V9/jTQ3QsTP2+UeIHvmYOomBR0+ecjVSSUfA=", "owner": "steveej-forks", "repo": "nixpkgs", - "rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56", + "rev": "d8de481c687c467d22ed7b0b398240f806f2c4b9", "type": "github" }, "original": { diff --git a/nix/os/devices/steveej-x13s/flake.nix b/nix/os/devices/steveej-x13s/flake.nix index 80084ee..eb90b4f 100644 --- a/nix/os/devices/steveej-x13s/flake.nix +++ b/nix/os/devices/steveej-x13s/flake.nix @@ -9,7 +9,8 @@ disko.inputs.nixpkgs.follows = "nixpkgs"; home-manager = { - url = "github:nix-community/home-manager/master"; + url = "github:steveej-forks/home-manager/master"; + # url = "github:nix-community/home-manager/master"; # url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; };