feat: add flake support

This commit is contained in:
Louis Dalibard 2024-07-10 12:56:51 +02:00
parent 2421243d4f
commit 3f45817648

View File

@ -1,53 +0,0 @@
{ lib, config, pkgs, ... }:
let
libs = with pkgs; [
libGL pkg-config xorg.libX11.dev xorg.libXcursor xorg.libXi xorg.libXinerama xorg.libXrandr xorg.libXxf86vm
];
in
{
environment.systemPackages = with pkgs; [(buildGoModule rec {
pname = "adam-gui";
version = "0.0.1";
buildInputs = [ gcc go ] ++ libs;
nativeBuildInputs = with pkgs; [ pkg-config addOpenGLRunpath makeWrapper ];
subPackages = [ "." ];
src = fetchFromGitea {
domain = "git.ontake.dev";
owner = "go";
repo = "adam-gui";
rev = "a64eabcfd4a85d2a3fe3e88c8f668af2c4db741d";
hash = "sha256-igJie5yYj7LndBGd5XA7GU0qWalrK5j+YM0hCFunXVY=";
};
vendorHash = null;
meta = with lib; {
description = "A simple GUI for ADAM branded scales";
homepage = "https://git.ontake.dev/go/adam-gui";
license = licenses.gpl3;
maintainers = [ ];
platforms = platforms.linux;
};
postInstall = ''
wrapProgram "$out/bin/adam-gui" \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath libs}
'';
postFixup = ''
addOpenGLRunpath $out/bin/adam-gui
'';
}) (makeDesktopItem {
name = "ADAM GUI";
desktopName = "ADAM GUI";
exec = "adam-gui";
icon = "adam-gui";
comment = "A simple GUI for ADAM branded scales.";
categories = ["Science" "Utility"];
})];
}