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
home-manager.users.guanranwang.imports = map (n: ../../../../home-manager/${n}) [ home-manager.users.guanranwang.imports = map (n: ../../../../home-manager/${n}) [
"modules/terms/alacritty.nix" "applications/alacritty"
"modules/shell/fish.nix" "applications/fish"
"modules/shell/bash.nix" "applications/bash"
"modules/editor/helix.nix" "applications/helix"
"modules/editor/neovim.nix" "applications/neovim"
"modules/editor/vscode.nix" "applications/vscode"
"profiles/graphical-stuff/darwin" "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, ...}: { {pkgs, ...}: {
# Chinese IME
i18n.inputMethod = { i18n.inputMethod = {
enabled = "fcitx5"; enabled = "fcitx5";
fcitx5.addons = with pkgs; [ 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; [ home.packages = with pkgs; [
nil # LSP nil # LSP
alejandra # Formatter alejandra # Formatter
sops
nix-output-monitor
]; ];
### VSCode ### 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,96 +1,33 @@
{ {pkgs, ...}: {
pkgs, imports = [
lib, ../../../../applications/git
... ../../../../applications/starship
}: { ../../../../applications/eza
home = { ../../../../applications/skim
shellAliases = { ../../../../applications/bat
# navigation ];
"ls" = "eza";
"tree" = "ls --tree";
".." = "cd ..";
"farsee" = "curl -F 'c=@-' 'https://fars.ee/'"; # pb home.shellAliases = {
".." = "cd ..";
"farsee" = "curl -F 'c=@-' 'https://fars.ee/'"; # pb
# proxy # proxy
"setproxy" = let "setproxy" = let
proxy = "http://127.0.0.1:7890/"; proxy = "http://127.0.0.1:7890/";
in "export http_proxy=${proxy} https_proxy=${proxy} ftp_proxy=${proxy} rsync_proxy=${proxy}"; 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 (?) "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
wget
fd
hyperfine
];
}; };
home.packages = with pkgs; [
wget
fd
hyperfine
];
programs = { programs = {
tealdeer.enable = true; tealdeer.enable = true;
zoxide.enable = true; zoxide.enable = true;
bat.enable = true;
bottom.enable = true; bottom.enable = true;
joshuto.enable = true; joshuto.enable = true;
ripgrep.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 ./wallpapers
./packages.nix ./packages.nix
./input-method.nix
./theme.nix ./theme.nix
./xdg-mime.nix ./xdg-mime.nix
] ]
@ -42,6 +41,7 @@
"sway" "sway"
# Misc # Misc
"fcitx5"
"irssi" "irssi"
"mumble" "mumble"
]; ];