moved dev/terminal to own folders
This commit is contained in:
75
modules/dev/default.nix
Normal file
75
modules/dev/default.nix
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
{ pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
system = pkgs.stdenv.hostPlatform.system;
|
||||||
|
nvchad = inputs.nix4nvchad.packages.${system}.default.override {
|
||||||
|
extraConfig = builtins.readFile ./nvim.conf;
|
||||||
|
extraPlugins = builtins.readFile ./nvim.plugins;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
programs.java.enable = true;
|
||||||
|
programs.nix-ld.libraries = with pkgs; [
|
||||||
|
stdenv.cc.cc.lib
|
||||||
|
zlib
|
||||||
|
ncurses5
|
||||||
|
libGL
|
||||||
|
libGLU
|
||||||
|
vulkan-loader
|
||||||
|
libdrm
|
||||||
|
mesa
|
||||||
|
libx11
|
||||||
|
libxcursor
|
||||||
|
libxrandr
|
||||||
|
libxi
|
||||||
|
libxext
|
||||||
|
libxfixes
|
||||||
|
libxcb
|
||||||
|
wayland
|
||||||
|
libpulseaudio
|
||||||
|
alsa-lib
|
||||||
|
nss
|
||||||
|
nspr
|
||||||
|
expat
|
||||||
|
glib
|
||||||
|
dbus
|
||||||
|
systemd
|
||||||
|
freetype
|
||||||
|
fontconfig
|
||||||
|
];
|
||||||
|
|
||||||
|
users.users.djai.packages = with pkgs; [
|
||||||
|
# dev environment
|
||||||
|
godot
|
||||||
|
nvchad
|
||||||
|
jq
|
||||||
|
lazygit
|
||||||
|
ripgrep
|
||||||
|
|
||||||
|
# toolchains
|
||||||
|
cargo
|
||||||
|
gcc
|
||||||
|
gnumake
|
||||||
|
openssl
|
||||||
|
python3
|
||||||
|
rustc
|
||||||
|
uv
|
||||||
|
|
||||||
|
# containers / secrets
|
||||||
|
age
|
||||||
|
fluxcd
|
||||||
|
k9s
|
||||||
|
kubectl
|
||||||
|
kubectx
|
||||||
|
sops
|
||||||
|
|
||||||
|
# hosts / networks
|
||||||
|
wireguard-tools
|
||||||
|
lm_sensors
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
# TODO: switch to home manager
|
||||||
|
# home-manager.users.djai.home.packages = with pkgs; [];
|
||||||
|
|
||||||
|
}
|
||||||
23
modules/dev/nvim.conf
Normal file
23
modules/dev/nvim.conf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
local map = vim.keymap.set
|
||||||
|
local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
|
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||||
|
map("n", "<leader>sw", "<cmd> set wrap! <CR>", {desc = "Toggle text wrapping"})
|
||||||
|
map("n", "<leader>fm", function() require("conform").format() end, {desc = "Format with conform"})
|
||||||
|
map("n", "<leader>-", "<cmd> Oil <CR>", {desc = "Open directory in oil"})
|
||||||
|
map("n", "<leader>rcu", function() require('crates').upgrade_all_crates() end, {desc = "Upgrade rust crates"})
|
||||||
|
map("n", "<leader>ca", function() vim.lsp.buf.code_action() end, {desc = "Lsp code action"})
|
||||||
|
map("n", "<leader>gr", function() vim.lsp.buf.references() end, {desc = "Lsp references"})
|
||||||
|
map("n", "<leader>gm", "<cmd>Telescope git_commits<CR>", { desc = "telescope git commits" })
|
||||||
|
|
||||||
|
map('n', '<leader>fi', function()
|
||||||
|
builtin.live_grep({
|
||||||
|
prompt_title = "Files matching TODO",
|
||||||
|
default_text = "(TODO|todo|FIXME|THOUGHT|REFACTOR|TEST)",
|
||||||
|
})
|
||||||
|
end, {desc = "find comments using telescope"})
|
||||||
|
|
||||||
|
-- stay in v mode after indenting
|
||||||
|
map("v", "<", "<gv")
|
||||||
|
map("v", ">", ">gv")
|
||||||
|
|
||||||
36
modules/dev/nvim.plugins
Normal file
36
modules/dev/nvim.plugins
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
require "configs.lspconfig"
|
||||||
|
end,
|
||||||
|
},{
|
||||||
|
"rcarriga/nvim-notify",
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
local notify = require "notify"
|
||||||
|
notify.setup {
|
||||||
|
background_colour = "#2D3540",
|
||||||
|
}
|
||||||
|
vim.notify = notify
|
||||||
|
end,
|
||||||
|
},{
|
||||||
|
"stevearc/oil.nvim",
|
||||||
|
opts = {},
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons"},
|
||||||
|
lazy = false
|
||||||
|
},{
|
||||||
|
'saecki/crates.nvim',
|
||||||
|
event = { "BufRead Cargo.toml" },
|
||||||
|
config = function()
|
||||||
|
require('crates').setup()
|
||||||
|
end,
|
||||||
|
},{
|
||||||
|
"jglasovic/venv-lsp.nvim",
|
||||||
|
config = function()
|
||||||
|
require("venv-lsp").setup()
|
||||||
|
end,
|
||||||
|
lazy = false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
36
modules/terminal/default.nix
Normal file
36
modules/terminal/default.nix
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
environment.defaultPackages = with pkgs; [
|
||||||
|
fbterm
|
||||||
|
kitty
|
||||||
|
starship
|
||||||
|
];
|
||||||
|
|
||||||
|
# TODO: switch to home manager
|
||||||
|
programs.fish.enable = true;
|
||||||
|
programs.tmux = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = builtins.readFile ./tmux.conf;
|
||||||
|
|
||||||
|
plugins = with pkgs.tmuxPlugins; [
|
||||||
|
sensible
|
||||||
|
resurrect
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# home-manager.users.djai = {
|
||||||
|
# programs.fish.enable = true;
|
||||||
|
# programs.tmux.enable = true;
|
||||||
|
#
|
||||||
|
# programs.kitty = {
|
||||||
|
# enable = true;
|
||||||
|
# settings = {
|
||||||
|
# shell = "${pkgs.tmux}/bin/tmux";
|
||||||
|
# font_family = "Iosevka Nerd Font";
|
||||||
|
# };
|
||||||
|
# extraConfig = ""; # TODO theming
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
# };
|
||||||
|
}
|
||||||
89
modules/terminal/tmux.conf
Normal file
89
modules/terminal/tmux.conf
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
# use <C-a> as leader
|
||||||
|
unbind C-b
|
||||||
|
set-option -g prefix C-a
|
||||||
|
bind-key C-a send-prefix
|
||||||
|
|
||||||
|
bind ? list-keys
|
||||||
|
|
||||||
|
# window/pane management
|
||||||
|
bind s split-window -h -c "#{pane_current_path}"
|
||||||
|
bind C-s select-layout main-horizontal \; swap-pane -t 0 \; select-pane -t 0
|
||||||
|
bind S select-layout even-horizontal
|
||||||
|
bind v split-window -v -c "#{pane_current_path}"
|
||||||
|
bind C-v select-layout main-vertical \; swap-pane -t 0 \; select-pane -t 0
|
||||||
|
bind V select-layout even-vertical
|
||||||
|
bind c new-window -c "#{pane_current_path}"
|
||||||
|
# move pane to new tab
|
||||||
|
bind b break-pane
|
||||||
|
# swap active pane and first pane
|
||||||
|
bind a swap-pane -t 0 \; select-pane -t 0
|
||||||
|
unbind '"'
|
||||||
|
unbind %
|
||||||
|
|
||||||
|
# vim-style pane switching with <A-j> through <A-l>
|
||||||
|
bind -n M-h select-pane -L
|
||||||
|
bind -n M-j select-pane -D
|
||||||
|
bind -n M-k select-pane -U
|
||||||
|
bind -n M-l select-pane -R
|
||||||
|
bind h select-pane -L
|
||||||
|
bind j select-pane -D
|
||||||
|
bind k select-pane -U
|
||||||
|
bind l select-pane -R
|
||||||
|
# Resize using caps
|
||||||
|
bind -r H resize-pane -L 5
|
||||||
|
bind -r J resize-pane -D 5
|
||||||
|
bind -r K resize-pane -U 5
|
||||||
|
bind -r L resize-pane -R 5
|
||||||
|
|
||||||
|
# vim-style copy mode
|
||||||
|
set-window-option -g mode-keys vi
|
||||||
|
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
|
||||||
|
bind-key -T copy-mode-vi 'y' send-keys -X copy-selection-and-cancel
|
||||||
|
bind-key p paste-buffer
|
||||||
|
|
||||||
|
# window traversal
|
||||||
|
bind -n M-n next-window
|
||||||
|
bind tab next-window
|
||||||
|
|
||||||
|
|
||||||
|
# reload config with r
|
||||||
|
bind r source-file ~/.config/tmux/tmux.conf
|
||||||
|
# dont rename windows automatically
|
||||||
|
# set-option -g allow-rename off
|
||||||
|
|
||||||
|
|
||||||
|
# ----- UI/UX -----
|
||||||
|
|
||||||
|
# don't do anything when a 'bell' rings
|
||||||
|
set -g visual-activity off
|
||||||
|
set -g visual-bell off
|
||||||
|
set -g visual-silence off
|
||||||
|
setw -g monitor-activity off
|
||||||
|
set -g bell-action none
|
||||||
|
|
||||||
|
# copy mode
|
||||||
|
setw -g mode-style 'fg=black bg=red bold'
|
||||||
|
|
||||||
|
# panes
|
||||||
|
set -g pane-border-style 'fg=black'
|
||||||
|
set -g pane-active-border-style 'fg=white'
|
||||||
|
|
||||||
|
# status
|
||||||
|
set -g status-position bottom
|
||||||
|
set -g status-justify left
|
||||||
|
set -g status-style 'bg=black fg=white'
|
||||||
|
|
||||||
|
set -g status-left ""
|
||||||
|
set -g status-right ""
|
||||||
|
|
||||||
|
# window status
|
||||||
|
setw -g window-status-current-style 'bg=blue fg=black'
|
||||||
|
setw -g window-status-current-format '◤ #W ◢'
|
||||||
|
|
||||||
|
setw -g window-status-style 'fg=white bg=black'
|
||||||
|
setw -g window-status-format '#[fg=black]◤ #[fg=white]#W #[fg=black]◢'
|
||||||
|
setw -g window-status-bell-style 'fg=yellow bg=red bold'
|
||||||
|
|
||||||
|
# messages
|
||||||
|
set -g message-style 'fg=black bg=blue'
|
||||||
|
|
||||||
Reference in New Issue
Block a user