Damson/packaging/nix/default.nix
2026-12-02 16:25:56 -06:00

33 lines
1.4 KiB
Nix

# Damson for Nix, from the release tar.gz. Written by tools/package.sh (version and hash); edit the header there.
# nix build .#default or nix profile install . (from the repo), or callPackage this file.
{ lib, stdenv, fetchurl, autoPatchelfHook, makeWrapper, libGL, wayland, libxkbcommon, xorg, fontconfig, dbus }:
stdenv.mkDerivation rec {
pname = "damson";
version = "0.1.1";
src = fetchurl {
url = "https://astar76.com/git/astar76/Damson/releases/download/v${version}/Damson-${version}-Linux-x86_64.tar.gz";
hash = "sha256-c1405pFgYg2ozJ6TBAHWd+uTimjX/+TFBfqdmbOvXTk=";
};
nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
buildInputs = [ stdenv.cc.cc.lib ];
# Loaded with dlopen at run time, so autoPatchelf can't see them.
runtimeDependencies = [ libGL wayland libxkbcommon xorg.libX11 xorg.libXcursor xorg.libXi xorg.libXrandr fontconfig dbus ];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out
for d in bin lib share; do [ ! -d $d ] || cp -R $d $out/; done
install -Dm644 README.md $out/share/doc/damson/README.md
runHook postInstall
'';
meta = {
description = "Material You code editor with 462 languages built in";
homepage = "https://astar76.com/git/astar76/Damson";
license = lib.licenses.mit;
platforms = [ "x86_64-linux" ];
mainProgram = "damson";
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
};
}