kakoune/flake.nix

53 lines
1.3 KiB
Nix
Raw Normal View History

2023-10-11 19:35:55 +02:00
{
description = "kakoune (patch)";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (sys:
let
pkgs = nixpkgs.legacyPackages.${sys};
clang = pkgs.clang_15;
2023-10-11 19:35:55 +02:00
kak = pkgs.stdenv.mkDerivation rec {
2023-10-11 19:47:51 +02:00
pname = "kak";
2023-10-12 12:44:05 +02:00
version = "dev";
2023-10-11 19:35:55 +02:00
src = ./. ;
makeFlags = [ "debug=no" "PREFIX=${placeholder "out"}" ];
nativeBuildInputs = [ clang ];
2023-10-11 19:35:55 +02:00
preConfigure = ''
export version="v${version}"
'';
enableParallelBuilding = true;
doInstallCheck = true;
installCheckPhase = ''
$out/bin/kak -ui json -e "kill 0"
'';
postInstall = ''
# make share/kak/autoload a directory, so we can use symlinkJoin with plugins
cd "$out/share/kak"
autoload_target=$(readlink autoload)
rm autoload
mkdir autoload
ln -s --relative "$autoload_target" autoload
2023-10-11 19:59:16 +02:00
cat <<EOF >> kakrc
set-option -add global ui_options terminal_assistant=cat
2023-10-11 19:59:16 +02:00
EOF
2023-10-11 19:35:55 +02:00
'';
};
in rec {
packages.kak = kak;
2023-10-11 19:47:51 +02:00
packages.default = kak;
2024-02-08 18:21:42 +01:00
devShells.default = pkgs.mkShell {
packages = [ clang ];
2024-02-08 18:21:42 +01:00
};
2023-10-11 19:35:55 +02:00
}
);
}