From 45c7a57f8cf2b3ccd5f02251e709ce87351a5834 Mon Sep 17 00:00:00 2001 From: Soussi Mohamed Nour <88513682+ByteSudoer@users.noreply.github.com> Date: Sun, 15 Dec 2024 19:33:20 +0100 Subject: [PATCH] sleek-todo: init at 2.0.14 (#347525) sleek: init at 2.0.14 Co-authored-by: ByteSudoer --- pkgs/by-name/sl/sleek-todo/package.nix | 79 ++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 pkgs/by-name/sl/sleek-todo/package.nix diff --git a/pkgs/by-name/sl/sleek-todo/package.nix b/pkgs/by-name/sl/sleek-todo/package.nix new file mode 100644 index 000000000000..84436b9a732a --- /dev/null +++ b/pkgs/by-name/sl/sleek-todo/package.nix @@ -0,0 +1,79 @@ +{ + lib, + stdenv, + fetchurl, + undmg, + appimageTools, + +}: + +let + + pname = "sleek-todo"; + version = "2.0.14"; + + src = + fetchurl + { + x86_64-darwin = { + url = "https://github.com/ransome1/sleek/releases/download/v${version}/sleek-2.0.14-mac-x64.dmg"; + hash = "sha256-f5mMSRa+gAoakOy9TSZeALqCylGLd0nUJIh8o+LWAro="; + }; + x86_64-linux = { + url = "https://github.com/ransome1/sleek/releases/download/v${version}/sleek-2.0.14.AppImage"; + hash = "sha256-d2fLsCI7peuNBtjgHs1qumgPAF9eJeBYiIIffoSv9Jk="; + }; + } + .${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.system}"); + + meta = { + description = "Todo manager based on todo.txt syntax"; + homepage = "https://github.com/ransome1/sleek"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ ByteSudoer ]; + mainProgram = "sleek-todo"; + platforms = [ + "x86_64-linux" + "x86_64-darwin" + ]; + }; + appimageContents = appimageTools.extract { inherit pname version src; }; +in +if stdenv.hostPlatform.isDarwin then + stdenv.mkDerivation { + inherit + pname + version + src + meta + ; + + sourceRoot = "."; + nativeBuildInputs = [ undmg ]; + + installPhase = '' + runHook preInstall + mkdir -p $out/Applications + cp -r *.app $out/Applications/ + runHook postInstall + ''; + } +else + appimageTools.wrapType2 { + inherit + pname + version + src + meta + ; + + extraInstallCommands = '' + mkdir -p $out/share/{applications,sleek} + cp -a ${appimageContents}/{locales,resources} $out/share/sleek + cp -a ${appimageContents}/usr/share/icons $out/share + install -Dm 444 ${appimageContents}/sleek.desktop $out/share/applications + substituteInPlace $out/share/applications/sleek.desktop \ + --replace-warn 'Exec=AppRun' 'Exec=${pname}' + ''; + + }