Comments (4)
@maxkrieger As noted in #37, I have an expression suitable for NixOS that accounts for this issue. Once it can refer to git tags for the source, I'll open up a pull request against nixpkgs to add it there. In the mean time, the expression below should work for you:
default.nix
:
{ stdenv, substituteAll, fetchFromGitHub, docker, procps }:
stdenv.mkDerivation rec {
name = "gnome-shell-extension-docker-status-${version}";
version = "2019-03-08";
src = fetchFromGitHub {
owner = "gpouilloux";
repo = "gnome-shell-extension-docker";
rev = "5783aedd0c384c8859c7a134e079c813c8071cce";
sha256 = "0wmxca90mdlllh1xmvm89nbxnz65sbnab2s4mi6cjjgaqi4p3dc9";
};
uuid = "docker_status@gpouilloux";
installPhase = ''
mkdir -p $out/share/gnome-shell/extensions/${uuid}
cp docker.svg $out/share/gnome-shell/extensions/${uuid}
cp extension.js $out/share/gnome-shell/extensions/${uuid}
cp metadata.json $out/share/gnome-shell/extensions/${uuid}
cp stylesheet.css $out/share/gnome-shell/extensions/${uuid}
cp -R src $out/share/gnome-shell/extensions/${uuid}
'';
patches = [
(substituteAll {
src = ./fix-paths.patch;
docker = "${docker}/bin/docker";
ps = "${procps}/bin/ps";
})
];
meta = with stdenv.lib; {
description = "Status menu for managing Docker containers";
license = licenses.gpl2;
maintainers = with maintainers; [ jonafato ];
homepage = https://github.com/gpouilloux/gnome-shell-extension-docker;
};
}
fix-paths.patch
:
diff --git a/src/docker.js b/src/docker.js
index 3a3ba54..a3eed3e 100644
--- a/src/docker.js
+++ b/src/docker.js
@@ -40,7 +40,7 @@ const isDockerInstalled = () => !!GLib.find_program_in_path('docker');
* @return {Boolean} whether docker daemon is running or not
*/
const isDockerRunning = () => {
- const [res, pid, in_fd, out_fd, err_fd] = GLib.spawn_async_with_pipes(null, ['/bin/ps', 'cax'], null, 0, null);
+ const [res, pid, in_fd, out_fd, err_fd] = GLib.spawn_async_with_pipes(null, ['@ps@', 'cax'], null, 0, null);
const outReader = new Gio.DataInputStream({
base_stream: new Gio.UnixInputStream({ fd: out_fd })
@@ -66,7 +66,7 @@ const isDockerRunning = () => {
* @return {Array} The array of containers as { name, status }
*/
const getContainers = () => {
- const [res, out, err, status] = GLib.spawn_command_line_sync("docker ps -a --format '{{.Names}},{{.Status}}'");
+ const [res, out, err, status] = GLib.spawn_command_line_sync("@docker@ ps -a --format '{{.Names}},{{.Status}}'");
if (status !== 0)
throw new Error("Error occurred when fetching containers");
@@ -88,7 +88,7 @@ const getContainers = () => {
* @param {Function} callback A callback that takes the status, command, and stdErr
*/
const runCommand = (command, containerName, callback) => {
- const cmd = "docker " + command + " " + containerName;
+ const cmd = "@docker@ " + command + " " + containerName;
async(() => {
const [res, out, err, status] = GLib.spawn_command_line_async(cmd);
return { cmd: cmd, err: err, status: status };
from gnome-shell-extension-docker.
@jonafato great! To clarify, I installed this package via the gnome shell web interface. Is this generally inadvisable for Nix users? I presume this will be installable directly via nixpkgs when it gets merged.
from gnome-shell-extension-docker.
The selection of GNOME extensions available in nixpkgs is obviously not exhaustive, but I'd recommend installing extensions via nix primarily, anyway. If an extension you need isn't there, they tend to be pretty straightforward to package (I'm happy to help out if you run into any trouble). And as you've noticed, extensions that depend on external binaries are likely to fail when installed from extensions.gnome.org or other methods that don't contain these types of patches.
from gnome-shell-extension-docker.
@jonafato gotcha, thanks!
from gnome-shell-extension-docker.
Related Issues (20)
- Gnome 3.32 - Error occurred when fetching containers HOT 21
- Version 10 not working with Gnome 3.22.2 (Debian Stretch) HOT 4
- Extension not working in Ubuntu 19.04 HOT 2
- Error occurred when fetching containers HOT 1
- Extension not working in Ubuntu 18.04.3 HOT 1
- Not working on Ubuntu 20.04 HOT 2
- Implement preference dialog to configure used terminal when opening a shell
- [Support] Gnome 3.36
- Address gjs libraries deprecation warnings
- Favourite list loads with delay HOT 5
- [Feature request] Podman compatibility HOT 1
- Error after upgrade
- sh instead of bash HOT 3
- Feature Request: Docker deamon not started - Grey out
- problem launch shell HOT 11
- centos8 gnome3.32.2 install fail
- No containers detected HOT 1
- Support gnome-shell version 42 HOT 1
- The colors are nowhere described
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gnome-shell-extension-docker.