nixos-open-lens/flake.nix
2022-12-03 21:41:35 -06:00

77 lines
2.4 KiB
Nix

{
description = "openlens";
inputs = {
nixpkgs = {
url = "nixpkgs/nixos-unstable";
};
flake-utils = {
url = "github:numtide/flake-utils";
};
};
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
};
in
{
packages = {
open-lens-from-binary =
let
pname = "open-lens";
version = "6.2.4";
name = "${pname}-${version}";
src = builtins.fetchurl {
url = "https://github.com/MuhammedKalkan/OpenLens/releases/download/v${version}/OpenLens-${version}.x86_64.AppImage";
sha256 = "sha256:19n8xpbir6jrv8qa1m4r8qjzdi21xyw83q2xirhjlikrjhrq68d1";
name = "${pname}.AppImage";
};
appimageContents = pkgs.appimageTools.extractType2 {
inherit name src;
};
in
pkgs.appimageTools.wrapType2 {
inherit name src;
extraInstallCommands = ''
mv $out/bin/${name} $out/bin/${pname}
install -m 444 -D ${appimageContents}/open-lens.desktop $out/share/applications/${pname}.desktop
install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/512x512/apps/open-lens.png \
$out/share/icons/hicolor/512x512/apps/${pname}.png
substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Icon=open-lens' 'Icon=${pname}' \
--replace 'Exec=AppRun' 'Exec=${pname}'
'';
meta = {
homepage = "";
description = "";
longDescription =
''
'';
};
};
open-lens-from-source =
let
version = "6.2.4";
in
pkgs.mkYarnPackage {
src = pkgs.fetchFromGitHub {
owner = "lensapp";
repo = "lens";
rev = "v${version}";
sha256 = "";
};
buildPhase = ''
make build
'';
};
};
}
);
}