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 { };
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 { };
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 { };
}

View File

@ -1,8 +1,5 @@
{ lib, stdenv, fetchFromGitHub, glib, nodePackages }:
let
INSTALLBASE = "$out/share/gnome-shell/extensions";
in
stdenv.mkDerivation rec {
pname = "gnome-shell-extension-pop-shell";
version = "unstable-2021-11-30";
@ -17,22 +14,24 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ glib nodePackages.typescript ];
skipConfigure = true;
# Rather than patching the installation, we can create our own easily.
installPhase = ''
mkdir -p ${INSTALLBASE}/${passthru.extensionUuid}
cp -r _build/* ${INSTALLBASE}/${passthru.extensionUuid}/
makeFlags = [
"INSTALLBASE=$(out)/share/gnome-shell/extensions"
"PLUGIN_BASE=$(out)/lib/pop-shell/launcher"
"SCRIPTS_BASE=$(out)/lib/pop-shell/scripts"
"UUID=${passthru.extensionUuid}"
];
# TODO: Uncomment once custom gsettings works.
# 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
postInstall = ''
install -Dm644 $out/share/gnome-shell/extensions/${passthru.extensionUuid}/schemas/* -t "${glib.makeSchemaPath "$out" "${pname}-${version}"}"
# Export the custom GSettings schema.
install -Dm644 _build/schemas/* -t $out/share/glib-2.0/schemas
# TODO: Uncomment once custom gsettings works.
# 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";
@ -41,5 +40,6 @@ stdenv.mkDerivation rec {
description = "A keyboard-driven layer for GNOME shell";
license = licenses.gpl3;
homepage = "https://github.com/pop-os/shell";
platforms = platforms.linux;
};
}

View File

@ -23,7 +23,8 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "sha256-qzlZ0dbdfZwEBuQXIUndVFye6RdX8aI39D/UCagMfZg=";
meta = with lib; {
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;
};
}

View File

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