-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
242 lines (225 loc) · 5.11 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
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
238
239
240
# default.nix
#
# Default packages I like to have available at my fingertips.
#
# To install NixOS, run this:
#
# bash <(curl https://nixos.org/nix/install)
#
# To install these, run something like:
#
# nix-env -f default.nix -i --remove-all
#
# (The "--remove-all" flag removes packages that were installed
# previously; this is good if we want to remove packages from here.)
# The following has been an attempt to adapt
#
# https://www.nmattia.com/posts/2018-03-21-nix-reproducible-setup-linux-macos.html
####let
#### #pkgs = with import <nixpkgs> {};
####
#### ### Things I wish to configure (eventually)
#### # bashrc = ...;
#### # git = ...;
#### # tmux = ...;
#### # vim = ...;
#### # emacs = ...;
#### # mysql = ...;
#### # etc...
####
#### #friendlies = with pkgs;
#### friendlies = with import <nixpkgs>;
#### [
#### # Customizable packages
#### ##git
#### ##tmux
#### ##vim
#### ##emacs
####
#### # Sourced directly from Nixpkgs
#### # but should be customized
#### pkgs.tmux
#### pkgs.vim
#### pkgs.emacs
#### pkgs.git
####
#### # Sourced directly from Nixpkgs
#### pkgs.ag
#### pkgs.grcat
#### pkgs.htop
#### pkgs.diff-so-fancy
#### pkgs.tldr
#### pkgs.tree
#### pkgs.bat
#### pkgs.exa
####
#### pkgs.watch
#### pkgs.pv
#### ];
####in friendlies
##### The following is an attempt to adapt
#####
##### https://hugoreeves.com/posts/2019/nix-home/
####{ config, pkgs, ... };
####
####{
#### home.packages = with packages;
#### [
#### # Customizable packages
#### ##git
#### ##tmux
#### ##vim
#### ##emacs
####
#### # Sourced directly from Nixpkgs
#### # but should be customized
#### tmux
#### vim
#### emacs
#### git
####
#### # Sourced directly from Nixpkgs
#### ag
#### grcat
#### htop
#### diff-so-fancy
#### tldr
#### tree
#### bat
#### exa
####
#### watch
#### pv
#### ];
####}
##### The following is an attempt to just adapt a default.nix
##### from a project file. Crossing my fingers and hoping for the best!
#####
##### This seems to build almost correcty, but doesn't leave things in a usable state.
####with import <nixpkgs> {};
####
####stdenv.mkDerivation rec {
#### name = "home-utilities";
####
#### env = buildEnv { name = name; paths = buildInputs; };
####
#### # Note that Nix has an elegant way to handle the "Python37Packages"
#### # prefix, but it will take some time coming to terms with Nix syntax
#### # to take advantage of it.
#### buildInputs = [
#### # Customizable packages
#### ##git
#### ##tmux
#### ##vim
#### ##emacs
####
#### # Sourced directly from Nixpkgs
#### # but should be customized
#### tmux
#### vim
#### emacs
#### git
####
#### # Sourced directly from Nixpkgs
#### ag
#### grc
#### htop
#### #diff-so-fancy
#### tldr
#### tree
#### bat
#### exa
####
#### watch
#### pv
#### ];
####}
##### Now I'm going to try this:
#####
##### https://discourse.nixos.org/t/declarative-package-management-for-normal-users/1823/5
#####
##### And then run
#####
##### nix-env -irf ~/.config/nixpkgs/packages.nix
####{ pkgs ? import <nixos> {} }:
####
####with pkgs; {
#### # Customizable packages
#### ##git
#### ##tmux
#### ##vim
#### ##emacs
####
#### # Sourced directly from Nixpkgs
#### # but should be customized
#### tmux
#### vim
#### emacs
#### git
####
#### # Sourced directly from Nixpkgs
#### #ag
#### silver-searcher
#### grc
#### htop
#### #diff-so-fancy
#### tldr
#### tree
#### bat
#### exa
####
#### watch
#### pv
####}
# Now I'm going to try this, put in the file "~/.config/nixpkgs/config.nix":
#
# https://nixos.org/nixpkgs/manual/#sec-declarative-package-management
#
# And then try to run this:
#
# nix-env -iA nixpkgs.myPackages
#
# Ok, that works! I now need to create the symbolic links for config.nix...
{
packageOverrides = pkgs: with pkgs; {
myProfile = writeText "my-profile" ''
export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin
export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man
export INFOPATH=$HOME/.nix-profile/share/info:/nix/var/nix/profiles/default/share/info:/usr/share/info
'';
myPackages = pkgs.buildEnv {
name = "my-packages";
paths = [
(runCommand "profile" {} ''
mkdir -p $out/etc/profile.d
cp ${myProfile} $out/etc/profile.d/my-profile.sh
'')
# Customizable packages
##git
##tmux
##vim
##emacs
# Sourced directly from Nixpkgs
# but should be customized
tmux
vim
emacs
git
# Sourced directly from Nixpkgs
#ag
silver-searcher
grc
htop
#diff-so-fancy
tldr
tree
bat
exa
watch
pv
];
pathsToLink = [ "/share/man" "/share/doc" "/bin" ];
extraOutputsToInstall = [ "man" "doc" ];
};
};
}