README changes, moved a bunch of files

This commit is contained in:
Charlie Root 2024-05-21 00:45:04 +02:00
commit 33b019e140
12 changed files with 72 additions and 782 deletions

View file

@ -1 +0,0 @@
_: { imports = [ ./emacs.nix ]; }

View file

@ -1,23 +0,0 @@
{ config, lib, pkgs, inputs, ... }:
with lib;
let
cfg = config.modules.programs.emacs;
username = config.modules.other.system.username;
in {
options.modules.programs.emacs.enable = mkEnableOption "emacs";
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.doom-emacs = {
enable = true;
extraConfig = ''
(setq standard-indent 2)
(require 'evil)
(evil-mode 1)
'';
doomPrivateDir = ./doom.d;
};
};
};
}

View file

@ -1,74 +0,0 @@
{ config, lib, inputs, pkgs, ... }:
with lib;
let
username = config.modules.other.system.username;
cfg = config.modules.programs.firefox;
in {
options.modules.programs.firefox = {
enable = mkEnableOption "firefox";
extensions = mkOption {
description =
"firefox extensions (format like https://discourse.nixos.org/t/declare-firefox-extensions-and-settings/36265)";
type = types.attrs;
default = { };
};
};
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.firefox = {
enable = true;
policies = {
DisableTelemetry = true;
DisableFirefoxStudies = true;
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
DisablePocket = true;
DisableFirefoxAccounts = true;
DisableAccounts = true;
DisableFirefoxScreenshots = true;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
DontCheckDefaultBrowser = true;
DisplayBookmarksToolbar =
"never"; # alternatives: "always" or "newtab"
DisplayMenuBar =
"default-off"; # alternatives: "always", "never" or "default-on"
SearchBar = "unified"; # alternative: "separate"
FirefoxSuggest = {
WebSuggestions = true;
ImproveSuggest = true;
Locked = true;
};
SearchSuggestEnabled = true;
theme = {
colors = {
background-darker = "181825";
background = "1e1e2e";
foreground = "cdd6f4";
};
};
OfferToSaveLogins = false;
font = "Lexend";
ExtensionSettings = lib.mkMerge [
{
"uBlock0@raymondhill.net" = {
install_url =
"https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
};
}
cfg.extensions
];
};
};
};
};
}

View file

@ -1,124 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.programs.kakoune;
username = config.modules.other.system.username;
# inherit (inputs.kakoune.packages.${pkgs.system}) kakoun;
in {
options.modules.programs.kakoune.enable = mkEnableOption "kakoune";
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.kakoune = {
enable = true;
# extraConfig = builtins.readFile
# package = kakoun;
plugins = with pkgs.kakounePlugins; [
auto-pairs-kak
fzf-kak
powerline-kak
byline-kak
kakoune-lsp
# luar-kak
];
config = {
ui = {
statusLine = "top";
enableMouse = true;
assistant = "none";
};
# numberLines.enable = true;
# numberLines.relative = true;
# numberLines.highlightCursor = true;
# numberLines.separator = " ";
# showMatching = true;
# indentWidth = 2;
# tabStop = 2;
scrollOff.lines = 1;
scrollOff.columns = 3;
keyMappings = [
{
mode = "normal";
key = "<esc>";
effect = ";,";
docstring =
"Press escape to clear highlighted text and collapse cursors";
}
{
mode = "normal";
key = "<c-v>";
effect = ":comment-line<ret>";
docstring = "Comment a line with <c-v>!";
}
{
mode = "normal";
key = "b";
effect = ":db<ret>";
docstring = "close current buffer";
}
{
mode = "normal";
key = "n";
effect = ":bp<ret>";
docstring = "go to next buffer";
}
{
mode = "normal";
key = "m";
effect = ":bn<ret>";
docstring = "go to next buffer";
}
{
mode = "normal";
key = " f";
effect = ":fzf-mode<ret>";
docstring = "open fzf";
}
];
};
extraConfig = ''
# display line numbers
add-highlighter global/ number-lines -hlcursor -relative -separator " " -cursor-separator " |"
# show matching symbols
add-highlighter global/ show-matching
# Intenting
set-option global tabstop 4
set-option global indentwidth 4
# Scrolloff
set-option global scrolloff 8,3
# spellcheck (requires aspell)
map -docstring "check document for spelling" global user w ": spell<ret>"
map -docstring "clear document spelling" global user q ": spell-clear<ret>"
plug "alexherbo2/auto-pairs.kak" config %{
enable-auto-pairs
}
plug "andreyorst/fzf.kak" config %{
require-module fzf
require-module fzf-grep
require-module fzf-file
} defer fzf %{
set-option global fzf_highlight_command "lat -r {}"
} defer fzf-file %{
set-option global fzf_file_command "fd . --no-ignore-vcs"
} defer fzf-grep %{
set-option global fzf_grep_command "fd"
}
plug "andreyorst/powerline.kak" defer kakoune-themes %{
powerline-theme pastel
} defer powerline %{
powerline-format global "git lsp bufname filetype mode_info lsp line_column position"
set-option global powerline_separator_thin ""
set-option global powerline_separator ""
} config %{
powerline-start
}
plug "evanrelf/byline.kak" config %{
require-module "byline"
}
'';
};
};
};
}

View file

@ -1 +0,0 @@
_: { imports = [ ./kakoune.nix ]; }

View file

@ -1,18 +0,0 @@
[language.haskell]
filetypes = ["haskell"]
roots = ["Setup.hs", "stack.yaml", "*.cabal"]
command = "haskell-language-server-wrapper"
args = ["--lsp"]
[language.rust]
filetypes = ["rust"]
roots = ["Cargo.toml"]
command = "rust-analyzer"
settings_section = "rust-analyzer"
[language.rust.settings.rust-analyzer]
"proMacro.enable" = true
[language.nix]
filetypes = ["nix"]
roots = ["shell.nix", "default.nix", "home.nix", "flake.nix"]
command = "rnix-lsp"

View file

@ -1,131 +0,0 @@
{ config, lib, pkgs, buildGoModule, ... }:
with lib;
let
cfg = config.modules.programs.kakoune;
username = config.modules.other.system.username;
kakship = pkgs.rustPlatform.buildRustPackage rec {
pname = "kakship";
version = "0.2.8";
src = pkgs.fetchFromGitHub {
owner = "mesabloo";
repo = "kakship";
rev = "937d904a893daf59f70dc955e60209cd8866a7c3";
sha256 = "1pk0v0b31bppjzl08qgrjld40pc7rqc257zzgdl4r8zaamqsmkz9";
};
cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes = {
"kak-0.1.2" = "sha256-RhtHQkC9yCSJtr/kbC5c9MavbL79acrsiEGXyoAST8U=";
"yew-ansi-0.1.0" =
"sha256-dSaEzqiOon+OqCZKQudzLRNP+Iv97kC+XZcTElKNrzs=";
};
};
# patchPhase = ''
# substituteInPlace src/main.rs \
# --replace '"starship"' "\"${pkgs.starship}/bin/starship\""
# '';
postInstall = ''
# Copy rc files to /share/kak/autoload
mkdir -p $out/share/kak/autoload/plugins/${pname}
cp $src/rc/*.kak $out/share/kak/autoload/plugins/${pname}
'';
};
kak-rainbow = pkgs.kakouneUtils.buildKakounePluginFrom2Nix rec {
pname = "kak-rainbow";
version = "1.0.0";
src = pkgs.fetchFromGitHub {
owner = "Bodhizafa";
repo = "kak-rainbow";
rev = "9c3d0aa62514134ee5cb86e80855d9712c4e8c4b";
sha256 = "sha256-ryYq4A89wVUsxgvt4YqBPXsTFMDrMJM6BDBEHrWHD1c=";
};
postInstall = ''
mkdir -p $out/lib
mv $out/share/kak/autoload/plugins/${pname}/rainbow.kak $out/lib
cat >$out/share/kak/autoload/plugins/${pname}/rainbow.kak <<EOF
provide-module rainbow %{
source $out/lib/rainbow.kak
}
EOF
'';
};
kks = pkgs.buildGoModule rec {
pname = "kks";
version = "8113ea3";
src = pkgs.fetchFromGitHub {
owner = "kkga";
repo = pname;
rev = "8113ea3bd718dec88b812faa1a41bacba0110fd7";
sha256 = "sha256-/0ocgWArELGQkOZqbYRljPnzM/zQ9HCZq7gqhMD0Mq4=";
};
vendorHash = "sha256-E4D9FGTpS9NkZy6tmnuI/F4dnO9bv8MVaRstxVPvEfo=";
doCheck = false;
meta = with lib; {
description = "Handy Kakoune companion.";
homepage = "https://github.com/kkga/kks";
license = licenses.unfree;
maintainers = with maintainers; [ kalbasit ];
};
};
kak-alacritty = pkgs.kakouneUtils.buildKakounePluginFrom2Nix rec {
pname = "alacritty.kak";
version = "10025b8";
src = pkgs.fetchFromGitHub {
owner = "Lokasku";
repo = pname;
rev = "66b0d2e2451c01719262effd008c40614427bb35";
sha256 = "sha256-Ibjs6dCU8/XEjUoWNB5a8R4QW7z8w6cFBSxd7UvZrxE=";
};
};
kakoune-snow = pkgs.kakouneUtils.buildKakounePluginFrom2Nix rec {
pname = "kakoune-snow";
version = "35f8187";
src = pkgs.fetchFromGitHub {
owner = "caksoylar";
repo = pname;
rev = "35f81876bcaea061982396f8071b89528940ae61";
sha256 = "";
};
};
# with lib;
in {
options.modules.programs.kakoune.enable = mkEnableOption "kakoune";
config = mkIf cfg.enable {
home-manager.users.${username} = { programs.kakoune.enable = true; };
environment.systemPackages = with pkgs; [
rust-analyzer
rustfmt # Rust LSP
kakship
kks
];
programs.kakoune = {
plugins = with pkgs.kakounePlugins; [
kakoune-lsp
fzf-kak
kak-rainbow
kak-alacritty
];
config = {
numberLines = {
enable = true;
# separator = "|";
};
scrollOff = {
columns = 15;
lines = 15;
};
};
extraConfig = builtins.readFile ./kakrc;
};
xdg.configFile."kak/starship.toml".source = ./starship.toml;
xdg.configFile."kak-lsp/kak-lsp.toml".source = ./kak-lsp.toml;
};
}

View file

@ -1,88 +0,0 @@
# --- kks
eval %sh{ kks init }
# --- kak-lsp
eval %sh{kak-lsp --kakoune -s $kak_session}
hook global WinCreate .* %{
lsp-inlay-hints-enable window
lsp-auto-signature-help-enable
}
hook global WinSetOption filetype=(nix|haskell) %{
lsp-enable-window
}
set-option global lsp_completion_trigger "execute-keys 'h<a-h><a-k>\S[^\h\n,=;*(){}\[\]]\z<ret>'"
set-option global lsp_diagnostic_line_error_sign "!"
set-option global lsp_diagnostic_line_warning_sign "?"
hook global WinSetOption filetype=(rust) %{
map window user "l" ':enter-user-mode lsp<ret>' -docstring "LSP mode"
lsp-enable-window
lsp-auto-hover-insert-mode-disable
set-option window lsp_hover_anchor true
set-face window DiagnosticError default+u
set-face window DiagnosticWarning default+u
set-option window lsp_server_configuration rust.clippy_preference="on"
}
# hook global WinSetOption filetype=rust %{
# lsp-enable-window hook window BufWritePre .* lsp-formatting-sync
# hook window -group rust-inlay-hints BufWritePost .* rust-analyzer-inlay-hints
# hook -once -always window WinSetOption filetype=.* %{
# remove-hooks window rust-inlay-hints
# }
# }
map global normal <a-d> ':lsp-definition<ret>'
# --- kakoune-rainbow
hook global ModuleLoaded rainbow %{
set-option global rainbow_colors rgb:FF3B2F+db rgb:FF9500+db rgb:FFCC02+db rgb:27cd41+db rgb:007AFF+db rgb:AF52DE+db
hook global WinSetOption filetype=(rust|python|c|cpp|scheme|lisp|clojure|javascript|json|kak|haskell|python|latex|nix) %{
rainbow-enable-window
}
}
# --- alacritty.kak
hook global ModuleLoaded x11 %{
alias global terminal kitty-terminal
alias global popup alacritty-terminal-popup
}
# --- Kakship
hook global ModuleLoaded kakship %{
kakship-enable
}
# --- Broot
define-command -override broot-oneoff-select -docstring 'focus broot' %{
evaluate-commands %sh{
d="$(dirname "$kak_buffile")"
b="$(basename "$kak_buffile")"
echo echo -debug "$d"
broot_cmd="broot"
if [ -d "$d" ]; then
broot_cmd="$broot_cmd --cmd \":focus $d;:select $b\""
fi
echo "kks-connect ala-popup sh -c '""kks send edit $broot_cmd""'"
}
}
define-command ala-popup -params .. -shell-completion -docstring 'alacritty-terminal-popup <program> [arguments]: create a new terminal as an Alacritty window (class: popup, app_id: popup)' %{
nop %sh{
setsid alacritty -o window.dimensions.columns=200 window.dimensions.lines=57 --title popup --class 'alacritty-popup' --command "$@" < /dev/null > /dev/null 2>&1 &
}
}
# --- Map
map global normal <c-f> ':fzf-mode<ret>f<ret>'
map global normal <c-t> ':alacritty-popup<ret>'
require-module fzf
set-option global fzf_terminal_command 'ala-popup kak -c %val{session} -e "%arg{@}"'
require-module alacritty
require-module rainbow

View file

@ -1,20 +0,0 @@
# add_newline = false
format = """
\$directory
\${custom.separator}
"""
[directory]
format = '[$path/]($style)'
truncate_length = 2
truncate_to_repo = false
use_logical_pat = true
style = "fg:cyan"
truncate_symbol = "../"
disabled = false
[custom.separator]
format = "[ ||| ]($style)"
style = "fg:purple"
disabled = false