From 0935cbf2872d2b6fff3b700eeae324ad6e317068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Maccagnoni?= Date: Wed, 7 Mar 2018 09:24:31 +0100 Subject: [PATCH 1/3] gnomeExtensions.system-monitor: fix this package and upgrade to v33 --- .../default.nix} | 17 ++++++++++++----- .../remove_nonexisting_mounts.patch | 13 +++++++++++++ pkgs/top-level/all-packages.nix | 1 + 3 files changed, 26 insertions(+), 5 deletions(-) rename pkgs/desktops/gnome-3/extensions/{system-monitor.nix => system-monitor/default.nix} (53%) create mode 100644 pkgs/desktops/gnome-3/extensions/system-monitor/remove_nonexisting_mounts.patch diff --git a/pkgs/desktops/gnome-3/extensions/system-monitor.nix b/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix similarity index 53% rename from pkgs/desktops/gnome-3/extensions/system-monitor.nix rename to pkgs/desktops/gnome-3/extensions/system-monitor/default.nix index 0c3e65633c81..2c2f9870c7fd 100644 --- a/pkgs/desktops/gnome-3/extensions/system-monitor.nix +++ b/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix @@ -1,26 +1,33 @@ -{ stdenv, fetchFromGitHub, glib }: +# This package needs the following configuration in configuration.nix: +# services.xserver.desktopManager.gnome3.sessionPath = [ pkgs.libgtop pkgs.glib_networking ]; +{ config, stdenv, fetchFromGitHub, glib, glib_networking, libgtop, pkgs }: stdenv.mkDerivation rec { name = "gnome-shell-system-monitor-${version}"; - version = "8b31f070e9e59109d729661ced313d6a63e31787"; + version = "v33"; src = fetchFromGitHub { owner = "paradoxxxzero"; repo = "gnome-shell-system-monitor-applet"; rev = version; - sha256 = "0fm5zb6qp53jjy2mnkb8ybxygzjwpb314giiq0ywq87hhrpch8m3"; + sha256 = "0abqaanl5r26x8f0mm0jgrjsr86hcx7mk75dx5c3zz7csw4nclkk"; }; buildInputs = [ glib + glib_networking + libgtop ]; + patches = [ ./remove_nonexisting_mounts.patch ]; + buildPhase = '' ${glib.dev}/bin/glib-compile-schemas --targetdir=${uuid}/schemas ${uuid}/schemas ''; installPhase = '' - cp -r ${uuid} $out + mkdir -p $out/share/gnome-shell/extensions + cp -r ${uuid} $out/share/gnome-shell/extensions ''; uuid = "system-monitor@paradoxxx.zero.gmail.com"; @@ -28,7 +35,7 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { description = "Display system informations in gnome shell status bar"; license = licenses.gpl3Plus; - maintainers = with maintainers; [ aneeshusa ]; + maintainers = with maintainers; [ aneeshusa tiramiseb ]; homepage = https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet; }; } diff --git a/pkgs/desktops/gnome-3/extensions/system-monitor/remove_nonexisting_mounts.patch b/pkgs/desktops/gnome-3/extensions/system-monitor/remove_nonexisting_mounts.patch new file mode 100644 index 000000000000..8bff7fbe24fe --- /dev/null +++ b/pkgs/desktops/gnome-3/extensions/system-monitor/remove_nonexisting_mounts.patch @@ -0,0 +1,13 @@ +diff --git a/system-monitor@paradoxxx.zero.gmail.com/extension.js b/system-monitor@paradoxxx.zero.gmail.com/extension.js +index b4b7f15..d645654 100644 +--- a/system-monitor@paradoxxx.zero.gmail.com/extension.js ++++ b/system-monitor@paradoxxx.zero.gmail.com/extension.js +@@ -386,7 +386,7 @@ const smMountsMonitor = new Lang.Class({ + connected: false, + _init: function () { + this._volumeMonitor = Gio.VolumeMonitor.get(); +- let sys_mounts = ['/home', '/tmp', '/boot', '/usr', '/usr/local']; ++ let sys_mounts = ['/home', '/tmp', '/boot']; + this.base_mounts = ['/']; + sys_mounts.forEach(Lang.bind(this, function (sMount) { + if (this.is_sys_mount(sMount + '/')) { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d5c017f8d93a..319133b89dbe 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19289,6 +19289,7 @@ with pkgs; nohotcorner = callPackage ../desktops/gnome-3/extensions/nohotcorner { }; no-title-bar = callPackage ../desktops/gnome-3/extensions/no-title-bar { }; remove-dropdown-arrows = callPackage ../desktops/gnome-3/extensions/remove-dropdown-arrows { }; + system-monitor = callPackage ../desktops/gnome-3/extensions/system-monitor { }; taskwhisperer = callPackage ../desktops/gnome-3/extensions/taskwhisperer { }; topicons-plus = callPackage ../desktops/gnome-3/extensions/topicons-plus { }; }; From 058be360d367e7180f1d736b271762aa1367cc90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Maccagnoni?= Date: Wed, 7 Mar 2018 19:59:00 +0100 Subject: [PATCH 2/3] gnomeExtensions.system-monitor: Fix the version number --- pkgs/desktops/gnome-3/extensions/system-monitor/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix b/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix index 2c2f9870c7fd..01b3fbad7c2f 100644 --- a/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix +++ b/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix @@ -4,12 +4,12 @@ stdenv.mkDerivation rec { name = "gnome-shell-system-monitor-${version}"; - version = "v33"; + version = "33"; src = fetchFromGitHub { owner = "paradoxxxzero"; repo = "gnome-shell-system-monitor-applet"; - rev = version; + rev = "v${version}"; sha256 = "0abqaanl5r26x8f0mm0jgrjsr86hcx7mk75dx5c3zz7csw4nclkk"; }; From a180a52dd330388d489ae8100d188ffc0e82b3b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Maccagnoni?= Date: Sun, 11 Mar 2018 21:55:21 +0100 Subject: [PATCH 3/3] gnomeExtensions.system-monitor: do not need global sessionPath modification --- .../gnome-3/extensions/system-monitor/default.nix | 12 ++++++++---- ...unts.patch => paths_and_nonexisting_dirs.patch} | 14 ++++++++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) rename pkgs/desktops/gnome-3/extensions/system-monitor/{remove_nonexisting_mounts.patch => paths_and_nonexisting_dirs.patch} (52%) diff --git a/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix b/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix index 01b3fbad7c2f..eed34ae523d4 100644 --- a/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix +++ b/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix @@ -1,6 +1,4 @@ -# This package needs the following configuration in configuration.nix: -# services.xserver.desktopManager.gnome3.sessionPath = [ pkgs.libgtop pkgs.glib_networking ]; -{ config, stdenv, fetchFromGitHub, glib, glib_networking, libgtop, pkgs }: +{ config, stdenv, substituteAll, fetchFromGitHub, glib, glib_networking, libgtop, pkgs }: stdenv.mkDerivation rec { name = "gnome-shell-system-monitor-${version}"; @@ -19,7 +17,13 @@ stdenv.mkDerivation rec { libgtop ]; - patches = [ ./remove_nonexisting_mounts.patch ]; + patches = [ + (substituteAll { + src = ./paths_and_nonexisting_dirs.patch; + gtop_path = "${libgtop}/lib/girepository-1.0"; + glib_net_path = "${glib_networking}/lib/girepository-1.0"; + }) + ]; buildPhase = '' ${glib.dev}/bin/glib-compile-schemas --targetdir=${uuid}/schemas ${uuid}/schemas diff --git a/pkgs/desktops/gnome-3/extensions/system-monitor/remove_nonexisting_mounts.patch b/pkgs/desktops/gnome-3/extensions/system-monitor/paths_and_nonexisting_dirs.patch similarity index 52% rename from pkgs/desktops/gnome-3/extensions/system-monitor/remove_nonexisting_mounts.patch rename to pkgs/desktops/gnome-3/extensions/system-monitor/paths_and_nonexisting_dirs.patch index 8bff7fbe24fe..82e3d7c541ba 100644 --- a/pkgs/desktops/gnome-3/extensions/system-monitor/remove_nonexisting_mounts.patch +++ b/pkgs/desktops/gnome-3/extensions/system-monitor/paths_and_nonexisting_dirs.patch @@ -1,8 +1,18 @@ diff --git a/system-monitor@paradoxxx.zero.gmail.com/extension.js b/system-monitor@paradoxxx.zero.gmail.com/extension.js -index b4b7f15..d645654 100644 +index b4b7f15..d139135 100644 --- a/system-monitor@paradoxxx.zero.gmail.com/extension.js +++ b/system-monitor@paradoxxx.zero.gmail.com/extension.js -@@ -386,7 +386,7 @@ const smMountsMonitor = new Lang.Class({ +@@ -18,6 +18,9 @@ + + // Author: Florian Mounier aka paradoxxxzero + ++imports.gi.GIRepository.Repository.prepend_search_path('@gtop_path@'); ++imports.gi.GIRepository.Repository.prepend_search_path('@glib_net_path@'); ++ + /* Ugly. This is here so that we don't crash old libnm-glib based shells unnecessarily + * by loading the new libnm.so. Should go away eventually */ + const libnm_glib = imports.gi.GIRepository.Repository.get_default().is_registered("NMClient", "1.0"); +@@ -386,7 +389,7 @@ const smMountsMonitor = new Lang.Class({ connected: false, _init: function () { this._volumeMonitor = Gio.VolumeMonitor.get();