forked from jwiegley/nix-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
166 lines (137 loc) · 3.8 KB
/
Makefile
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
REMOTE = vulcan
CACHE = /Volumes/slim/Cache
ROOTS = /nix/var/nix/gcroots/per-user/johnw/shells
PROJS = src/async-pool \
src/bindings-DSL \
src/c2hsc \
src/git-all \
src/hierarchy \
src/hnix \
src/hours \
src/logging \
src/monad-extras \
src/numbers \
src/parsec-free \
src/pipes-async \
src/pipes-files \
src/pushme \
src/recursors \
src/runmany \
src/sitebuilder \
src/sizes \
src/una \
src/z3-generate-api \
\
bae/micromht-fiat-deliverable/atif-fiat \
bae/micromht-fiat-deliverable/atif-fiat/stanag4607 \
bae/micromht-fiat-deliverable/atif-monitors/hmon/hsmedl
# bae/micromht-deliverable/rings-dashboard/mitll-harness \
# bae/micromht-deliverable/rings-dashboard/rings-dashboard-api \
# bae/micromht-deliverable/rings-dashboard
PENVS = emacs26Env \
coq87Env \
ghc82Env \
ledgerPy3Env
ENVS = emacsHEADEnv \
emacs26Env \
emacs26DebugEnv \
coqHEADEnv \
coq88Env \
coq87Env \
coq86Env \
coq85Env \
coq84Env \
ghc84Env \
ghc82Env \
ghc80Env \
ledgerPy2Env \
ledgerPy3Env
all: switch env-all shells
switch: darwin-switch home-switch
darwin-switch:
darwin-rebuild switch -Q
@echo "Darwin generation: $$(darwin-rebuild --list-generations | tail -1)"
darwin-build:
nix build --keep-going darwin.system
@rm result
home-switch:
home-manager switch
@echo "Home generation: $$(home-manager generations | head -1)"
home-build:
nix build -f ~/src/nix/home-manager/home-manager/home-manager.nix \
--argstr confPath "$(HOME_MANAGER_CONFIG)" \
--argstr confAttr "" activationPackage \
--keep-going
@rm result
shells:
-find ~/bae/ ~/src/ -name .hdevtools.sock -delete
for i in $(PROJS); do \
cd $(HOME)/$$i; \
echo Pre-building shell env for $$i; \
testit --make; \
rm -f result; \
done
env-all:
for i in $(ENVS); do \
echo Updating $$i; \
nix-env -f '<darwin>' -u --leq -Q -k -A pkgs.$$i ; \
done
@echo "Nix generation: $$(nix-env --list-generations | tail -1)"
env-all-build:
for i in $(ENVS); do \
echo Building $$i; \
nix build --keep-going darwin.pkgs.$$i ; \
done
@rm result
env:
for i in $(PENVS); do \
echo Updating $$i; \
nix-env -f '<darwin>' -u --leq -Q -k -A pkgs.$$i ; \
done
env-build:
for i in $(PENVS); do \
echo Building $$i; \
nix build --keep-going darwin.pkgs.$$i ; \
done
@rm result
build: darwin-build home-build env-build
build-all: darwin-build home-build env-all-build
pull:
(cd darwin && git pull --rebase)
(cd home-manager && git pull --rebase)
(cd nixpkgs && git pull --rebase)
tag-before:
git --git-dir=nixpkgs/.git branch -f before-update HEAD
tag-working:
git --git-dir=nixpkgs/.git branch -f last-known-good before-update
git --git-dir=nixpkgs/.git branch -D before-update
mirror:
git --git-dir=nixpkgs/.git push github -f unstable:unstable
git --git-dir=darwin/.git push --mirror jwiegley
git --git-dir=home-manager/.git push --mirror jwiegley
working: tag-working mirror
update: tag-before pull build-all switch env-all shells working cache
copy:
nix copy --all --keep-going --to ssh://$(REMOTE)
cache:
test -d $(CACHE) && \
(find /nix/store -maxdepth 1 -type f \
\( -name '*.dmg' -o \
-name '*.zip' -o \
-name '*.pkg' -o \
-name '*.el' -o \
-name '*.7z' -o \
-name '*gz' -o \
-name '*xz' -o \
-name '*bz2' -o \
-name '*.tar' \) -print0 \
| parallel -0 nix copy --to file://$(CACHE))
# find $(HOME) \
# \( -name dist -type d -o \
# -name result -type l \) -print0 \
# | parallel -0 /bin/rm -fr {}
gc:
nix-collect-garbage --delete-older-than 14d
gc-all: gc
nix-collect-garbage -d
### Makefile ends here