-
Notifications
You must be signed in to change notification settings - Fork 0
/
defaults-darwin.nix
216 lines (196 loc) · 5.57 KB
/
defaults-darwin.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
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
{ pkgs, config, lib, inputs, ... }:
let
inherit (lib)
mkIf filterAttrs mapAttrs mapAttrsToList mapAttrs' mkOption types;
filteredInputs = filterAttrs (n: _: n != "self") inputs;
nixPathInputs = mapAttrsToList (n: v: "${n}=${v}") filteredInputs;
registryInputs = mapAttrs (_: v: { flake = v; }) filteredInputs;
nur-packages = with pkgs.nur.repos; [
devins2518.bunnyfetch-rs
devins2518.platformio
# devins2518.gyro
];
tex = (pkgs.texlive.combine { inherit (pkgs.texlive) scheme-full syntax; });
in rec {
home-manager.useUserPackages = true;
home-manager.useGlobalPkgs = true;
environment = {
variables = { NIXOS_CONFIG = "/Users/devin/Repos/dotfiles"; };
};
users = {
users = {
devin = {
name = "devin";
shell = pkgs.zsh;
description = "Devin Singh";
home = "/Users/devin";
};
};
};
nix = {
extraOptions = ''
experimental-features = nix-command flakes
'';
registry = registryInputs;
gc = {
automatic = false;
user = "root";
options = "--delete-older-than 7d";
};
nixPath = {
nixpkgs = "${pkgs.path}";
darwin-config =
"$HOME/Repos/dotfiles/hosts/Devins-MacBook-Pro/configuration.nix";
# home-manager = "${inputs.home-manager}";
darwin = "${inputs.darwin}";
};
settings = {
trusted-users = [ "root" "devin" ];
substituters = [
"https://cache.nixos.org?priority=10"
"https://nix-community.cachix.org"
"https://fortuneteller2k.cachix.org"
"https://devins2518.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"fortuneteller2k.cachix.org-1:kXXNkMV5yheEQwT0I4XYh1MaCSz+qg72k8XAi2PthJI="
"devins2518.cachix.org-1:VQepMECpWpT95AjVOU30xz6kbrBRUMpHAOdKP/tulB0="
];
};
};
nixpkgs.config = { allowUnfree = true; };
environment.systemPackages = with pkgs;
[
bottom
cachix
cargo-flamegraph
clang-tools
direnv
discord
ffmpeg
gimp
gnumake
hyperfine
iterm2
jq
luaformatter
meson
nil
ninja
nixfmt
nixpkgs-review
ocamlformat
python311Packages.python-lsp-server
ripgrep
rust-analyzer
stylish-haskell
sumneko-lua-language-server
svlint
svls
texlab
tex
tokei
tree
unzip
# verible
wget
xxd
inputs.zls-master.packages.${pkgs.system}.default
zigpkgs.master
zsh
] ++ nur-packages ++
[
(fenix.complete.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
])
# (emacsWithPackagesFromUsePackage {
# config = ./HM/emacs/init.el;
# package = pkgs.emacsGcc;
# alwaysEnsure = true;
# extraEmacsPackages = epkgs:
# with epkgs; [
# # Dylib broken on M1
# tree-sitter
# # tree-sitter-langs
# all-the-icons
# dashboard
# doom-themes
# evil
# evil-collection
# evil-numbers
# evil-surround
# evil-surround
# general
# highlight-indent-guides
# key-chord
# lsp-mode
# projectile
# rainbow-delimiters
# smartparens
# treemacs
# flycheck
# company
# flycheck-inline
# lsp-mode
# lsp-ui
# treemacs-evil
# use-package
# which-key
# esup
# ];
# })
];
programs = {
gnupg.agent.enable = true;
zsh = {
enable = true;
enableCompletion = false;
};
};
system.activationScripts.applications.text = lib.mkForce ''
echo "setting up ~/Applications..." >&2
applications="/Users/devin/Applications"
nix_apps="$applications/Nix Apps"
# Needs to be writable by the user so that home-manager can symlink into it
if ! test -d "$applications"; then
mkdir -p "$applications"
chown devin "$applications"
chmod u+w "$applications"
fi
# Delete the directory to remove old links
rm -rf "$nix_apps"
mkdir -p "$nix_apps"
find ${config.system.build.applications}/Applications -maxdepth 1 -type l -exec readlink '{}' + |
while read src; do
# Spotlight does not recognize symlinks, it will ignore directory we link to the applications folder.
# It does understand MacOS aliases though, a unique filesystem feature. Sadly they cannot be created
# from bash (as far as I know), so we use the oh-so-great Apple Script instead.
osascript -e "
set fileToAlias to POSIX file \"$src\"
set applicationsFolder to POSIX file \"$nix_apps\"
tell application \"Finder\"
make alias file to fileToAlias at applicationsFolder
# This renames the alias; 'mpv.app alias' -> 'mpv.app'
set name of result to \"$(rev <<< "$src" | cut -d'/' -f1 | rev)\"
end tell
" 1>/dev/null
done
'';
fonts = {
fontDir = { enable = true; };
fonts = with pkgs; [
(nerdfonts.override { fonts = [ "FiraCode" "JetBrainsMono" ]; })
font-awesome
material-design-icons
nur.repos.devins2518.iosevka-serif
tenderness
spleen
];
};
}