Reformat and refactor the packages

This commit is contained in:
Gabriel Arazas 2021-12-06 15:28:29 +08:00
parent 3a022a374a
commit b8818e04c1
4 changed files with 25 additions and 24 deletions

View File

@ -2,9 +2,11 @@
{ {
doggo = pkgs.callPackage ./doggo.nix { }; doggo = pkgs.callPackage ./doggo.nix { };
gnome-shell-extension-pop-shell = pkgs.callPackage ./gnome-shell-extension-pop-shell.nix { }; gnome-shell-extension-pop-shell =
pkgs.callPackage ./gnome-shell-extension-pop-shell.nix { };
libcs50 = pkgs.callPackage ./libcs50.nix { }; libcs50 = pkgs.callPackage ./libcs50.nix { };
pop-launcher = pkgs.callPackage ./pop-launcher.nix { }; pop-launcher = pkgs.callPackage ./pop-launcher.nix { };
pop-launcher-plugin-duckduckgo-bangs = pkgs.callPackage ./pop-launcher-plugin-duckduckgo-bangs.nix { }; pop-launcher-plugin-duckduckgo-bangs =
pkgs.callPackage ./pop-launcher-plugin-duckduckgo-bangs.nix { };
tic-80 = pkgs.callPackage ./tic-80.nix { }; tic-80 = pkgs.callPackage ./tic-80.nix { };
} }

View File

@ -1,8 +1,5 @@
{ lib, stdenv, fetchFromGitHub, glib, nodePackages }: { lib, stdenv, fetchFromGitHub, glib, nodePackages }:
let
INSTALLBASE = "$out/share/gnome-shell/extensions";
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "gnome-shell-extension-pop-shell"; pname = "gnome-shell-extension-pop-shell";
version = "unstable-2021-11-30"; version = "unstable-2021-11-30";
@ -17,22 +14,24 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ glib nodePackages.typescript ]; nativeBuildInputs = [ glib nodePackages.typescript ];
skipConfigure = true; skipConfigure = true;
# Rather than patching the installation, we can create our own easily. makeFlags = [
installPhase = '' "INSTALLBASE=$(out)/share/gnome-shell/extensions"
mkdir -p ${INSTALLBASE}/${passthru.extensionUuid} "PLUGIN_BASE=$(out)/lib/pop-shell/launcher"
cp -r _build/* ${INSTALLBASE}/${passthru.extensionUuid}/ "SCRIPTS_BASE=$(out)/lib/pop-shell/scripts"
"UUID=${passthru.extensionUuid}"
];
# TODO: Uncomment once custom gsettings works. postInstall = ''
# Unfortunately custom gsettings seems to be not properly integrated with NixOS yet. install -Dm644 $out/share/gnome-shell/extensions/${passthru.extensionUuid}/schemas/* -t "${glib.makeSchemaPath "$out" "${pname}-${version}"}"
#
# For more information, please track the following issue:
# https://github.com/NixOS/nixpkgs/issues/92265
#
# It also contains additional links to related issues and whatnot.
#install -Dm644 keybindings/*.xml -t $out/share/gnome-control-center/keybindings
# Export the custom GSettings schema. # TODO: Uncomment once custom gsettings works.
install -Dm644 _build/schemas/* -t $out/share/glib-2.0/schemas # Unfortunately custom gsettings seems to be not properly integrated with NixOS yet.
#
# For more information, please track the following issue:
# https://github.com/NixOS/nixpkgs/issues/92265
#
# It also contains additional links to related issues and whatnot.
#install -Dm644 keybindings/*.xml -t $out/share/gnome-control-center/keybindings
''; '';
passthru.extensionUuid = "pop-shell@system76.com"; passthru.extensionUuid = "pop-shell@system76.com";
@ -41,5 +40,6 @@ stdenv.mkDerivation rec {
description = "A keyboard-driven layer for GNOME shell"; description = "A keyboard-driven layer for GNOME shell";
license = licenses.gpl3; license = licenses.gpl3;
homepage = "https://github.com/pop-os/shell"; homepage = "https://github.com/pop-os/shell";
platforms = platforms.linux;
}; };
} }

View File

@ -23,7 +23,8 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "sha256-qzlZ0dbdfZwEBuQXIUndVFye6RdX8aI39D/UCagMfZg="; cargoSha256 = "sha256-qzlZ0dbdfZwEBuQXIUndVFye6RdX8aI39D/UCagMfZg=";
meta = with lib; { meta = with lib; {
description = "Pop launcher for searching with Duckduckgo bangs"; description = "Pop launcher for searching with Duckduckgo bangs";
homepage = "https://github.com/foo-dogsquared/pop-launcher-plugin-duckduckgo-bangs"; homepage =
"https://github.com/foo-dogsquared/pop-launcher-plugin-duckduckgo-bangs";
license = licenses.gpl3; license = licenses.gpl3;
}; };
} }

View File

@ -1,9 +1,7 @@
{ lib, fetchFromGitHub, rustPlatform, pkg-config, openssl, gtk3 }: { lib, fetchFromGitHub, rustPlatform, pkg-config, openssl, gtk3 }:
let let distributionPluginPath = "$out/lib/pop-launcher";
distributionPluginPath = "$out/lib/pop-launcher"; in rustPlatform.buildRustPackage rec {
in
rustPlatform.buildRustPackage rec {
pname = "pop-launcher"; pname = "pop-launcher";
version = "1.1.0"; version = "1.1.0";