From c1ad1ae785a2629c6b650d8c0cf2b9802495fe6a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 21 Dec 2021 14:26:56 +0800 Subject: [PATCH] gnome-shell-extension-burn-my-windows: init at 2 --- pkgs/default.nix | 2 + .../gnome-shell-extension-burn-my-windows.nix | 47 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 pkgs/gnome-shell-extension-burn-my-windows.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 8d9d6577..dc62719f 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -4,6 +4,8 @@ with pkgs; { doggo = callPackage ./doggo.nix { }; gnome-shell-extension-pop-shell = callPackage ./gnome-shell-extension-pop-shell.nix { }; + gnome-shell-extension-burn-my-windows = + callPackage ./gnome-shell-extension-burn-my-windows.nix { }; gnome-shell-extension-fly-pie = callPackage ./gnome-shell-extension-fly-pie.nix { }; libcs50 = callPackage ./libcs50.nix { }; diff --git a/pkgs/gnome-shell-extension-burn-my-windows.nix b/pkgs/gnome-shell-extension-burn-my-windows.nix new file mode 100644 index 00000000..943975c9 --- /dev/null +++ b/pkgs/gnome-shell-extension-burn-my-windows.nix @@ -0,0 +1,47 @@ +{ lib, stdenv, bash, fetchFromGitHub, glib, gettext, zip, unzip }: + +# TODO: Deprecate this package once it is successfully packaged in nixpkgs. +stdenv.mkDerivation rec { + pname = "gnome-shell-extension-burn-my-windows"; + version = "2"; + + src = fetchFromGitHub { + owner = "Schneegans"; + repo = "Burn-My-Windows"; + rev = "v${version}"; + sha256 = "sha256-+8neRxlkNWdLDWAAZWK2iFfuvO0rq05orBTn18tWKf4="; + }; + + nativeBuildInputs = [ glib gettext ]; + buildInputs = [ zip ]; + skipConfigure = true; + + buildPhase = '' + # This will create the necessary files to be exported. + # And we'll use the generated zip file as a foundation for the output. + make SHELL=${bash}/bin/bash ${passthru.extensionUuid}.zip + ''; + + installPhase = let + extensionDir = + "$out/share/gnome-shell/extensions/${passthru.extensionUuid}"; + in '' + # Install the required extensions file. + mkdir -p ${extensionDir} + ${unzip}/bin/unzip ${passthru.extensionUuid}.zip -d ${extensionDir} + + # Install the GSchema. + install -Dm644 schemas/* -t "${ + glib.makeSchemaPath "$out" "${pname}-${version}" + }" + ''; + + passthru.extensionUuid = "burn-my-windows@schneegans.github.com"; + + meta = with lib; { + description = "A GNOME shell extension to disintegrate windows in the old-fashioned way"; + license = licenses.gpl3Plus; + homepage = "https://github.com/Schneegans/Burn-My-Windows"; + platforms = platforms.linux; + }; +}