home: sorting

This commit is contained in:
Guanran Wang 2023-11-29 18:18:56 +08:00
parent 5dab0b614e
commit 2c33dc6b8e
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
10 changed files with 101 additions and 93 deletions

View file

@ -1,12 +1,12 @@
{...}: {
### home-manager
home-manager.users.guanranwang.imports = map (n: ../../../../home-manager/${n}) [
"modules/terms/alacritty.nix"
"modules/shell/fish.nix"
"modules/shell/bash.nix"
"modules/editor/helix.nix"
"modules/editor/neovim.nix"
"modules/editor/vscode.nix"
"applications/alacritty"
"applications/fish"
"applications/bash"
"applications/helix"
"applications/neovim"
"applications/vscode"
"profiles/graphical-stuff/darwin"
];

View file

@ -0,0 +1,7 @@
{...}: {
programs.bat.enable = true;
home.sessionVariables = {
"MANPAGER" = "sh -c 'col -bx | bat -l man -p'";
"MANROFFOPT" = "-c";
};
}

View file

@ -0,0 +1,15 @@
{...}: {
programs.eza = {
enable = true;
git = true;
icons = true;
extraOptions = ["--header"];
# Fish have builtin aliases for `ls`, alias `ls` to `eza` is the only thing we want to do
#enableAliases = true;
};
home.shellAliases = {
"ls" = "eza";
"tree" = "ls --tree";
};
}

View file

@ -1,5 +1,4 @@
{pkgs, ...}: {
# Chinese IME
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [

View file

@ -0,0 +1,14 @@
{...}: {
programs.git = {
enable = true;
userName = "Guanran Wang";
userEmail = "guanran928@outlook.com";
delta.enable = true;
signing.signByDefault = true;
signing.key = "~/.ssh/id_github_signing";
extraConfig = {
gpg.format = "ssh";
pull.rebase = true;
};
};
}

View file

@ -2,6 +2,8 @@
home.packages = with pkgs; [
nil # LSP
alejandra # Formatter
sops
nix-output-monitor
];
### VSCode

View file

@ -0,0 +1,9 @@
{...}: {
programs.skim = {
enable = true;
defaultCommand = "rg --files || fd --type f || find .";
# rg --files ran
# 4.40 ± 0.44 times faster than fd --type f
# 60.39 ± 5.80 times faster than find .
};
}

View file

@ -0,0 +1,25 @@
{
lib,
pkgs,
...
}: {
programs.starship = {
enable = true;
settings = lib.mkMerge [
{
add_newline = false;
line_break.disabled = true;
character = {
success_symbol = "[>](bold green)";
error_symbol = "[>](bold red)";
vimcmd_symbol = "[<](bold green)";
vimcmd_replace_one_symbol = "[<](bold purple)";
vimcmd_replace_symbol = "[<](bold purple)";
vimcmd_visual_symbol = "[<](bold yellow)";
};
}
(builtins.fromTOML (builtins.readFile "${pkgs.starship}/share/starship/presets/nerd-font-symbols.toml"))
];
};
}

View file

@ -1,15 +1,14 @@
{
pkgs,
lib,
...
}: {
home = {
shellAliases = {
# navigation
"ls" = "eza";
"tree" = "ls --tree";
".." = "cd ..";
{pkgs, ...}: {
imports = [
../../../../applications/git
../../../../applications/starship
../../../../applications/eza
../../../../applications/skim
../../../../applications/bat
];
home.shellAliases = {
".." = "cd ..";
"farsee" = "curl -F 'c=@-' 'https://fars.ee/'"; # pb
# proxy
@ -18,79 +17,17 @@
in "export http_proxy=${proxy} https_proxy=${proxy} ftp_proxy=${proxy} rsync_proxy=${proxy}";
"unsetproxy" = "set -e http_proxy https_proxy all_proxy"; # fish syntax (?)
};
sessionVariables = {
# Bat
"MANPAGER" = "sh -c 'col -bx | bat -l man -p'";
"MANROFFOPT" = "-c";
};
packages = with pkgs; [
### Nix
sops
nix-output-monitor
### Misc
home.packages = with pkgs; [
wget
fd
hyperfine
];
};
programs = {
tealdeer.enable = true;
zoxide.enable = true;
bat.enable = true;
bottom.enable = true;
joshuto.enable = true;
ripgrep.enable = true;
starship = {
enable = true;
settings = lib.mkMerge [
{
add_newline = false;
line_break.disabled = true;
character = {
success_symbol = "[>](bold green)";
error_symbol = "[>](bold red)";
vimcmd_symbol = "[<](bold green)";
vimcmd_replace_one_symbol = "[<](bold purple)";
vimcmd_replace_symbol = "[<](bold purple)";
vimcmd_visual_symbol = "[<](bold yellow)";
};
}
(builtins.fromTOML (builtins.readFile "${pkgs.starship}/share/starship/presets/nerd-font-symbols.toml"))
];
};
eza = {
enable = true;
git = true;
icons = true;
extraOptions = ["--header"];
# Fish have builtin aliases for `ls`, alias `ls` to `eza` is the only thing we want to do
#enableAliases = true;
};
skim = {
enable = true;
defaultCommand = "rg --files || fd --type f || find .";
# rg --files ran
# 4.40 ± 0.44 times faster than fd --type f
# 60.39 ± 5.80 times faster than find .
};
git = {
enable = true;
userName = "Guanran Wang";
userEmail = "guanran928@outlook.com";
delta.enable = true;
signing.signByDefault = true;
signing.key = "~/.ssh/id_github_signing";
extraConfig = {
gpg.format = "ssh";
pull.rebase = true;
};
};
};
}

View file

@ -6,7 +6,6 @@
./wallpapers
./packages.nix
./input-method.nix
./theme.nix
./xdg-mime.nix
]
@ -42,6 +41,7 @@
"sway"
# Misc
"fcitx5"
"irssi"
"mumble"
];