-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
136 lines (122 loc) · 3.8 KB
/
default.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
{ inputs, config, pkgs, lib, ... }:
{
imports = [
./brew.nix
./preferences.nix
./spacebar.nix
];
#####################
# Nix configuration #
#####################
# nixpkgs.overlays = [
# inputs.nur.overlay
# inputs.emacs-overlay.overlay
# ];
nix = {
package = pkgs.nixStable;
extraOptions = ''
keep-outputs = true
keep-derivations = true
${lib.optionalString (config.nix.package == pkgs.nixStable)
"experimental-features = nix-command flakes"}
'';
gc = {
automatic = true;
options = "--delete-older-than 30d";
};
settings = {
max-jobs = 8;
cores = 8;
substituters = [
https://cache.nixos.org
https://nix-community.cachix.org
# https://mjlbach.cachix.org
# https://gccemacs-darwin.cachix.org
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
# "mjlbach.cachix.org-1:dR0V90mvaPbXuYria5mXvnDtFibKYqYc2gtl9MWSkqI="
# "gccemacs-darwin.cachix.org-1:E0Q1uCBvxw58kfgoWtlletUjzINF+fEIkWknAKBnPhs="
];
};
nixPath = [
"nixpkgs=/etc/${config.environment.etc.nixpkgs.target}"
"home-manager=/etc/${config.environment.etc.home-manager.target}"
"darwin=/etc/${config.environment.etc.darwin.target}"
];
};
########################
# System configuration #
########################
# Fonts
fonts = {
fontDir.enable = true;
# fonts declared with home-manager
};
networking = {
dns = [
"1.1.1.1"
"8.8.8.8"
];
};
# time.timeZone = "Europe/Paris";
services.nix-daemon.enable = true;
# Recreate /run/current-system symlink after boot
# services.activate-system.enable = true;
# services.gpg-agent.enable = true;
# services.keybase.enable = true;
# services.lorri.enable = true;
################
# environment #
################
environment = {
etc = {
home-manager.source = "${inputs.home-manager}";
nixpkgs.source = "${inputs.nixpkgs}";
darwin.source = "${inputs.darwin}";
};
extraInit = ''
# install homebrew
command -v brew > /dev/null || ${pkgs.bash}/bin/bash -c "$(${pkgs.curl}/bin/curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
'';
# loginShell = pkgs.fish;
pathsToLink = [ "/Applications" ];
shells = [ pkgs.zsh ];
# systemPackages = [ ];
systemPath = [
# "/run/current-system/sw/bin/" # TODO how to avoid hardcoding?
"$HOME/.npm-packages/bin"
"$HOME/.poetry/bin"
"/Users/cambiaghiluca/.modular/pkg/packages.modular.com_mojo/bin"
# "$HOME/.emacs.d/bin"
# "$HOME/git/doom-emacs/bin"
# "/opt/homebrew/bin"
# "/usr/local/homebrew/bin"
# TODO: /usr/local/bin
# "$HOME/bin"
];
variables = {
EDITOR = "emacsclient";
KUBE_EDITOR="emacsclient";
LC_ALL="en_US.UTF-8";
# CLOJURE_LOAD_PATH="$HOME/git/clojure-clr/bin/4.0/Release/"; # NOTE this needs to be present and compiled
EMACS="/Applications/Emacs.app/Contents/MacOS/Emacs";
SHELL = "${pkgs.zsh}/bin/zsh";
LIBRARY_PATH="$(brew --prefix)/lib";
CPATH="$(brew --prefix)/include";
CFLAGS="-I$(brew --prefix openssl)/include";
LDFLAGS="-L$(brew --prefix openssl)/lib";
MODULAR_HOME="$HOME/.modular";
# OPENSSL_ROOT_DIR="/opt/homebrew/Cellar/openssl@3/3.0.7/";
# BROWSER = "firefox";
# OPENTYPEFONTS="$HOME/.nix-profile/share/fonts/opentype//:";
};
};
programs.fish.enable = false;
programs.zsh.enable = true;
programs.bash.enable = true;
programs.nix-index.enable = true;
# Used for backwards compatibility, please read the changelog before changing.
system.stateVersion = 4;
}