commit 939360d819825cf2c1769d5b63eced9fcacde804
parent 43981181cd68f2f384d3b2569dc61dba356d2421
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date: Sat, 11 Jul 2020 16:08:13 +0300
Add keeweb
Diffstat:
2 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/pkgs/applications/keeweb/default.nix b/pkgs/applications/keeweb/default.nix
@@ -0,0 +1,67 @@
+{ stdenv, fetchfromgh, appimageTools }:
+let
+ inherit (stdenv.hostPlatform) system;
+ throwSystem = throw "Unsupported system: ${system}";
+
+ pname = "keeweb";
+ version = "1.15.5";
+ name = "${pname}-${version}";
+
+ suffix = {
+ x86_64-linux = "linux.AppImage";
+ x86_64-darwin = "mac.dmg";
+ }.${system} or throwSystem;
+
+ src = fetchfromgh {
+ owner = "keeweb";
+ repo = "keeweb";
+ version = "v${version}";
+ name = "KeeWeb-${version}.${suffix}";
+ sha256 = {
+ x86_64-linux = "1d4qx9yf7rgwb24d79c8gjx7i9vdic0mayw7vzwbdncpjd095i1v";
+ x86_64-darwin = "0cv2s6bvd8ybvxd7m9pvjzawryg1vwsq20h6xbqj4r7mgq09zwfc";
+ }.${system} or throwSystem;
+ };
+
+ appimageContents = appimageTools.extractType2 {
+ inherit name src;
+ };
+
+ meta = with stdenv.lib; {
+ description = "Free cross-platform password manager compatible with KeePass";
+ homepage = "https://keeweb.info/";
+ license = licenses.mit;
+ maintainers = with maintainers; [ sikmir ];
+ platforms = [ "x86_64-linux" "x86_64-darwin" ];
+ skip.ci = true;
+ };
+
+ linux = appimageTools.wrapType2 rec {
+ inherit name src meta;
+
+ extraInstallCommands = ''
+ mv $out/bin/{${name},${pname}}
+ install -Dm644 ${appimageContents}/keeweb.desktop -t $out/share/applications
+ install -Dm644 ${appimageContents}/keeweb.png -t $out/share/icons/hicolor/256x256/apps
+ install -Dm644 ${appimageContents}/usr/share/mime/keeweb.xml -t $out/share/mime
+ substituteInPlace $out/share/applications/keeweb.desktop \
+ --replace 'Exec=AppRun' 'Exec=${pname}'
+ '';
+ };
+
+ darwin = stdenv.mkDerivation {
+ inherit name src meta;
+
+ dontUnpack = true;
+
+ installPhase = ''
+ /usr/bin/hdiutil mount -nobrowse -mountpoint keeweb-mnt $src
+ mkdir -p $out/Applications
+ cp -r ./keeweb-mnt/KeeWeb.app $out/Applications
+ /usr/bin/hdiutil unmount keeweb-mnt
+ '';
+ };
+in
+if stdenv.isDarwin
+then darwin
+else linux
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -14,6 +14,7 @@ lib.makeScope newScope (
gpxsee = libsForQt5.callPackage ./applications/gpxsee {
inherit sources;
};
+ keeweb = callPackage ./applications/keeweb { };
librewolf = callPackage ./applications/librewolf { };
macpass = callPackage ./applications/macpass { };
mapsoft = callPackage ./applications/mapsoft { };