2022-03-30 09:31:56 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, electron
|
|
|
|
, makeWrapper
|
|
|
|
, copyDesktopItems
|
|
|
|
, makeDesktopItem
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nix-tour";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "unstable-2022-01-03";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nixcloud";
|
|
|
|
repo = "tour_of_nix";
|
|
|
|
rev = "6a6784983e6dc121574b97eb9b1d03592c8cb9a7";
|
|
|
|
sha256 = "sha256-BhQz59wkwwY0ShXzqUD6MQl4NE/jUik5RbLzseEc5Bc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper copyDesktopItems ];
|
|
|
|
buildInputs = [ electron ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2022-03-30 09:31:56 +00:00
|
|
|
install -d $out/bin $out/share/nix-tour
|
|
|
|
cp -R * $out/share/nix-tour
|
|
|
|
makeWrapper ${electron}/bin/electron $out/bin/nix-tour \
|
|
|
|
--add-flags $out/share/nix-tour/electron-main.js
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = pname;
|
|
|
|
desktopName = "Tour of Nix";
|
|
|
|
genericName = "Tour of Nix";
|
|
|
|
comment =
|
|
|
|
"Interactive programming guide dedicated to the nix programming language";
|
|
|
|
categories = [ "Development" "Documentation" ];
|
|
|
|
exec = "nix-tour";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "'the tour of nix' from nixcloud.io/tour as offline version";
|
|
|
|
homepage = "https://nixcloud.io/tour";
|
|
|
|
license = licenses.gpl2;
|
2022-03-30 09:31:56 +00:00
|
|
|
maintainers = with maintainers; [ qknight yuu ];
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "nix-tour";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|