NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.07k stars 14.13k forks source link

gnomeExtensions.ddterm: `Please install packages that provide the following files: Handy-1.typelib` error #305991

Closed edgar-vincent closed 5 months ago

edgar-vincent commented 6 months ago

Describe the bug

When the ddterm is toggled, the following error appears in a notification: Please install packages that provide the following files: Handy-1.typelib.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install and enable gnomeExtensions.ddterm.
  2. Toggle it with the configured hotkey.

Expected behavior

ddterm should appear.

Notify maintainers

@piegamesde Thanks!

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.28, NixOS, 24.05 (Uakari), 24.05.20240419.5c24cf2`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"home-manager, nixos"`
 - nixpkgs: `/nix/store/v4pcs3nzx54m5bmxd39win0rgl2d2hbx-source`

Add a :+1: reaction to issues you find important.

jackwilsdon commented 6 months ago

Fixed by #298973.

edgar-vincent commented 6 months ago

Sorry, I'd missed that PR. Thanks @jackwilsdon.

GreatTeacherOni commented 5 months ago

As long as this PR isn't merged yet, how would I go about an overlay that can be imported into configuration.nix on NixOS?

My configuration.nix looks like this:

{ config, pkgs, lib, options, ... }:
{
...
nixpkgs.overlays = [
    (import ./chromium-overlay.nix) # example
    (import ./ddterm-overlay.nix) # this overlay is needed for ddterm until https://github.com/NixOS/nixpkgs/pull/298973 is merged into unstable. See https://github.com/NixOS/nixpkgs/issues/305991
  ];
...  
 }

and my ddterm-overlay.nix should probably look something like this (see https://github.com/NixOS/nixpkgs/blob/master/pkgs/desktops/gnome/extensions/extensionOverrides.nix) , but I don't know how to actually write the correct code to inherit the prev stuff and just add the missing parts like gjs , libhandy and postFixup which have to be added or changed:

# Add the stuff that is missing and inherit other stuff
{ <inheritted part>
  , gjs # inheritted and needed for ddterm
 , gobject-introspection # inheritted and needed for ddterm
 , libhandy # has to be added (new)
 , vte # inheritted and needed for ddterm
 , wrapGAppsHook # inheritted and needed for ddterm
}:
let
  # Helper method to reduce redundancy
  patchExtension = name: override: super: (super // {
    ${name} = super.${name}.overrideAttrs override;
  });
in
# A set of overrides for automatically packaged extensions that require some small fixes.
# The input must be an attribute set with the extensions' UUIDs as keys and the extension
# derivations as values. Output is the same, but with patches applied.
#
# Note that all source patches refer to the built extension as published on extensions.gnome.org, and not
# the upstream repository's sources.
super: lib.trivial.pipe super [
... (... symbolizes inheritted part)

  (patchExtension "ddterm@amezin.github.com" (old: {
    nativeBuildInputs = [ gobject-introspection wrapGAppsHook ];
    buildInputs = [ gjs vte libhandy ];
    postFixup = ''
      patchShebangs "$out/share/gnome-shell/extensions/ddterm@amezin.github.com/bin/com.github.amezin.ddterm"
      wrapGApp "$out/share/gnome-shell/extensions/ddterm@amezin.github.com/bin/com.github.amezin.ddterm"
    '';
  }))

... (... symbolizes inheritted part)
]