mirror of
https://github.com/szymon-jozef/amazing-dotfiles.git
synced 2026-09-07 12:10:45 +02:00
laptop
Merge branch 'master' of https://github.com/szymon-jozef/amazing-dotfiles
This commit is contained in:
8
modules/cli/atuin.nix
Normal file
8
modules/cli/atuin.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
programs.atuin = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
}
|
||||
7
modules/cli/bat.nix
Normal file
7
modules/cli/bat.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
10
modules/cli/btop.nix
Normal file
10
modules/cli/btop.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
programs.btop = {
|
||||
enable = true;
|
||||
settings = {
|
||||
vim_keys = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
62
modules/cli/fastfetch.nix
Normal file
62
modules/cli/fastfetch.nix
Normal file
@@ -0,0 +1,62 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.fastfetch = {
|
||||
enable = true;
|
||||
settings = {
|
||||
modules = [
|
||||
"title"
|
||||
"separator"
|
||||
"os"
|
||||
"host"
|
||||
"kernel"
|
||||
"packages"
|
||||
"separator"
|
||||
"wm"
|
||||
"shell"
|
||||
"terminal"
|
||||
"theme"
|
||||
"font"
|
||||
"locale"
|
||||
"separator"
|
||||
"display"
|
||||
"cpu"
|
||||
"gpu"
|
||||
"memory"
|
||||
"disk"
|
||||
"battery"
|
||||
"separator"
|
||||
"wifi"
|
||||
"localip"
|
||||
"break"
|
||||
"colors"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
xdg.configFile."fastfetch/startup.jsonc".text = builtins.toJSON {
|
||||
logo = {
|
||||
source = "arch_small";
|
||||
padding = {
|
||||
bottom = 1;
|
||||
};
|
||||
};
|
||||
display = {
|
||||
separator = " ➜ ";
|
||||
};
|
||||
modules = [
|
||||
"title"
|
||||
"kernel"
|
||||
"packages"
|
||||
"shell"
|
||||
"battery"
|
||||
{
|
||||
type = "separator";
|
||||
string = " • ";
|
||||
}
|
||||
"break"
|
||||
"break"
|
||||
"break"
|
||||
];
|
||||
};
|
||||
}
|
||||
117
modules/cli/fish.nix
Normal file
117
modules/cli/fish.nix
Normal file
@@ -0,0 +1,117 @@
|
||||
{ isNixOS, ... }:
|
||||
|
||||
{
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
loginShellInit = ''
|
||||
fish_add_path --move --prepend --path "$HOME/.nix-profile/bin" /nix/var/nix/profiles/default/bin /run/current-system/sw/bin
|
||||
'';
|
||||
|
||||
interactiveShellInit = ''
|
||||
# no dum greeting
|
||||
set fish_greeting ""
|
||||
|
||||
set -gx GPG_TTY (tty)
|
||||
|
||||
fish_vi_key_bindings
|
||||
|
||||
fastfetch --config ~/.config/fastfetch/startup.jsonc
|
||||
'';
|
||||
|
||||
functions = {
|
||||
edit_dotfile = {
|
||||
description = "Edit config file, reload, commit and push";
|
||||
body = ''
|
||||
set -l config_dir "$HOME/.config/home-manager"
|
||||
set -l file
|
||||
|
||||
if test (count $argv) -gt 0
|
||||
set file $argv[1]
|
||||
else
|
||||
set file (fd . $config_dir --type f --exclude ".git" | fzf)
|
||||
end
|
||||
|
||||
if test -n "$file"
|
||||
set -l md5_before (md5sum $file)
|
||||
pushd $config_dir
|
||||
|
||||
nvim $file
|
||||
|
||||
if test "$md5_before" != (md5sum $file)
|
||||
echo "Changes made. Preparing commit..."
|
||||
|
||||
set -l rel_file (realpath --relative-to=$config_dir $file)
|
||||
|
||||
if home-manager switch --flake "$config_dir#${
|
||||
if isNixOS then "nixos" else "arch"
|
||||
}" -b backup
|
||||
git add -A
|
||||
set commit_msg "update: $rel_file"
|
||||
git commit -m "$commit_msg"
|
||||
git push
|
||||
end
|
||||
else
|
||||
echo "No changes made"
|
||||
end
|
||||
popd
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
ls = {
|
||||
body = "eza --long --icons --group-directories-first --git $argv";
|
||||
};
|
||||
|
||||
lst = {
|
||||
body = "eza --long --icons --color --git --tree $argv";
|
||||
};
|
||||
|
||||
cp_mail = {
|
||||
body = "pandoc $argv -t html |wl-copy -t text/html";
|
||||
};
|
||||
|
||||
update = {
|
||||
body = ''
|
||||
echo "===System update==="
|
||||
|
||||
if not type -q yay
|
||||
echo "Yay not found… Is this Arch? If yes, then please consider installing it!"
|
||||
else
|
||||
yay
|
||||
end
|
||||
|
||||
if type -q pacman
|
||||
echo "===Remove orphans==="
|
||||
set orphans (pacman -Qtdq)
|
||||
if test (count $orphans) -gt 0
|
||||
sudo pacman -Rns $orphans
|
||||
end
|
||||
end
|
||||
|
||||
if type -q flatpak
|
||||
echo "===Flatpak update==="
|
||||
flatpak update --noninteractive
|
||||
echo "===Flatpak remove unused==="
|
||||
flatpak uninstall --unused
|
||||
end
|
||||
|
||||
if type -q nix-channel
|
||||
echo "===Nix update==="
|
||||
nix-channel --update
|
||||
echo "===Nix garbage collection==="
|
||||
home-manager expire-generations "-7 days"
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
rm = {
|
||||
body = "trash $argv";
|
||||
};
|
||||
|
||||
open = {
|
||||
body = "nohup xdg-open $argv > /dev/null & ";
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
50
modules/cli/git.nix
Normal file
50
modules/cli/git.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
pkgs,
|
||||
full_name,
|
||||
email,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
git-graph
|
||||
];
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
settings = {
|
||||
user = {
|
||||
name = full_name;
|
||||
email = email;
|
||||
};
|
||||
init.defaultBranch = "master";
|
||||
push.autoSetupRemote = true;
|
||||
core.editor = "nvim";
|
||||
};
|
||||
|
||||
signing = {
|
||||
key = email;
|
||||
signByDefault = false;
|
||||
};
|
||||
|
||||
ignores = [
|
||||
"*~"
|
||||
"*.swp"
|
||||
".DS_Store"
|
||||
"node_modules"
|
||||
"result"
|
||||
"__pycache__"
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
programs.delta = {
|
||||
enable = true;
|
||||
enableGitIntegration = true;
|
||||
};
|
||||
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
pinentry.package = pkgs.pinentry-curses;
|
||||
};
|
||||
}
|
||||
243
modules/cli/nixvim.nix
Normal file
243
modules/cli/nixvim.nix
Normal file
@@ -0,0 +1,243 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
maplocalleader = "\\";
|
||||
};
|
||||
|
||||
opts = {
|
||||
relativenumber = true;
|
||||
number = true;
|
||||
signcolumn = "yes";
|
||||
cursorline = false;
|
||||
wrap = true;
|
||||
shiftwidth = 4;
|
||||
tabstop = 4;
|
||||
expandtab = true;
|
||||
list = true;
|
||||
clipboard = "unnamedplus";
|
||||
spell = true;
|
||||
spelllang = [
|
||||
"pl"
|
||||
"en"
|
||||
];
|
||||
};
|
||||
|
||||
colorschemes.catppuccin = {
|
||||
enable = true;
|
||||
settings.flavour = "mocha";
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
key = "<Space>";
|
||||
action = "<Nop>";
|
||||
options.silent = true;
|
||||
}
|
||||
{
|
||||
mode = "x";
|
||||
key = ">";
|
||||
action = ">gv";
|
||||
options.desc = "Shift code right";
|
||||
}
|
||||
{
|
||||
mode = "x";
|
||||
key = "<";
|
||||
action = "<gv";
|
||||
options.desc = "Shift code left";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>a";
|
||||
action.__raw = "function() require('harpoon'):list():add() end";
|
||||
options.desc = "Add file to harpoon";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-e>";
|
||||
action.__raw = "function() require('telescope').extensions.harpoon.marks(require('telescope.themes').get_dropdown{}) end";
|
||||
options.desc = "Open harpoon window";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-h>";
|
||||
action.__raw = "function() require('harpoon'):list():select(1) end";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-j>";
|
||||
action.__raw = "function() require('harpoon'):list():select(2) end";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-k>";
|
||||
action.__raw = "function() require('harpoon'):list():select(3) end";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-l>";
|
||||
action.__raw = "function() require('harpoon'):list():select(4) end";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-S-P>";
|
||||
action.__raw = "function() require('harpoon'):list():prev() end";
|
||||
options.desc = "Toggle previous harpoon buffer";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-S-N>";
|
||||
action.__raw = "function() require('harpoon'):list():next() end";
|
||||
options.desc = "Toggle next harpoon buffer";
|
||||
}
|
||||
];
|
||||
|
||||
autoGroups = {
|
||||
YankHighlight = {
|
||||
clear = true;
|
||||
};
|
||||
};
|
||||
autoCmd = [
|
||||
{
|
||||
event = "TextYankPost";
|
||||
group = "YankHighlight";
|
||||
callback.__raw = ''
|
||||
function()
|
||||
vim.highlight.on_yank({ higroup = "IncSearch", timeout = 200 })
|
||||
end
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
plugins = {
|
||||
nvim-autopairs.enable = true;
|
||||
web-devicons.enable = true;
|
||||
|
||||
which-key = {
|
||||
enable = true;
|
||||
settings.spec = [
|
||||
{
|
||||
__unkeyed-1 = "<leader>?";
|
||||
mode = "n";
|
||||
desc = "Buffer Local Keymaps (which-key)";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
gitsigns = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
telescope = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
"<leader>ff" = {
|
||||
action = "find_files";
|
||||
options.desc = "Telescope find files";
|
||||
};
|
||||
"<leader>fg" = {
|
||||
action = "git_files";
|
||||
options.desc = "Telescope find git files";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
harpoon = {
|
||||
enable = true;
|
||||
enableTelescope = true;
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
# script
|
||||
lua_ls.enable = true;
|
||||
# web
|
||||
cssls.enable = true;
|
||||
html.enable = true;
|
||||
emmet_ls.enable = true;
|
||||
friendly-snippets.enable = true;
|
||||
# dev
|
||||
clangd.enable = true;
|
||||
pyright.enable = true;
|
||||
rust_analyzer = {
|
||||
enable = true;
|
||||
installCargo = true;
|
||||
installRustc = true;
|
||||
};
|
||||
# nix
|
||||
nil_ls.enable = true;
|
||||
};
|
||||
keymaps = {
|
||||
lspBuf = {
|
||||
"gd" = "definition";
|
||||
"gi" = "implementation";
|
||||
"<leader>ca" = "code_action";
|
||||
"<leader>cf" = "format";
|
||||
"<leader>r" = "rename";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
lsp-format.enable = true;
|
||||
|
||||
luasnip.enable = true;
|
||||
|
||||
treesitter = {
|
||||
enable = true;
|
||||
settings = {
|
||||
highlight.enable = true;
|
||||
indent.enable = false;
|
||||
};
|
||||
};
|
||||
|
||||
indent-blankline = {
|
||||
enable = true;
|
||||
settings.scope.enabled = true;
|
||||
};
|
||||
|
||||
cmp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
|
||||
sources = [
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "luasnip"; }
|
||||
{ name = "buffer"; }
|
||||
];
|
||||
mapping = {
|
||||
"<C-p>" = "cmp.mapping.select_prev_item()";
|
||||
"<C-n>" = "cmp.mapping.select_next_item()";
|
||||
"<C-y>" = "cmp.mapping.confirm({ select = true })";
|
||||
"<C-e>" = "cmp.mapping.abort()";
|
||||
};
|
||||
window = {
|
||||
documentation = {
|
||||
border = "rounded";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraConfigLua = ''
|
||||
vim.diagnostic.config({
|
||||
virtual_text = {
|
||||
prefix = "●",
|
||||
spacing = 2,
|
||||
source = "if_many",
|
||||
}
|
||||
});
|
||||
'';
|
||||
};
|
||||
}
|
||||
37
modules/cli/ssh.nix
Normal file
37
modules/cli/ssh.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{ username, ... }:
|
||||
|
||||
{
|
||||
services.ssh-agent.enable = true;
|
||||
services.ssh-agent.enableFishIntegration = true;
|
||||
|
||||
programs.ssh = {
|
||||
enableDefaultConfig = false;
|
||||
enable = true;
|
||||
matchBlocks = {
|
||||
"dmowski" = {
|
||||
hostname = "192.168.0.30";
|
||||
user = username;
|
||||
port = 22;
|
||||
identityFile = "~/.ssh/dmowski";
|
||||
};
|
||||
|
||||
"aur.archlinux.org" = {
|
||||
user = username;
|
||||
identityFile = "~/.ssh/aur";
|
||||
};
|
||||
|
||||
"github.com" = {
|
||||
hostname = "github.com";
|
||||
user = "git";
|
||||
identityFile = "~/.ssh/github";
|
||||
};
|
||||
|
||||
"*" = {
|
||||
addKeysToAgent = "yes";
|
||||
setEnv = {
|
||||
TERM = "xterm-256color";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
42
modules/cli/yazi.nix
Normal file
42
modules/cli/yazi.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
programs.yazi = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
shellWrapperName = "y";
|
||||
settings = {
|
||||
mgr = {
|
||||
ratio = [
|
||||
1
|
||||
4
|
||||
3
|
||||
];
|
||||
sort_by = "alphabetical";
|
||||
sort_sensitive = false;
|
||||
sort_reverse = false;
|
||||
sort_dir_first = true;
|
||||
sort_translit = false;
|
||||
linemode = "none";
|
||||
show_hidden = false;
|
||||
show_symlink = true;
|
||||
scrolloff = 5;
|
||||
mouse_events = [
|
||||
"click"
|
||||
"scroll"
|
||||
];
|
||||
title_format = "Yazi: {cwd}";
|
||||
};
|
||||
};
|
||||
|
||||
keymap.mgr.prepend_keymap = [
|
||||
{
|
||||
on = [ "y" ];
|
||||
run = [
|
||||
"shell -- for path in %s; do echo \"file://$path\"; done | wl-copy -t text/uri-list"
|
||||
"yank"
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
8
modules/cli/zoxide.nix
Normal file
8
modules/cli/zoxide.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user