kakoune config

This commit is contained in:
Charlie Root 2024-07-16 11:13:12 +02:00
commit a920b04973
16 changed files with 174 additions and 156 deletions

101
flake.lock generated
View file

@ -439,10 +439,46 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_10": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_4"
},
"locked": {
"lastModified": 1698882062,
"narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8c9fa2545007b49a5db5f650ae91f227672c3877",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": { "flake-parts_2": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": {
"lastModified": 1719994518,
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": { "locked": {
"lastModified": 1715865404, "lastModified": 1715865404,
"narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=",
@ -457,7 +493,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_3": { "flake-parts_4": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"neovim-nightly-overlay", "neovim-nightly-overlay",
@ -478,7 +514,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_4": { "flake-parts_5": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"neovim-nightly-overlay", "neovim-nightly-overlay",
@ -499,7 +535,7 @@
"type": "indirect" "type": "indirect"
} }
}, },
"flake-parts_5": { "flake-parts_6": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"nixpak", "nixpak",
@ -520,7 +556,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_6": { "flake-parts_7": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"nixpkgs-wayland", "nixpkgs-wayland",
@ -542,7 +578,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_7": { "flake-parts_8": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"nixvim", "nixvim",
@ -563,7 +599,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_8": { "flake-parts_9": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"schizofox", "schizofox",
@ -584,24 +620,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_9": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_3"
},
"locked": {
"lastModified": 1698882062,
"narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8c9fa2545007b49a5db5f650ae91f227672c3877",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_3"
@ -873,7 +891,7 @@
}, },
"hercules-ci-effects": { "hercules-ci-effects": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_4", "flake-parts": "flake-parts_5",
"nixpkgs": [ "nixpkgs": [
"neovim-nightly-overlay", "neovim-nightly-overlay",
"nixpkgs" "nixpkgs"
@ -1216,7 +1234,7 @@
"lib-aggregate": { "lib-aggregate": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_5", "flake-utils": "flake-utils_5",
"nixpkgs-lib": "nixpkgs-lib_2" "nixpkgs-lib": "nixpkgs-lib_3"
}, },
"locked": { "locked": {
"lastModified": 1719749459, "lastModified": 1719749459,
@ -1291,7 +1309,7 @@
}, },
"neovim-flake": { "neovim-flake": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_3",
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_3",
"nil": "nil", "nil": "nil",
"nixpkgs": [ "nixpkgs": [
@ -1417,7 +1435,7 @@
"neovim-nightly-overlay": { "neovim-nightly-overlay": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
"flake-parts": "flake-parts_3", "flake-parts": "flake-parts_4",
"git-hooks": "git-hooks", "git-hooks": "git-hooks",
"hercules-ci-effects": "hercules-ci-effects", "hercules-ci-effects": "hercules-ci-effects",
"neovim-src": "neovim-src", "neovim-src": "neovim-src",
@ -1502,7 +1520,7 @@
}, },
"nix-eval-jobs": { "nix-eval-jobs": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_6", "flake-parts": "flake-parts_7",
"nix-github-actions": "nix-github-actions", "nix-github-actions": "nix-github-actions",
"nixpkgs": "nixpkgs_9", "nixpkgs": "nixpkgs_9",
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
@ -1576,7 +1594,7 @@
}, },
"nixpak": { "nixpak": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_5", "flake-parts": "flake-parts_6",
"hercules-ci-effects": "hercules-ci-effects_2", "hercules-ci-effects": "hercules-ci-effects_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
@ -1613,6 +1631,18 @@
} }
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": {
"lastModified": 1719876945,
"narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
}
},
"nixpkgs-lib_2": {
"locked": { "locked": {
"lastModified": 1714640452, "lastModified": 1714640452,
"narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=",
@ -1624,7 +1654,7 @@
"url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz"
} }
}, },
"nixpkgs-lib_2": { "nixpkgs-lib_3": {
"locked": { "locked": {
"lastModified": 1719708727, "lastModified": 1719708727,
"narHash": "sha256-XFNKtyirrGNdehpg7lMNm1skEcBApjqGhaHc/OI95HY=", "narHash": "sha256-XFNKtyirrGNdehpg7lMNm1skEcBApjqGhaHc/OI95HY=",
@ -1639,7 +1669,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib_3": { "nixpkgs-lib_4": {
"locked": { "locked": {
"dir": "lib", "dir": "lib",
"lastModified": 1698611440, "lastModified": 1698611440,
@ -1874,7 +1904,7 @@
"inputs": { "inputs": {
"devshell": "devshell", "devshell": "devshell",
"flake-compat": "flake-compat_5", "flake-compat": "flake-compat_5",
"flake-parts": "flake-parts_7", "flake-parts": "flake-parts_8",
"git-hooks": "git-hooks_2", "git-hooks": "git-hooks_2",
"home-manager": "home-manager_3", "home-manager": "home-manager_3",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
@ -3530,6 +3560,7 @@
"doom-emacs-config": "doom-emacs-config", "doom-emacs-config": "doom-emacs-config",
"doomemacs": "doomemacs", "doomemacs": "doomemacs",
"emacs-overlay": "emacs-overlay", "emacs-overlay": "emacs-overlay",
"flake-parts": "flake-parts_2",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"hyprland": "hyprland", "hyprland": "hyprland",
"hyprland-plugins": "hyprland-plugins", "hyprland-plugins": "hyprland-plugins",
@ -3578,7 +3609,7 @@
"schizofox": { "schizofox": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_7", "flake-compat": "flake-compat_7",
"flake-parts": "flake-parts_8", "flake-parts": "flake-parts_9",
"home-manager": "home-manager_4", "home-manager": "home-manager_4",
"nixpak": [ "nixpak": [
"nixpak" "nixpak"
@ -3606,7 +3637,7 @@
"searx-randomizer": { "searx-randomizer": {
"inputs": { "inputs": {
"crane": "crane", "crane": "crane",
"flake-parts": "flake-parts_9", "flake-parts": "flake-parts_10",
"nixpkgs": [ "nixpkgs": [
"schizofox", "schizofox",
"nixpkgs" "nixpkgs"

View file

@ -1,10 +1,13 @@
{ {
description = "My NixOS config flake"; description = "My NixOS config flake";
outputs = inputs @ {nixpkgs, ...}: { outputs = inputs: {
inherit (nixpkgs) lib; inherit (inputs.nixpkgs) lib;
nixosConfigurations = import ./hosts {inherit inputs;}; nixosConfigurations = import ./hosts {inherit inputs;};
}; };
inputs = { inputs = {
# what am I doing to this config help
flake-parts.url = "github:hercules-ci/flake-parts";
# Unstable nixpkgs baby! # Unstable nixpkgs baby!
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# nixpkgs for wayland # nixpkgs for wayland

View file

@ -88,7 +88,7 @@
editors = { editors = {
emacs = { emacs = {
enable = false; enable = false;
doom.enable = false; doom.enable = true;
}; };
helix.enable = true; helix.enable = true;
kakoune.enable = true; kakoune.enable = true;

View file

@ -7,6 +7,5 @@ _: {
../../../options/common/docs.nix ../../../options/common/docs.nix
../../../options/common/gpu/nvidia.nix ../../../options/common/gpu/nvidia.nix
../../../options/desktop/monitors.nix ../../../options/desktop/monitors.nix
../../../overlay.nix
]; ];
} }

View file

@ -1,16 +0,0 @@
# Taken from: https://github.com/hlissner/dotfiles/blob/master/lib/options.nix
{lib, ...}: let
inherit (lib) mkOption types;
in {
mkOpt = type: default: mkOption {inherit type default;};
mkOpt' = type: default: description:
mkOption {inherit type default description;};
mkBoolOpt = default:
mkOption {
inherit default;
type = types.bool;
example = true;
};
}

View file

@ -1,27 +0,0 @@
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.11";
pkgs = import nixpkgs {
config = {};
overlays = [];
};
in
pkgs.mkShellNoCC {
packages = with pkgs; [
m4
bison
ncurses
gcc
clang
gnat
zlib
flex
pkg-config
curl
zlib
coreboot-toolchain.x64
];
GREETING = "You're now in the coreboot build shell!;";
shellHook = ''cd /home/vali/repos/coreboot && echo $GREETING'';
}

View file

@ -8,7 +8,7 @@
}: }:
with lib; let with lib; let
cfg = config.modules.editors.emacs; cfg = config.modules.editors.emacs;
username = config.modules.other.system.username; inherit (config.modules.other.system) username;
repoUrl = inputs.doomemacs; repoUrl = inputs.doomemacs;
configRepoUrl = inputs.doom-emacs-config; configRepoUrl = inputs.doom-emacs-config;
emacs-desktop-symbol = pkgs.makeDesktopItem { emacs-desktop-symbol = pkgs.makeDesktopItem {
@ -24,18 +24,17 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
## Emacs itself as an overlay ## Emacs itself as an overlay
nixpkgs.overlays = [inputs.emacs-overlay.overlay]; #nixpkgs.overlays = [inputs.emacs-overlay.overlay];
services.emacs = {
enable = true;
package = pkgs.emacs29-pgtk;
};
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
binutils # native-comp needs 'as', provided by this binutils # native-comp needs 'as', provided by this
# 28.2 + native-comp
((emacsPackagesFor emacsNativeComp).emacsWithPackages
(epkgs: [epkgs.vterm]))
emacs-desktop-symbol emacs-desktop-symbol
## Doom dependencies ## Doom dependencies
git git
(ripgrep.override {withPCRE2 = true;}) ripgrep
gnutls # for TLS connectivity gnutls # for TLS connectivity
## Optional dependencies ## Optional dependencies
@ -45,20 +44,17 @@ in {
## Module dependencies ## Module dependencies
# :checkers spell # :checkers spell
(aspellWithDicts (ds: with ds; [en en-computers en-science])) (aspellWithDicts (ds: with ds; [en en-computers en-science de]))
# :tools editorconfig # :tools editorconfig
editorconfig-core-c # per-project style config editorconfig-core-c # per-project style config
# :tools lookup & :lang org +roam # :tools lookup & :lang org +roam
sqlite sqlite
# :lang latex & :lang org (latex previews) # :lang latex & :lang org (latex previews)
texlive.combined.scheme-medium
# :lang beancount # :lang beancount
beancount beancount
]; ];
home-manager.users.${username}.home.sessionPath = ["/home/vali/.config/emacs/bin"]; environment.variables.PATH = ["/home/vali/.config/emacs/bin"];
# modules.shell.zsh.rcFiles = [ "${configDir}/emacs/aliases.zsh" ];
fonts.fonts = [pkgs.emacs-all-the-icons-fonts]; fonts.fonts = [pkgs.emacs-all-the-icons-fonts];

View file

@ -1 +1,50 @@
_: {imports = [./kakoune.nix];} {
config,
lib,
pkgs,
}: let
inherit (config.modules.other.system) username;
cfg = config.modules.editors.kakoune;
inherit (lib) mkIf mkEnableOption;
in {
options.modules.editors.kakoune.enable = mkEnableOption "kakoune";
config.home-manager.users.${username}.programs.kakoune = mkIf cfg.enable {
enable = true;
config = {
autoComplete = true;
autoReload = true;
indentWidth = 4;
tabStop = 4;
incrementalSearch = false;
numberLines = {
enable = true;
relative = true;
highlightCursor = true;
separator = "|";
};
scrollOff = {
lines = 4;
columns = 4;
};
ui = {
enableMouse = true;
assistant = "none";
statusLine = "bottom";
wrapLines = {
enable = true;
indent = true;
word = true;
};
};
plugins = with pkgs.kakounePlugins; [
auto-pairs-kak
fzf-kak
powerline-kak
byline-kak
kakoune-lsp
];
};
};
}

View file

@ -12,7 +12,7 @@ local options = {
backspace = { 'indent', 'eol', 'start' }, -- backspace through everything in insert mode backspace = { 'indent', 'eol', 'start' }, -- backspace through everything in insert mode
hidden = true, -- Enable background buffers hidden = true, -- Enable background buffers
history = 100, -- Remember N lines in history history = 100, -- Remember N lines in history
lazyredraw = false, -- Faster scrolling if enabled, breaks noice lazyredraw = true, -- Faster scrolling if enabled, breaks noice
synmaxcol = 240, -- Max column for syntax highlight synmaxcol = 240, -- Max column for syntax highlight
updatetime = 250, -- ms to wait for trigger an event updatetime = 250, -- ms to wait for trigger an event

View file

@ -1,30 +1,30 @@
if vim.g.neovide then if vim.g.neovide then
local vks = vim.keymap.set local vks = vim.keymap.set
vim.g.neovide_scale_factor = 1.0 vim.g.neovide_scale_factor = 1.0
vim.g.minianimate_disable = true vim.g.minianimate_disable = true
vim.g.neovide_window_blurred = true vim.g.neovide_window_blurred = true
vim.g.neovide_transparency = 0.80 vim.g.neovide_transparency = 0.80
vim.g.neovide_show_border = true vim.g.neovide_show_border = true
vim.g.neovide_input_macos_alt_is_meta = true vim.g.neovide_input_macos_alt_is_meta = true
vim.g.neovide_cursor_animate_command_line = false -- noice incompat vim.g.neovide_cursor_animate_command_line = true -- noice incompat
vim.g.neovide_cursor_smooth_blink = true vim.g.neovide_cursor_smooth_blink = true
vim.g.neovide_cursor_vfx_mode = 'ripple' vim.g.neovide_cursor_vfx_mode = 'ripple'
-- keymaps -- keymaps
vks('v', '<D-c>', '"+y') -- Copy vks('v', '<D-c>', '"+y') -- Copy
vks({ 'n', 'v' }, '<D-v>', '"+P') -- Paste vks({ 'n', 'v' }, '<D-v>', '"+P') -- Paste
vks({ 'i', 'c' }, '<D-v>', '<C-R>+') -- Paste vks({ 'i', 'c' }, '<D-v>', '<C-R>+') -- Paste
vks('t', '<D-v>', [[<C-\><C-N>"+P]]) -- Paste vks('t', '<D-v>', [[<C-\><C-N>"+P]]) -- Paste
vks('n', '<D-+>', function() vks('n', '<D-+>', function()
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * 1.1 vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * 1.1
end) end)
vks('n', '<D-->', function() vks('n', '<D-->', function()
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor / 1.1 vim.g.neovide_scale_factor = vim.g.neovide_scale_factor / 1.1
end) end)
vks({ 'n', 'v', 't', 'i' }, '<D-}>', [[<C-\><C-N><Cmd>tabnext<CR>]]) vks({ 'n', 'v', 't', 'i' }, '<D-}>', [[<C-\><C-N><Cmd>tabnext<CR>]])
vks({ 'n', 'v', 't', 'i' }, '<D-{>', [[<C-\><C-N><Cmd>tabprev<CR>]]) vks({ 'n', 'v', 't', 'i' }, '<D-{>', [[<C-\><C-N><Cmd>tabprev<CR>]])
vks({ 'n', 'v', 't', 'i' }, '<D-l>', [[<C-\><C-N><Cmd>tabnext #<CR>]]) vks({ 'n', 'v', 't', 'i' }, '<D-l>', [[<C-\><C-N><Cmd>tabnext #<CR>]])
vks({ 'n', 'v', 't', 'i' }, '<D-t>', [[<C-\><C-N><Cmd>tabnew<CR>]]) vks({ 'n', 'v', 't', 'i' }, '<D-t>', [[<C-\><C-N><Cmd>tabnew<CR>]])
vks({ 'n', 'v', 't', 'i' }, '<D-w>', [[<C-\><C-N><Cmd>tabclose<CR>]]) vks({ 'n', 'v', 't', 'i' }, '<D-w>', [[<C-\><C-N><Cmd>tabclose<CR>]])
end end

View file

@ -1,12 +1,12 @@
local noice = require('noice') --local noice = require('noice')
local no_top_text = { local no_top_text = {
opts = { opts = {
border = { border = {
text = { top = '' }, text = { top = '' },
},
}, },
},
} }
--[[
-- luacheck: ignore -- luacheck: ignore
noice.setup({ noice.setup({
cmdline = { cmdline = {
@ -18,7 +18,6 @@ noice.setup({
search_up = no_top_text, search_up = no_top_text,
}, },
}, },
lsp = { lsp = {
override = { override = {
['cmp.entry.get_documentation'] = true, ['cmp.entry.get_documentation'] = true,
@ -70,3 +69,4 @@ noice.setup({
}, },
}, },
}) })
--]]

View file

@ -7,7 +7,7 @@
in { in {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
ui = { ui = {
noice.enable = true; noice.enable = false;
colorizer.enable = true; colorizer.enable = true;
modes-nvim.enable = true; modes-nvim.enable = true;
illuminate.enable = true; illuminate.enable = true;

View file

@ -6,7 +6,7 @@
inputs, inputs,
... ...
}: let }: let
inherit (builtins) filter map toString path isPath throw; inherit (builtins) filter map toString path;
inherit (lib.filesystem) listFilesRecursive; inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix fileContents; inherit (lib.strings) hasSuffix fileContents;
inherit (lib.attrsets) genAttrs; inherit (lib.attrsets) genAttrs;
@ -64,17 +64,19 @@ in {
}; };
additionalRuntimePaths = [ additionalRuntimePaths = [
(mkRuntimeDir "after") #(mkRuntimeDir "after")
(mkRuntimeDir "spell") #(mkRuntimeDir "spell")
./runtime/spell
./runtime/after
]; ];
# while I should be doing this in luaConfigRC below # while I should be doing this in luaConfigRC below
# I have come to realise that spellfile contents are # I have come to realise that spellfile contents are
# actually **not** loaded when luaConfigRC is used. # actually **not** loaded when luaConfigRC is used.
# as spellfile is a vim thing, this should be fine # as spellfile is a vim thing, this should be fine
configRC.spellfile = entryAnywhere '' # configRC.spellfile = entryAnywhere ''
set spellfile=${toString ./spell/runtime/en.utf-8.add} " toString sanitizes the path # set spellfile=${toString ./runtime/spell/en.utf-8.add} " toString sanitizes the path
''; # '';
# additional lua configuration that I can append # additional lua configuration that I can append
# or, to be more precise, randomly inject into # or, to be more precise, randomly inject into

View file

@ -1,19 +0,0 @@
{
inputs,
outputs,
...
}: let
add_nur = self: super: {
# nur-no-pkgs = import inputs.nur-no-pkgs { pkgs = inputs.nixpkgs.legacyPackages.${profile-config.system}; nurpkgs = inputs.nixpkgs.legacyPackages.${profile-config.system}; };
nur = import inputs.nur {
pkgs = import inputs.nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
}; # .legacyPackages.${profile-config.system};
nurpkgs = import inputs.nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
}; # .legacyPackages.${profile-config.system};
};
};
in {nixpkgs.overlays = [add_nur];}

0
parts/lib/builders.nix Normal file
View file