From e488195ffa0a5ad3aaadab823592a4f2d6ea955a Mon Sep 17 00:00:00 2001 From: xenia Date: Wed, 11 Oct 2023 19:35:55 +0200 Subject: [PATCH] Add flake files --- flake.lock | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 43 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..1908e05e --- /dev/null +++ b/flake.lock @@ -0,0 +1,59 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1696757521, + "narHash": "sha256-cfgtLNCBLFx2qOzRLI6DHfqTdfWI+UbvsKYa3b3fvaA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2646b294a146df2781b1ca49092450e8a32814e1", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..c54b3a0c --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + 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}; + kak = pkgs.stdenv.mkDerivation rec { + pname = "kakoune"; + version = "2022.10.31"; + src = ./. ; + makeFlags = [ "debug=no" "PREFIX=${placeholder "out"}" ]; + + 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 + ''; + }; + in rec { + packages.kak = kak; + packages.default = packages.kak; + } + ); +}