187 lines
5.1 KiB
Nix
187 lines
5.1 KiB
Nix
{ config, pkgs, unstablePkgs, lib, ... }:
|
|
|
|
let
|
|
aliasDrag = pkgs.writeScriptBin "drag" ''
|
|
${pkgs.ripdrag}/bin/ripdrag -Axd $@
|
|
'';
|
|
in
|
|
{
|
|
imports = [
|
|
./unstable-packages.nix
|
|
];
|
|
|
|
config = {
|
|
environment.systemPackages = ( with pkgs; [
|
|
aliasDrag
|
|
ranger-git
|
|
ripgrep
|
|
(kitty.overrideAttrs (superAttrs: {
|
|
patches = superAttrs.patches or [] ++ [
|
|
(fetchpatch {
|
|
url = "https://github.com/AmirulAndalib/kitty/commit/61fd8c4003b361503160424cbed1960153f40290.patch";
|
|
excludes = lib.map lib.escapeRegex [
|
|
"docs/changelog.rst"
|
|
];
|
|
hash = "sha256-TqO/pLRkxN+Mz4nfNfTntGpPoy6OgbtAGmdohG/1BFs=";
|
|
})
|
|
];
|
|
}))
|
|
zoxide
|
|
]) ++ [
|
|
(
|
|
pkgs.writeScriptBin "nix-convert-hash" ''
|
|
${lib.getExe' config.nix.package "nix"} --extra-experimental-features "nix-command" hash convert "$@"
|
|
''
|
|
)
|
|
];
|
|
|
|
programs.bash.shellInit = ''
|
|
HISTCONTROL=ignoreboth
|
|
'';
|
|
|
|
programs.bash.interactiveShellInit = lib.mkMerge [
|
|
''
|
|
HISTCONTROL=ignoreboth
|
|
if test -n "$KITTY_INSTALLATION_DIR"; then
|
|
export KITTY_SHELL_INTEGRATION="enabled,no-sudo"
|
|
source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"
|
|
fi
|
|
alias bye=exit
|
|
''
|
|
(lib.mkAfter ''
|
|
eval "''$(${lib.getExe pkgs.zoxide} init bash)"
|
|
'')
|
|
];
|
|
|
|
environment.etc."xdg/kitty/kitty.conf".text = ''
|
|
font_family MesloLGS Nerd Font
|
|
font_size 10.0
|
|
scrollback_lines 10000
|
|
window_border_width 0.5
|
|
window_padding_width 3
|
|
${if config.services.xserver.desktopManager.gnome.enable then "hide_window_decorations yes" else ""}
|
|
background_opacity 0.8
|
|
dynamic_background_opacity yes
|
|
|
|
map kitty_mod+alt+c copy_ansi_to_clipboard
|
|
'';
|
|
|
|
environment.etc."ranger/rc.conf".text = ''
|
|
eval import os; fm.set_option_from_string("preview_images", "true") if "KITTY_INSTALLATION_DIR" in os.environ else None;
|
|
eval import os; fm.set_option_from_string("preview_images_method", "kitty") if "KITTY_INSTALLATION_DIR" in os.environ else None;
|
|
set vcs_aware true
|
|
set show_hidden true
|
|
|
|
alias drag shell ${pkgs.ripdrag}/bin/ripdrag -Axd %p &
|
|
map <C-d> drag
|
|
'';
|
|
|
|
environment.etc."ranger/plugins/zoxide.py".source = pkgs.fetchFromGitHub {
|
|
owner = "jchook";
|
|
repo = "ranger-zoxide";
|
|
rev = "281828de060299f73fe0b02fcabf4f2f2bd78ab3";
|
|
hash = "sha256-JEuyYSVa1NS3aftezEJx/k19lwwzf7XhqBCL0jH6VT4=";
|
|
} + /__init__.py;
|
|
|
|
programs.direnv.enable = true;
|
|
|
|
programs.neovim = {
|
|
enable = true;
|
|
viAlias = true;
|
|
vimAlias = true;
|
|
configure = {
|
|
customRC = ''
|
|
set number
|
|
set hlsearch
|
|
set incsearch
|
|
set tabstop=4
|
|
set softtabstop=4
|
|
set shiftwidth=4
|
|
set expandtab
|
|
set autoindent
|
|
set updatetime=500
|
|
colorscheme vim
|
|
|
|
syntax on
|
|
set encoding=utf-8
|
|
set wildmode=longest,list,full
|
|
set listchars=space:·,tab:┄┄»
|
|
set indentkeys-=0#
|
|
|
|
" rainbow-delimeters-nvim
|
|
let g:rainbow_delimiters = {
|
|
\ 'strategy': {
|
|
\ ${"''"}: rainbow_delimiters#strategy.global,
|
|
\ },
|
|
\ }
|
|
|
|
" vim-gitguter
|
|
set signcolumn=yes
|
|
highlight SignColumn NONE
|
|
highlight GitGutterAdd ctermfg=2 guifg=#2ea043
|
|
highlight GitGutterChange ctermfg=4 guifg=#0078d4
|
|
highlight GitGutterDelete ctermfg=1 guifg=#f85149
|
|
|
|
lua require('guess-indent').setup {}
|
|
'';
|
|
packages.myVimPackage = with pkgs.vimPlugins; {
|
|
start = [
|
|
guess-indent-nvim
|
|
vim-visual-multi
|
|
autoclose-nvim
|
|
rainbow-delimiters-nvim
|
|
vimagit
|
|
vim-gitgutter
|
|
];
|
|
};
|
|
};
|
|
};
|
|
|
|
environment.variables = lib.mkIf config.programs.neovim.enable rec {
|
|
EDITOR = "/run/current-system/sw/bin/nvim";
|
|
VISUAL = EDITOR;
|
|
};
|
|
|
|
programs.starship = {
|
|
enable = true;
|
|
settings = {
|
|
format = lib.concatStrings [
|
|
"$all"
|
|
"\${custom.sshAuthSocket}"
|
|
"$line_break"
|
|
"\${custom.ranger}"
|
|
"$jobs"
|
|
"$battery"
|
|
"$time"
|
|
"$status"
|
|
"$os"
|
|
"$container"
|
|
"$shell"
|
|
"$character"
|
|
];
|
|
directory = {
|
|
truncation_length = 5;
|
|
truncation_symbol = "…/";
|
|
};
|
|
hostname = {
|
|
ssh_only = false;
|
|
};
|
|
username = {
|
|
show_always = true;
|
|
};
|
|
status.disabled = false;
|
|
custom.ranger = {
|
|
when = "test $RANGER_LEVEL";
|
|
command = "echo \"✦\"";
|
|
style = "bold 208";
|
|
};
|
|
custom.sshAuthSocket = {
|
|
when = "test -S \"$SSH_AUTH_SOCK\"";
|
|
command = "echo -e \"SSH Auth Agent\"";
|
|
style = "124";
|
|
format = "with [$output]($style) ";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|