diff --git a/pkgs/adwcustomizer/default.nix b/pkgs/adwcustomizer/default.nix new file mode 100644 index 00000000..3c23f797 --- /dev/null +++ b/pkgs/adwcustomizer/default.nix @@ -0,0 +1,50 @@ +{ stdenv, lib, fetchFromGitHub, wrapGAppsHook4, meson, ninja, pkg-config, glib, desktop-file-utils, gettext, blueprint-compiler, python3Packages, appstream-glib, gtk4, libadwaita }: + +# Not all parts of the application works with the current nixpkgs version of +# libadwaita. +python3Packages.buildPythonApplication rec { + pname = "adwcustomizer"; + version = "2022-07-19"; + + src = fetchFromGitHub { + owner = "ArtyIF"; + repo = "AdwCustomizer"; + rev = "718f2490c95de60e8571b1a9d92af78919c14de1"; + sha256 = "sha256-rMaWIJBQ+HC1Gs5xCRyuOCvB2XcTFB2q194bfK5Q48Q="; + }; + + patches = [ + ./patches/update-non-flatpak-env.patch + ]; + + format = "other"; + dontWrapGApps = true; + + nativeBuildInputs = [ + wrapGAppsHook4 + meson + ninja + pkg-config + glib + desktop-file-utils + gettext + appstream-glib + blueprint-compiler + gtk4 + libadwaita + ]; + + propagatedBuildInputs = with python3Packages; [ + pygobject3 + ]; + + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + ''; + + meta = with lib; { + homepage = "https://github.com/ArtyIF/AdwCustomizer"; + description = "Customize libadwaita and GTK3 apps (with adw-gtk3)"; + license = licenses.mit; + }; +} diff --git a/pkgs/adwcustomizer/patches/update-non-flatpak-env.patch b/pkgs/adwcustomizer/patches/update-non-flatpak-env.patch new file mode 100644 index 00000000..20ef44b4 --- /dev/null +++ b/pkgs/adwcustomizer/patches/update-non-flatpak-env.patch @@ -0,0 +1,15 @@ +diff --git a/src/main.py b/src/main.py +index b73c749..97e2b24 100644 +--- a/src/main.py ++++ b/src/main.py +@@ -295,5 +295,10 @@ class AdwcustomizerApplication(Adw.Application): + + def main(version): + """The application's entry point.""" ++ if not os.getenv("XDG_CONFIG_HOME"): ++ os.environ["XDG_CONFIG_HOME"] = os.path.expanduser("~/.config") ++ app_config = os.path.join(os.environ["XDG_CONFIG_HOME"], "adwcustomizer") ++ os.makedirs(app_config, exist_ok=True) ++ + app = AdwcustomizerApplication() + return app.run(sys.argv) diff --git a/pkgs/default.nix b/pkgs/default.nix index 50a1eba9..bbc8dbcf 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -6,6 +6,7 @@ let packages = self: let callPackage = newScope self; in { + adwcustomizer = callPackage ./adwcustomizer { }; artem = callPackage ./artem.nix { }; auto-editor = callPackage ./auto-editor.nix { }; awesome-cli = callPackage ./awesome-cli { };