From b5038e5127e728ebd9b0cd30aef0211ff4df035b Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Wed, 1 Dec 2021 22:37:27 +0800 Subject: [PATCH] pantheon.gnome-bluetooth-contract: init at unstable-2021-02-23 --- .../x11/desktop-managers/pantheon.nix | 1 + pkgs/desktops/pantheon/default.nix | 4 ++ .../gnome-bluetooth-contract/default.nix | 46 +++++++++++++++++++ .../gnome-bluetooth-contract/exec-path.patch | 11 +++++ 4 files changed, 62 insertions(+) create mode 100644 pkgs/desktops/pantheon/desktop/gnome-bluetooth-contract/default.nix create mode 100644 pkgs/desktops/pantheon/desktop/gnome-bluetooth-contract/exec-path.patch diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index 464fa7a50a2f..e252a244eb83 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -300,6 +300,7 @@ in contractor extra-elementary-contracts file-roller-contract + gnome-bluetooth-contract ]; environment.pathsToLink = [ diff --git a/pkgs/desktops/pantheon/default.nix b/pkgs/desktops/pantheon/default.nix index 55e1c5fcfc8f..4ac5f9bcf1db 100644 --- a/pkgs/desktops/pantheon/default.nix +++ b/pkgs/desktops/pantheon/default.nix @@ -105,6 +105,10 @@ lib.makeScope pkgs.newScope (self: with self; { inherit (gnome) gnome-desktop; }; + gnome-bluetooth-contract = callPackage ./desktop/gnome-bluetooth-contract { + inherit (gnome) gnome-bluetooth; + }; + wingpanel = callPackage ./desktop/wingpanel { }; wingpanel-with-indicators = callPackage ./desktop/wingpanel/wrapper.nix { diff --git a/pkgs/desktops/pantheon/desktop/gnome-bluetooth-contract/default.nix b/pkgs/desktops/pantheon/desktop/gnome-bluetooth-contract/default.nix new file mode 100644 index 000000000000..36f4d3e539f0 --- /dev/null +++ b/pkgs/desktops/pantheon/desktop/gnome-bluetooth-contract/default.nix @@ -0,0 +1,46 @@ +{ lib +, stdenv +, fetchFromGitHub +, substituteAll +, gnome-bluetooth +}: + +stdenv.mkDerivation rec { + pname = "gnome-bluetooth-contract"; + version = "unstable-2021-02-23"; + + src = fetchFromGitHub { + owner = "elementary"; + repo = pname; + rev = "8dcd4d03dc7a7d487980fd8bc95af985dc4fff5c"; + sha256 = "sha256-9eX6j/cvN/CoqrHrh9mZEsUJ8viDWIGxIva1xFwIK7c="; + }; + + patches = [ + (substituteAll { + src = ./exec-path.patch; + gnome_bluetooth = gnome-bluetooth; + }) + ]; + + dontConfigure = true; + + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/contractor + cp *.contract $out/share/contractor/ + + runHook postInstall + ''; + + meta = with lib; { + description = "Contractor extension for GNOME Bluetooth"; + homepage = "https://github.com/elementary/gnome-bluetooth-contract"; + license = licenses.gpl3Plus; + maintainers = teams.pantheon.members; + platforms = platforms.linux; + }; +} diff --git a/pkgs/desktops/pantheon/desktop/gnome-bluetooth-contract/exec-path.patch b/pkgs/desktops/pantheon/desktop/gnome-bluetooth-contract/exec-path.patch new file mode 100644 index 000000000000..c0bd9e579f46 --- /dev/null +++ b/pkgs/desktops/pantheon/desktop/gnome-bluetooth-contract/exec-path.patch @@ -0,0 +1,11 @@ +diff --git a/io.elementary.contracter.gnome-bluetooth.contract b/io.elementary.contracter.gnome-bluetooth.contract +index 3eb2334..ce0e5f5 100644 +--- a/io.elementary.contracter.gnome-bluetooth.contract ++++ b/io.elementary.contracter.gnome-bluetooth.contract +@@ -3,5 +3,5 @@ Name=Send Files via Bluetooth + Icon=bluetooth + Description=Send files to device... + MimeType=!inode; +-Exec=bluetooth-sendto %F ++Exec=@gnome_bluetooth@/bin/bluetooth-sendto %F + Gettext-Domain=gnome-bluetooth2