start to use home manager as NixOS module

This commit is contained in:
xinyangli 2023-04-23 01:42:40 +08:00
parent 71b20209b2
commit 37a8487bdb
21 changed files with 523 additions and 308 deletions

15
home/xin/alacritty.nix Normal file
View file

@ -0,0 +1,15 @@
{ config, ... }: {
programs.alacritty = {
enable = true;
settings = {
shell = {
program = config.programs.zellij.package + "/bin/zellij";
};
font.size = 10.0;
window = {
resize_increments = true;
dynamic_padding = true;
};
};
};
}

View file

@ -0,0 +1,34 @@
{ config, pkgs, ... }:
{
imports = [
../common
../vscode.nix
../alacritty.nix
];
home.username = "xin";
home.homeDirectory = "/home/xin";
home.stateVersion = "23.05";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
accounts.email.accounts.gmail = {
primary = true;
address = "lixinyang411@gmail.com";
flavor = "gmail.com";
};
accounts.email.accounts.whu = {
address = "lixinyang411@whu.edu.cn";
};
accounts.email.accounts.foxmail = {
address = "lixinyang411@foxmail.com";
};
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [ fcitx5-rime ];
};
}

View file

@ -0,0 +1,21 @@
{ pkgs, ... }: {
imports = [
./fish.nix
./git.nix
./zellij.nix
];
home.packages = with pkgs; [
dig
du-dust # du + rust
zoxide # autojumper
man-pages
tree
wget
tmux
ffmpeg
tealdeer
neofetch
rclone
clash
];
}

19
home/xin/common/fish.nix Normal file
View file

@ -0,0 +1,19 @@
{ pkgs, ... }: {
programs.fish = {
enable = true;
plugins = with pkgs; [
{
name = "pisces";
src = fishPlugins.pisces.src;
}
{
name = "done";
src = fishPlugins.done.src;
}
{
name = "hydro";
src = fishPlugins.hydro.src;
}
];
};
}

13
home/xin/common/git.nix Normal file
View file

@ -0,0 +1,13 @@
{
programs.git = {
enable = true;
delta.enable = true;
userName = "Xinyang Li";
userEmail = "lixinyang411@gmail.com";
aliases = {
graph = "log --all --oneline --graph --decorate";
s = "status";
d = "diff";
};
};
}

View file

@ -0,0 +1,29 @@
{
programs.zellij = {
enable = true;
settings = {
on_force_close = "quit";
default_shell = "fish";
keybinds = {
unbind = [
"Ctrl p"
"Ctrl n"
];
};
theme = "dracula";
themes.dracula = {
fg = [ 248 248 242 ];
bg = [ 40 42 54 ];
black = [ 0 0 0 ];
red = [ 255 85 85 ];
green = [ 80 250 123 ];
yellow = [ 241 250 140 ];
blue = [ 98 114 164 ];
magenta = [ 255 121 198 ];
cyan = [ 139 233 253 ];
white = [ 255 255 255 ];
orange = [ 255 184 108 ];
};
};
};
}

View file

@ -1,15 +0,0 @@
{
home.username = "xin";
home.homeDirectory = "/home/xin";
accounts = {
gmail = {
};
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}

128
home/xin/vscode.nix Normal file
View file

@ -0,0 +1,128 @@
{ config, pkgs, inputs, system, ... }:
{
programs.vscode = {
enable = true;
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
mutableExtensionsDir = false;
extensions = with inputs.nix-vscode-extensions.extensions.${system}.vscode-marketplace; [
arrterian.nix-env-selector
bbenoist.nix
ms-azuretools.vscode-docker
ms-vscode-remote.remote-ssh
vscodevim.vim
github.vscode-pull-request-github
eamodio.gitlens
gruntfuggly.todo-tree # todo highlight
# Language support
# Python
ms-python.python
# Markdown
davidanson.vscode-markdownlint
# C/C++
ms-vscode.cmake-tools
llvm-vs-code-extensions.vscode-clangd
# Nix
jnoortheen.nix-ide
# Latex
james-yu.latex-workshop
# Rust
rust-lang.rust-analyzer
ms-vscode-remote.remote-ssh-edit
];
userSettings = {
"workbench.colorTheme" = "Default Dark+";
"terminal.integrated.sendKeybindingsToShell" = true;
"extensions.ignoreRecommendations" = true;
"files.autoSave" = "afterDelay";
"editor.inlineSuggest.enabled" = true;
"editor.rulers" = [
80
];
"editor.mouseWheelZoom" = true;
"git.autofetch" = true;
"window.zoomLevel" = -1;
"nix.enableLanguageServer" = true;
"latex-workshop.latex.autoBuild.run" = "never";
"latex-workshop.latex.tools" = [
{
"name" = "xelatex";
"command" = "xelatex";
"args" = [
"-synctex=1"
"-interaction=nonstopmode"
"-file-line-error"
"-pdf"
"%DOCFILE%"
];
}
{
"name" = "pdflatex";
"command" = "pdflatex";
"args" = [
"-synctex=1"
"-interaction=nonstopmode"
"-file-line-error"
"%DOCFILE%"
];
}
{
"name" = "bibtex";
"command" = "bibtex";
"args" = [
"%DOCFILE%"
];
}
];
"latex-workshop.latex.recipes" = [
{
"name" = "xelatex";
"tools" = [
"xelatex"
];
}
{
"name" = "pdflatex";
"tools" = [
"pdflatex"
];
}
{
"name" = "xe->bib->xe->xe";
"tools" = [
"xelatex"
"bibtex"
"xelatex"
"xelatex"
];
}
{
"name" = "pdf->bib->pdf->pdf";
"tools" = [
"pdflatex"
"bibtex"
"pdflatex"
"pdflatex"
];
}
];
"[latex]" = {
"editor.formatonpaste" = false;
"editor.suggestselection" = "recentlyusedbyprefix";
"editor.wordwrap" = "bounded";
"editor.wordwrapcolumn" = 100;
"editor.unicodehighlight.allowedlocales" = {
"_os" = true;
"_vscode" = true;
"zh-hans" = true;
"zh-hant" = true;
};
};
};
};
}