-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
237 lines (208 loc) · 7.7 KB
/
Copy pathflake.nix
File metadata and controls
237 lines (208 loc) · 7.7 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
####
## nix build .#darwinConfigurations.mkDarwin.system
## ./result/sw/bin/darwin-rebuild switch --flake ~/Projects/dotfiles#mkDarwin
## darwin-rebuild switch --flake .#mkDarwin
####
{
description = "root & home-manager nix flake";
inputs = {
# nixpkgs url
nixpkgs.url = "github:nixos/nixpkgs/release-26.05";
# nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
# nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
# links configs to home directory
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# system level settings; softwares
darwin = {
url = "github:lnl7/nix-darwin/nix-darwin-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs: {
formatter.aarch64-darwin = inputs.nixpkgs.legacyPackages.aarch64-darwin.alejandra;
darwinConfigurations = {
mkDarwin = inputs.darwin.lib.darwinSystem {
system = "aarch64-darwin";
pkgs = import inputs.nixpkgs {
system = "aarch64-darwin";
config.allowUnfree = true;
};
modules = [
(
{ pkgs, ... }:
{
# darwin configs
programs.fish.enable = true;
environment.shells = [
pkgs.bash
pkgs.fish
];
environment.systemPackages = with pkgs; [
coreutils
ripgrep
ansible
fd
curl
less
lazygit
riffdiff # better diff
tealdeer # fast tldr
alejandra # nix formatter
xh
ripsecrets
atuin
k6 # load testing tool
k9s # cli k8s ide
mise
ncdu
# doom emacs
nixfmt
shfmt
dockfmt
gomodifytags
gotests
gore
black
isort
pipenv
];
system.stateVersion = 5; # don't know why, but it fixes build
system.keyboard.enableKeyMapping = true;
system.keyboard.remapCapsLockToEscape = true;
system.defaults.dock.autohide = false;
system.defaults.NSGlobalDomain.InitialKeyRepeat = 14;
system.defaults.NSGlobalDomain.KeyRepeat = 1;
# system primary user to apply defaults
system.primaryUser = "hanz";
nix.enable = false; # let deterministic nix, handle nix
# extra nix configs
nix.extraOptions = ''
auto-optimise-store = true
experimental-features = nix-command flakes
'';
}
)
inputs.home-manager.darwinModules.home-manager
{
users.users.hanz.home = "/Users/hanz";
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.hanz.imports = [
(
{ pkgs, ... }:
{
home.username = "hanz";
home.homeDirectory = pkgs.lib.mkDefault "/Users/hanz";
### Don't change this when you change package input. Leave it alone. ###
home.stateVersion = "23.05";
### --- ###
home.packages = with pkgs; [
iina # video player for macOS
];
home.sessionVariables = {
PAGER = "less";
CLICLOLOR = 1;
EDITOR = "nvim";
ZELLIJ_AUTO_EXIT = "true";
};
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
# extraPackages = with pkgs; [gcc];
};
programs.zoxide = {
enable = true; # smarter 'cd'
enableFishIntegration = true;
};
programs.bat.enable = true;
programs.fzf.enable = true;
programs.fzf.enableFishIntegration = true;
programs.lsd.enable = true;
programs.lsd.enableFishIntegration = true;
programs.fish = {
enable = true;
shellAliases = {
zj = "zellij";
lg = "lazygit";
gs = "git status -s";
gcom = "git commit";
gpush = "git push";
gpull = "git pull";
glog = "git log";
gdiff = "git diff";
cat = "bat";
n = "nvim";
vim = "nvim";
};
shellInit = ''
mise activate fish | source
atuin init fish | source
if test -x /opt/homebrew/bin/brew
eval "$(/opt/homebrew/bin/brew shellenv)"
end
'';
};
programs.starship =
let
flavour = "mocha"; # One of `latte`, `frappe`, `macchiato`, or `mocha`
in
{
enable = true;
enableFishIntegration = true;
settings = {
# Other config here
format = "$all"; # Remove this line to disable the default prompt format
palette = "catppuccin_${flavour}";
}
// builtins.fromTOML (
builtins.readFile (
pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "starship";
rev = "3e3e54410c3189053f4da7a7043261361a1ed1bc"; # Replace with the latest commit hash
sha256 = "sha256-soEBVlq3ULeiZFAdQYMRFuswIIhI9bclIU8WXjxd7oY=";
}
+ /palettes/${flavour}.toml
)
);
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# configure git
programs.git = {
enable = true;
settings.user.name = "Hanz";
settings.user.email = "haniel56@zoho.eu";
ignores = [
".direnv"
];
settings.pull.rebase = true;
settings.init.defaultBranch = "main";
settings.github.user = "fivehanz";
};
programs.zellij = {
enable = true;
# enableFishIntegration = true;
settings = {
simplified_ui = true;
};
};
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}
)
];
};
}
];
};
};
};
}