-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.nix
141 lines (119 loc) · 3.42 KB
/
home.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{ config, pkgs, ... }:
{
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "24.05";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (pkgs.lib.getName pkg) [ "vscode" ];
home.packages =
[ pkgs.yq pkgs.jwt-cli pkgs.colordiff pkgs.shellcheck pkgs.docker-client ];
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
programs.neovim = {
enable = true;
extraConfig = ''
source ${pkgs.vimPlugins.vim-plug}/plug.vim
source ${./vim/plugins.vim}
set encoding=utf-8
set autoindent
set smartindent
set number
inoremap <C-a> <C-o>^
inoremap <C-e> <C-o>$
'';
};
programs.vscode = { enable = true; };
programs.git = {
enable = true;
userName = "Takuma Suzuki";
userEmail = "[email protected]";
aliases = {
br = "branch";
co = "checkout";
gl = "log --oneline --graph --decorate";
ss = "stash";
sp = "stash pop";
sl = "stash list";
cm = "commit";
cma = "commit --amend";
fixup = "commit --fixup HEAD";
fx = "commit --fixup HEAD";
squash = "commit --squash HEAD";
sq = "commit --squash HEAD";
pukk = ''!echo "(○`3´○)ぷきゅ〜!!" && git pull'';
latest = "!git --no-pager branch --sort=authordate | tail -n 5";
delete-merged =
"!git branch --merged | grep -vE \\\\\\*\\|master | xargs -I % git branch -d %";
};
extraConfig = {
core.editor = pkgs.lib.getExe pkgs.neovim;
init.defaultBranch = "master";
pull = { ff = "only"; };
push = { default = "current"; };
merge = {
conflictStyle = "diff3";
ff = false;
};
rebase = {
autosquash = true;
autostash = true;
};
};
ignores =
[ ".DS_Store" ".direnv" ".vscode" "node_modules/" ".env" "result/" ];
};
programs.gh = {
enable = true;
gitCredentialHelper.enable = true;
settings = {
aliases = {
pc = "pr create --web";
pv = "pr view --web";
b = "browse";
};
};
};
programs.zsh = {
enable = true;
defaultKeymap = "emacs";
dotDir = ".config/zsh";
syntaxHighlighting.enable = true;
shellAliases = {
vim = "nvim";
k = "kubectl";
devinit = "nix flake init -t github:pf-siedler/flake-templates#devshell";
cdg = ''cd "$(git rev-parse --show-toplevel)"'';
};
history = {
extended = true;
path = "${config.xdg.dataHome}/zsh/.zsh_history";
};
envExtra = ''
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
## start lima-docker if it's stopped
#if limactl list | grep -q "lima-docker\s*Stopped"; then
# limactl start lima-docker
#fi
'';
initExtra = ''
export FPATH
. ${./zsh/history.zsh}
source <(kubectl completion zsh)
'';
};
}