diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index 5a41f96497f2..464fa7a50a2f 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -296,9 +296,10 @@ in }) (mkIf serviceCfg.contractor.enable { - environment.systemPackages = with pkgs.pantheon; [ + environment.systemPackages = with pkgs.pantheon; [ contractor extra-elementary-contracts + file-roller-contract ]; environment.pathsToLink = [ diff --git a/pkgs/desktops/pantheon/default.nix b/pkgs/desktops/pantheon/default.nix index 61436ba57ae5..55e1c5fcfc8f 100644 --- a/pkgs/desktops/pantheon/default.nix +++ b/pkgs/desktops/pantheon/default.nix @@ -97,6 +97,10 @@ lib.makeScope pkgs.newScope (self: with self; { inherit (gnome) file-roller gnome-bluetooth; }; + file-roller-contract = callPackage ./desktop/file-roller-contract { + inherit (gnome) file-roller; + }; + gala = callPackage ./desktop/gala { inherit (gnome) gnome-desktop; }; diff --git a/pkgs/desktops/pantheon/desktop/file-roller-contract/default.nix b/pkgs/desktops/pantheon/desktop/file-roller-contract/default.nix new file mode 100644 index 000000000000..9f4d275f2462 --- /dev/null +++ b/pkgs/desktops/pantheon/desktop/file-roller-contract/default.nix @@ -0,0 +1,46 @@ +{ lib +, stdenv +, fetchFromGitHub +, substituteAll +, file-roller +}: + +stdenv.mkDerivation rec { + pname = "file-roller-contract"; + version = "unstable-2021-02-23"; + + src = fetchFromGitHub { + owner = "elementary"; + repo = pname; + rev = "cf001d84a7e2ddcfbee2cfdb19885798a869833e"; + sha256 = "sha256-jnXq44NiQiSYsvaBF828TklLg9d6z6n+gCZKgbFiERI="; + }; + + patches = [ + (substituteAll { + src = ./exec-path.patch; + file_roller = file-roller; + }) + ]; + + 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 File Roller"; + homepage = "https://github.com/elementary/file-roller-contract"; + license = licenses.gpl3Plus; + maintainers = teams.pantheon.members; + platforms = platforms.linux; + }; +} diff --git a/pkgs/desktops/pantheon/desktop/file-roller-contract/exec-path.patch b/pkgs/desktops/pantheon/desktop/file-roller-contract/exec-path.patch new file mode 100644 index 000000000000..8349ae8088da --- /dev/null +++ b/pkgs/desktops/pantheon/desktop/file-roller-contract/exec-path.patch @@ -0,0 +1,22 @@ +diff --git a/io.elementary.contractor.file-roller-compress.contract b/io.elementary.contractor.file-roller-compress.contract +index 11e4da3..d58549f 100644 +--- a/io.elementary.contractor.file-roller-compress.contract ++++ b/io.elementary.contractor.file-roller-compress.contract +@@ -3,5 +3,5 @@ Name=Compress + Icon=add-files-to-archive + Description=Create a compressed archive with the selected objects + MimeType=!archive;inode/blockdevice;inode/chardevice;inode/fifo;inode/socket; +-Exec=file-roller --add %U ++Exec=@file_roller@/bin/file-roller --add %U + Gettext-Domain=file-roller +diff --git a/io.elementary.contractor.file-roller-extract-here.contract b/io.elementary.contractor.file-roller-extract-here.contract +index 184a6f2..345f4e7 100644 +--- a/io.elementary.contractor.file-roller-extract-here.contract ++++ b/io.elementary.contractor.file-roller-extract-here.contract +@@ -3,5 +3,5 @@ Name=Extract Here + Icon=extract-archive + Description=Extract the contents of the archives in the archive folder and quit the program + MimeType=application/x-7z-compressed;application/x-7z-compressed-tar;application/x-ace;application/x-alz;application/x-ar;application/x-arj;application/x-bzip;application/x-bzip-compressed-tar;application/x-bzip1;application/x-bzip1-compressed-tar;application/x-cabinet;application/x-cbr;application/x-cbz;application/x-cd-image;application/x-compress;application/x-compressed-tar;application/x-cpio;application/x-deb;application/x-ear;application/x-ms-dos-executable;application/x-gtar;application/x-gzip;application/x-gzpostscript;application/x-java-archive;application/x-lha;application/x-lhz;application/x-lrzip;application/x-lrzip-compressed-tar;application/x-lzip;application/x-lzip-compressed-tar;application/x-lzma;application/x-lzma-compressed-tar;application/x-lzop;application/x-lzop-compressed-tar;application/x-ms-wim;application/x-rar;application/x-rar-compressed;application/x-rpm;application/x-rzip;application/x-tar;application/x-tarz;application/x-stuffit;application/x-war;application/x-xz;application/x-xz-compressed-tar;application/x-zip;application/x-zip-compressed;application/x-zoo;application/zip; +-Exec=file-roller --extract-here %U ++Exec=@file_roller@/bin/file-roller --extract-here %U + Gettext-Domain=file-roller