From bdc28c2280618f7f121f7e85b3646a289eb4775c Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 25 Nov 2024 14:38:25 -0500 Subject: [PATCH] feat(firefox): improve versioning for gx --- flake.lock | Bin 55048 -> 55072 bytes flake.nix | Bin 11204 -> 11225 bytes homeManagerModules/firefox/default.nix | 3 +- homeManagerModules/firefox/gx-theme.nix | 51 ++++++++++++++---------- inputs/default.nix | 2 +- 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/flake.lock b/flake.lock index f722e6e188b5ac24709b04c5bc1388e207c60deb..416272f0034933626d0cdaccb3554bd0106ee450 100644 GIT binary patch delta 45 zcmV+|0Mh@6t^=U11F-HM3T7fYAR=}yIW9Mop(7QON*)!H4N)YMpd<#942=o1Js-=r DVSEou delta 18 acmZ3mj=5tU^M-eFlmDx-Z|0R3-T?qlmj|x^ diff --git a/flake.nix b/flake.nix index 492580fc4230678f7c35a8183f117704fcacd73d..11b4e92af5550f62b214d928054b90f34fc802ed 100644 GIT binary patch delta 23 ecmX>SelvW7FFRM7f~|s5nVzMd`DQ2fCKUis_Hq>fCZ7cd diff --git a/homeManagerModules/firefox/default.nix b/homeManagerModules/firefox/default.nix index 7e475038..66fc2163 100644 --- a/homeManagerModules/firefox/default.nix +++ b/homeManagerModules/firefox/default.nix @@ -8,8 +8,7 @@ self: { rounding = (config.wayland.windowManager.hyprland.settings.decoration.rounding or 2) - 2; firefox-gx = pkgs.callPackage ./gx-theme.nix { - inherit (self.inputs) firefox-gx-src; - inherit (self.lib) mkVersion; + inherit self; }; in { config = { diff --git a/homeManagerModules/firefox/gx-theme.nix b/homeManagerModules/firefox/gx-theme.nix index 318d2b01..052b81c1 100644 --- a/homeManagerModules/firefox/gx-theme.nix +++ b/homeManagerModules/firefox/gx-theme.nix @@ -1,27 +1,38 @@ { lib, - mkVersion, - firefox-gx-src, + self, stdenvNoCC, -}: -stdenvNoCC.mkDerivation { - pname = "firefox-gx"; - version = mkVersion firefox-gx-src; +}: let + inherit (builtins) fromJSON readFile; + inherit (lib) hasPrefix replaceStrings; - src = firefox-gx-src; + inherit (self.inputs) firefox-gx-src; + inherit (self.lib) mkVersion; - installPhase = '' - # Personal changes - sed -i 's/var(--fuchsia))/var(--purple))/' ./chrome/components/ogx_root-personal.css - sed -i 's#../newtab/wallpaper-dark1.png#../newtab/wallpaper-dark2.png#' ./chrome/components/ogx_root-personal.css + lock = fromJSON (readFile "${self}/flake.lock"); + rev = lock.nodes.firefox-gx-src.original.ref; +in + stdenvNoCC.mkDerivation { + pname = "firefox-gx"; + version = + if hasPrefix "v." rev + then replaceStrings ["v"] ["0"] rev + else mkVersion firefox-gx-src; - mkdir -p $out - cp -r ./* $out - ''; + src = firefox-gx-src; - meta = { - description = "Firefox Theme CSS to Opera GX Lovers"; - homepage = "https://github.com/Godiesc/firefox-gx"; - license = lib.licenses.mspl; - }; -} + installPhase = '' + # Personal changes + sed -i 's/var(--fuchsia))/var(--purple))/' ./chrome/components/ogx_root-personal.css + sed -i 's#../newtab/wallpaper-dark1.png#../newtab/wallpaper-dark2.png#' ./chrome/components/ogx_root-personal.css + + mkdir -p $out + cp -r ./* $out + ''; + + meta = { + description = "Firefox Theme CSS to Opera GX Lovers"; + homepage = "https://github.com/Godiesc/firefox-gx"; + license = lib.licenses.mspl; + }; + } diff --git a/inputs/default.nix b/inputs/default.nix index 10071f8f..9c0cc856 100644 --- a/inputs/default.nix +++ b/inputs/default.nix @@ -344,7 +344,7 @@ let { owner = "Godiesc"; repo = "firefox-gx"; - # ref = "v.9.6"; + ref = "v.9.7"; } { name = "git-theme-src";