From 6cfc8b3e4a9218dc7c370754eecfd7a5ceebd25c Mon Sep 17 00:00:00 2001 From: mat ess Date: Wed, 20 Jul 2022 22:19:32 -0400 Subject: [PATCH] Update kakoune config --- flake.lock | 17 +++++++++++++++++ flake.nix | 29 ++++++++++++++++++++++++----- home/kakoune.nix | 25 +++++++++++++++++++++++-- pkgs/dark-mode-notify.nix | 2 +- 4 files changed, 65 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index f723d57..055543f 100644 --- a/flake.lock +++ b/flake.lock @@ -89,6 +89,22 @@ "type": "github" } }, + "luar-src": { + "flake": false, + "locked": { + "lastModified": 1644781788, + "narHash": "sha256-vHn/V3sfzaxaxF8OpA5jPEuPstOVwOiQrogdSGtT6X4=", + "owner": "gustavo-hms", + "repo": "luar", + "rev": "2f430316f8fc4d35db6c93165e2e77dc9f3d0450", + "type": "github" + }, + "original": { + "owner": "gustavo-hms", + "repo": "luar", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1656782578, @@ -144,6 +160,7 @@ "flake-compat": "flake-compat", "flake-utils": "flake-utils", "home-manager": "home-manager", + "luar-src": "luar-src", "nixpkgs": "nixpkgs", "nixpkgs-master": "nixpkgs-master", "nixpkgs-unstable": "nixpkgs-unstable" diff --git a/flake.nix b/flake.nix index 7663762..515f8c6 100644 --- a/flake.nix +++ b/flake.nix @@ -14,29 +14,48 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs-unstable"; # Other sources - flake-compat = { url = github:edolstra/flake-compat; flake = false; }; flake-utils.url = github:numtide/flake-utils; + flake-compat = { + url = github:edolstra/flake-compat; + flake = false; + }; dark-mode-notify-src = { url = github:bouk/dark-mode-notify; flake = false; }; + + luar-src = { + url = github:gustavo-hms/luar; + flake = false; + }; }; outputs = { self, darwin, nixpkgs, home-manager, flake-utils, ... }@inputs: let inherit (darwin.lib) darwinSystem; - inherit (inputs.nixpkgs-unstable.lib) attrValues makeOverridable optional optionalAttrs singleton; + inherit (inputs.nixpkgs-unstable.lib) + attrValues + genAttrs + makeOverridable + optional + optionalAttrs + singleton; # Configuration for `nixpkgs` nixpkgsConfig = { config = { allowUnfree = true; }; overlays = attrValues self.overlays ++ singleton ( final: prev: - { - dark-mode-notify = final.callPackage ./pkgs/dark-mode-notify.nix { inherit (inputs) dark-mode-notify-src; }; - } // optionalAttrs + let + buildPkg = name: + final.callPackage + (./. + "/pkgs/${name}.nix") + { "${name}-src" = inputs."${name}-src"; }; + pkgs = [ "dark-mode-notify" "luar" ]; + in + genAttrs pkgs buildPkg // optionalAttrs (prev.stdenv.system == "aarch64-darwin") { # Sub in x86 version of packages that don't build on Apple Silicon yet diff --git a/home/kakoune.nix b/home/kakoune.nix index 7badc68..cdd01eb 100644 --- a/home/kakoune.nix +++ b/home/kakoune.nix @@ -1,6 +1,27 @@ -{ ... }: { +{ pkgs, ... }: { programs.kakoune = { enable = true; - config = { }; + config = { + numberLines = { + enable = true; + highlightCursor = true; + relative = true; + }; + ui = { + enableMouse = true; + }; + }; + plugins = with pkgs.kakounePlugins; [ + active-window-kak + auto-pairs-kak + fzf-kak + kak-lsp + kakboard + kakoune-state-save + kakoune-vertical-selection + # needs luar + pkgs.luar + tabs-kak + ]; }; } diff --git a/pkgs/dark-mode-notify.nix b/pkgs/dark-mode-notify.nix index bf74da8..fb3d721 100644 --- a/pkgs/dark-mode-notify.nix +++ b/pkgs/dark-mode-notify.nix @@ -2,10 +2,10 @@ , lib , xcodeenv , dark-mode-notify-src +, sdkVersion ? "13.4.1" , ... }: let - sdkVersion = "13.4.1"; xcode = xcodeenv.composeXcodeWrapper { version = sdkVersion; xcodeBaseDir = "/Applications/Xcode.app";