2022-03-10 16:15:04 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, electron
|
|
|
|
, runtimeShell
|
|
|
|
, makeWrapper
|
2022-03-15 18:04:15 +01:00
|
|
|
, copyDesktopItems
|
|
|
|
, makeDesktopItem
|
2022-03-10 16:15:04 +01:00
|
|
|
}:
|
2016-06-17 12:06:12 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "nix-tour";
|
2022-03-15 18:05:24 +01:00
|
|
|
version = "unstable-2022-01-03";
|
2016-06-17 12:06:12 +02:00
|
|
|
|
2022-03-15 11:32:16 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nixcloud";
|
|
|
|
repo = "tour_of_nix";
|
2022-03-15 18:05:24 +01:00
|
|
|
rev = "6a6784983e6dc121574b97eb9b1d03592c8cb9a7";
|
|
|
|
sha256 = "sha256-BhQz59wkwwY0ShXzqUD6MQl4NE/jUik5RbLzseEc5Bc=";
|
2016-06-17 12:06:12 +02:00
|
|
|
};
|
|
|
|
|
2022-03-15 18:04:15 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper copyDesktopItems ];
|
2022-03-10 16:15:04 +01:00
|
|
|
buildInputs = [ electron ];
|
|
|
|
|
2016-06-17 12:06:12 +02:00
|
|
|
installPhase = ''
|
2022-03-10 16:15:04 +01: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
|
2016-06-17 12:06:12 +02:00
|
|
|
'';
|
|
|
|
|
2022-03-15 18:04:15 +01: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-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2016-06-17 12:06:12 +02:00
|
|
|
description = "'the tour of nix' from nixcloud.io/tour as offline version";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://nixcloud.io/tour";
|
2016-06-17 12:06:12 +02:00
|
|
|
license = licenses.gpl2;
|
2022-03-10 16:15:04 +01:00
|
|
|
maintainers = with maintainers; [ qknight yuu ];
|
2024-02-11 03:19:15 +01:00
|
|
|
mainProgram = "nix-tour";
|
2016-06-17 12:06:12 +02:00
|
|
|
};
|
2018-05-28 14:59:57 +02:00
|
|
|
}
|