+8
.direnv/bin/nix-direnv-reload
+8
.direnv/bin/nix-direnv-reload
···
1
+
#!/usr/bin/env bash
2
+
dir="$(realpath $(dirname ${BASH_SOURCE[0]})/../..)"
3
+
_nix_direnv_force_reload=1 direnv exec "$dir" true
4
+
direnv reload
5
+
# direnv reload updates the mtime of .envrc. Also update the timestamp of the
6
+
# profile_rc file to keep track that we actually are up to date.
7
+
touch $dir/.direnv/{nix,flake}-profile-*.rc
8
+
+1863
.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc
+1863
.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc
···
1
+
unset shellHook
2
+
PATH=${PATH:-}
3
+
nix_saved_PATH="$PATH"
4
+
XDG_DATA_DIRS=${XDG_DATA_DIRS:-}
5
+
nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS"
6
+
AR='ar'
7
+
export AR
8
+
AS='as'
9
+
export AS
10
+
BASH='/nix/store/7dpxg7ki7g8ynkdwcqf493p2x8divb4i-bash-5.2-p15/bin/bash'
11
+
CC='gcc'
12
+
export CC
13
+
CONFIG_SHELL='/nix/store/7dpxg7ki7g8ynkdwcqf493p2x8divb4i-bash-5.2-p15/bin/bash'
14
+
export CONFIG_SHELL
15
+
CXX='g++'
16
+
export CXX
17
+
HOSTTYPE='x86_64'
18
+
HOST_PATH='/nix/store/m38gwq0w8w7qyjn9s00balyp7cv3m5p9-coreutils-9.3/bin:/nix/store/01znf87kiw5xx1dj0f7djrnrbg84ij28-findutils-4.9.0/bin:/nix/store/vq4vmndw555m7ld2bi6pq8kr348qvb6a-diffutils-3.10/bin:/nix/store/rwa7qyds01qzxvq7zq3kgnkrzzpw4s66-gnused-4.9/bin:/nix/store/n062zcsmfl9gfp6vfkcg0asb8jjwmy5i-gnugrep-3.11/bin:/nix/store/4v7m4yx07b3anmbznfhihjc8xiizyna9-gawk-5.2.2/bin:/nix/store/mi3pm67ps7c7k11aqki9182ygzg8j503-gnutar-1.35/bin:/nix/store/5c0ancqnpi0cf1h49mv13w68a950s9z0-gzip-1.13/bin:/nix/store/q5cv7r1sh3s4niyq7vm6h1j74394naxs-bzip2-1.0.8-bin/bin:/nix/store/bh7sbl99ygfvw9w96936nrhw46jmcmqq-gnumake-4.4.1/bin:/nix/store/7dpxg7ki7g8ynkdwcqf493p2x8divb4i-bash-5.2-p15/bin:/nix/store/mbh9gx43gsc5av019vsdkazbyiic3f0f-patch-2.7.6/bin:/nix/store/3q6fnwcm677l1q60vkhcf9m1gxhv83jm-xz-5.4.4-bin/bin:/nix/store/a5s2dmba16pw8l52f496gw0b7nli7mbn-file-5.45/bin'
19
+
export HOST_PATH
20
+
IFS='
21
+
'
22
+
IN_NIX_SHELL='impure'
23
+
export IN_NIX_SHELL
24
+
LD='ld'
25
+
export LD
26
+
LINENO='76'
27
+
MACHTYPE='x86_64-pc-linux-gnu'
28
+
NIX_BINTOOLS='/nix/store/qcg3rpl1l103zb1xfsw40wm9j5hzrp7y-binutils-wrapper-2.40'
29
+
export NIX_BINTOOLS
30
+
NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1'
31
+
export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu
32
+
NIX_BUILD_CORES='4'
33
+
export NIX_BUILD_CORES
34
+
NIX_CC='/nix/store/vylmp73qymnv4siaqn1kl2hghj07hrj8-gcc-wrapper-12.3.0'
35
+
export NIX_CC
36
+
NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1'
37
+
export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu
38
+
NIX_CFLAGS_COMPILE=' -frandom-seed=q6hnwi6rdy -isystem /nix/store/hsv5438lvzq106llix5xi0f7cdvqk95q-nix-2.18.1-dev/include -isystem /nix/store/gdz3j02p6mfzmxs9zsssszwpppigb70g-boehm-gc-8.2.2-dev/include -isystem /nix/store/d7jspi1ws93ya34zriyrdxz5v5z6lijj-nlohmann_json-3.11.2/include -isystem /nix/store/hsv5438lvzq106llix5xi0f7cdvqk95q-nix-2.18.1-dev/include -isystem /nix/store/gdz3j02p6mfzmxs9zsssszwpppigb70g-boehm-gc-8.2.2-dev/include -isystem /nix/store/d7jspi1ws93ya34zriyrdxz5v5z6lijj-nlohmann_json-3.11.2/include'
39
+
export NIX_CFLAGS_COMPILE
40
+
NIX_CONFIG='experimental-features = nix-command flakes'
41
+
export NIX_CONFIG
42
+
NIX_ENFORCE_NO_NATIVE='1'
43
+
export NIX_ENFORCE_NO_NATIVE
44
+
NIX_HARDENING_ENABLE='fortify fortify3 stackprotector pic strictoverflow format relro bindnow'
45
+
export NIX_HARDENING_ENABLE
46
+
NIX_LDFLAGS='-rpath /home/anish/usr/helm/outputs/out/lib -L/nix/store/gfmmah5rc4vl8mhli495lh5savq842p0-boehm-gc-8.2.2/lib -L/nix/store/j7nl2pj606d8ld5818hw3z3fbz00sdc5-nix-2.18.1/lib -L/nix/store/gfmmah5rc4vl8mhli495lh5savq842p0-boehm-gc-8.2.2/lib -L/nix/store/j7nl2pj606d8ld5818hw3z3fbz00sdc5-nix-2.18.1/lib'
47
+
export NIX_LDFLAGS
48
+
NIX_NO_SELF_RPATH='1'
49
+
NIX_STORE='/nix/store'
50
+
export NIX_STORE
51
+
NM='nm'
52
+
export NM
53
+
OBJCOPY='objcopy'
54
+
export OBJCOPY
55
+
OBJDUMP='objdump'
56
+
export OBJDUMP
57
+
OLDPWD=''
58
+
export OLDPWD
59
+
OPTERR='1'
60
+
OSTYPE='linux-gnu'
61
+
PATH='/nix/store/j7nl2pj606d8ld5818hw3z3fbz00sdc5-nix-2.18.1/bin:/nix/store/p3s38kgwd16d2dimspckp5f1rri43mnq-home-manager-unstable-2023-12-31/bin:/nix/store/pz4jng8kb4iv9x67r730las2mdkv8s8q-git-2.42.0/bin:/nix/store/p8p72q6anyf0whaf9i75jynzk2z4ml36-agenix-0.13.0/bin:/nix/store/lfx4in7iqbbx5b6b85cndw268ria5512-deploy-rs-unstable-2023-12-20/bin:/nix/store/8nwmr2kmkrl1mnggka7fjibcglk68rc0-dnscontrol-4.6.0/bin:/nix/store/h3ayxf5dk1gdf3s5716fh1ys815qxxag-patchelf-0.15.0/bin:/nix/store/vylmp73qymnv4siaqn1kl2hghj07hrj8-gcc-wrapper-12.3.0/bin:/nix/store/f94yr35af3xdiscbj6cp6kafvmn55gv9-gcc-12.3.0/bin:/nix/store/vksrk76p5cfbjxb0n95vdkxy7fl2cbcm-glibc-2.38-27-bin/bin:/nix/store/m38gwq0w8w7qyjn9s00balyp7cv3m5p9-coreutils-9.3/bin:/nix/store/qcg3rpl1l103zb1xfsw40wm9j5hzrp7y-binutils-wrapper-2.40/bin:/nix/store/idiaraknw071d20nlqp49s18gbvw4wa0-binutils-2.40/bin:/nix/store/m38gwq0w8w7qyjn9s00balyp7cv3m5p9-coreutils-9.3/bin:/nix/store/01znf87kiw5xx1dj0f7djrnrbg84ij28-findutils-4.9.0/bin:/nix/store/vq4vmndw555m7ld2bi6pq8kr348qvb6a-diffutils-3.10/bin:/nix/store/rwa7qyds01qzxvq7zq3kgnkrzzpw4s66-gnused-4.9/bin:/nix/store/n062zcsmfl9gfp6vfkcg0asb8jjwmy5i-gnugrep-3.11/bin:/nix/store/4v7m4yx07b3anmbznfhihjc8xiizyna9-gawk-5.2.2/bin:/nix/store/mi3pm67ps7c7k11aqki9182ygzg8j503-gnutar-1.35/bin:/nix/store/5c0ancqnpi0cf1h49mv13w68a950s9z0-gzip-1.13/bin:/nix/store/q5cv7r1sh3s4niyq7vm6h1j74394naxs-bzip2-1.0.8-bin/bin:/nix/store/bh7sbl99ygfvw9w96936nrhw46jmcmqq-gnumake-4.4.1/bin:/nix/store/7dpxg7ki7g8ynkdwcqf493p2x8divb4i-bash-5.2-p15/bin:/nix/store/mbh9gx43gsc5av019vsdkazbyiic3f0f-patch-2.7.6/bin:/nix/store/3q6fnwcm677l1q60vkhcf9m1gxhv83jm-xz-5.4.4-bin/bin:/nix/store/a5s2dmba16pw8l52f496gw0b7nli7mbn-file-5.45/bin'
62
+
export PATH
63
+
PS4='+ '
64
+
RANLIB='ranlib'
65
+
export RANLIB
66
+
READELF='readelf'
67
+
export READELF
68
+
SIZE='size'
69
+
export SIZE
70
+
SOURCE_DATE_EPOCH='315532800'
71
+
export SOURCE_DATE_EPOCH
72
+
STRINGS='strings'
73
+
export STRINGS
74
+
STRIP='strip'
75
+
export STRIP
76
+
XDG_DATA_DIRS='/nix/store/gfmmah5rc4vl8mhli495lh5savq842p0-boehm-gc-8.2.2/share:/nix/store/d7jspi1ws93ya34zriyrdxz5v5z6lijj-nlohmann_json-3.11.2/share:/nix/store/j7nl2pj606d8ld5818hw3z3fbz00sdc5-nix-2.18.1/share:/nix/store/p3s38kgwd16d2dimspckp5f1rri43mnq-home-manager-unstable-2023-12-31/share:/nix/store/pz4jng8kb4iv9x67r730las2mdkv8s8q-git-2.42.0/share:/nix/store/h3ayxf5dk1gdf3s5716fh1ys815qxxag-patchelf-0.15.0/share'
77
+
export XDG_DATA_DIRS
78
+
__structuredAttrs=''
79
+
export __structuredAttrs
80
+
buildInputs=''
81
+
export buildInputs
82
+
buildPhase='{ echo "------------------------------------------------------------";
83
+
echo " WARNING: the existence of this path is not guaranteed.";
84
+
echo " It is an internal implementation detail for pkgs.mkShell.";
85
+
echo "------------------------------------------------------------";
86
+
echo;
87
+
# Record all build inputs as runtime dependencies
88
+
export;
89
+
} >> "$out"
90
+
'
91
+
export buildPhase
92
+
builder='/nix/store/7dpxg7ki7g8ynkdwcqf493p2x8divb4i-bash-5.2-p15/bin/bash'
93
+
export builder
94
+
cmakeFlags=''
95
+
export cmakeFlags
96
+
configureFlags=''
97
+
export configureFlags
98
+
defaultBuildInputs=''
99
+
defaultNativeBuildInputs='/nix/store/h3ayxf5dk1gdf3s5716fh1ys815qxxag-patchelf-0.15.0 /nix/store/v5qyd49a256y44pz75qnsp9741mg336k-update-autotools-gnu-config-scripts-hook /nix/store/h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh /nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh /nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/jivxp510zxakaaic7qkrb7v1dd2rdbw9-multiple-outputs.sh /nix/store/wzdsbnv2ba3nj91aql8jjdddfmkkdh7h-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh /nix/store/wmknncrif06fqxa16hpdldhixk95nds0-strip.sh /nix/store/vylmp73qymnv4siaqn1kl2hghj07hrj8-gcc-wrapper-12.3.0'
100
+
depsBuildBuild=''
101
+
export depsBuildBuild
102
+
depsBuildBuildPropagated=''
103
+
export depsBuildBuildPropagated
104
+
depsBuildTarget=''
105
+
export depsBuildTarget
106
+
depsBuildTargetPropagated=''
107
+
export depsBuildTargetPropagated
108
+
depsHostHost=''
109
+
export depsHostHost
110
+
depsHostHostPropagated=''
111
+
export depsHostHostPropagated
112
+
depsTargetTarget=''
113
+
export depsTargetTarget
114
+
depsTargetTargetPropagated=''
115
+
export depsTargetTargetPropagated
116
+
doCheck=''
117
+
export doCheck
118
+
doInstallCheck=''
119
+
export doInstallCheck
120
+
dontAddDisableDepTrack='1'
121
+
export dontAddDisableDepTrack
122
+
declare -a envBuildBuildHooks=()
123
+
declare -a envBuildHostHooks=()
124
+
declare -a envBuildTargetHooks=()
125
+
declare -a envHostHostHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' )
126
+
declare -a envHostTargetHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' )
127
+
declare -a envTargetTargetHooks=()
128
+
declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' )
129
+
guess='4'
130
+
initialPath='/nix/store/m38gwq0w8w7qyjn9s00balyp7cv3m5p9-coreutils-9.3 /nix/store/01znf87kiw5xx1dj0f7djrnrbg84ij28-findutils-4.9.0 /nix/store/vq4vmndw555m7ld2bi6pq8kr348qvb6a-diffutils-3.10 /nix/store/rwa7qyds01qzxvq7zq3kgnkrzzpw4s66-gnused-4.9 /nix/store/n062zcsmfl9gfp6vfkcg0asb8jjwmy5i-gnugrep-3.11 /nix/store/4v7m4yx07b3anmbznfhihjc8xiizyna9-gawk-5.2.2 /nix/store/mi3pm67ps7c7k11aqki9182ygzg8j503-gnutar-1.35 /nix/store/5c0ancqnpi0cf1h49mv13w68a950s9z0-gzip-1.13 /nix/store/q5cv7r1sh3s4niyq7vm6h1j74394naxs-bzip2-1.0.8-bin /nix/store/bh7sbl99ygfvw9w96936nrhw46jmcmqq-gnumake-4.4.1 /nix/store/7dpxg7ki7g8ynkdwcqf493p2x8divb4i-bash-5.2-p15 /nix/store/mbh9gx43gsc5av019vsdkazbyiic3f0f-patch-2.7.6 /nix/store/3q6fnwcm677l1q60vkhcf9m1gxhv83jm-xz-5.4.4-bin /nix/store/a5s2dmba16pw8l52f496gw0b7nli7mbn-file-5.45'
131
+
mesonFlags=''
132
+
export mesonFlags
133
+
name='nix-shell-env'
134
+
export name
135
+
nativeBuildInputs='/nix/store/hsv5438lvzq106llix5xi0f7cdvqk95q-nix-2.18.1-dev /nix/store/p3s38kgwd16d2dimspckp5f1rri43mnq-home-manager-unstable-2023-12-31 /nix/store/pz4jng8kb4iv9x67r730las2mdkv8s8q-git-2.42.0 /nix/store/p8p72q6anyf0whaf9i75jynzk2z4ml36-agenix-0.13.0 /nix/store/lfx4in7iqbbx5b6b85cndw268ria5512-deploy-rs-unstable-2023-12-20 /nix/store/8nwmr2kmkrl1mnggka7fjibcglk68rc0-dnscontrol-4.6.0'
136
+
export nativeBuildInputs
137
+
out='/home/anish/usr/helm/outputs/out'
138
+
export out
139
+
outputBin='out'
140
+
outputDev='out'
141
+
outputDevdoc='REMOVE'
142
+
outputDevman='out'
143
+
outputDoc='out'
144
+
outputInclude='out'
145
+
outputInfo='out'
146
+
outputLib='out'
147
+
outputMan='out'
148
+
outputs='out'
149
+
export outputs
150
+
patches=''
151
+
export patches
152
+
phases='buildPhase'
153
+
export phases
154
+
pkg='/nix/store/vylmp73qymnv4siaqn1kl2hghj07hrj8-gcc-wrapper-12.3.0'
155
+
declare -a pkgsBuildBuild=()
156
+
declare -a pkgsBuildHost=('/nix/store/hsv5438lvzq106llix5xi0f7cdvqk95q-nix-2.18.1-dev' '/nix/store/gdz3j02p6mfzmxs9zsssszwpppigb70g-boehm-gc-8.2.2-dev' '/nix/store/gfmmah5rc4vl8mhli495lh5savq842p0-boehm-gc-8.2.2' '/nix/store/d7jspi1ws93ya34zriyrdxz5v5z6lijj-nlohmann_json-3.11.2' '/nix/store/j7nl2pj606d8ld5818hw3z3fbz00sdc5-nix-2.18.1' '/nix/store/p3s38kgwd16d2dimspckp5f1rri43mnq-home-manager-unstable-2023-12-31' '/nix/store/pz4jng8kb4iv9x67r730las2mdkv8s8q-git-2.42.0' '/nix/store/p8p72q6anyf0whaf9i75jynzk2z4ml36-agenix-0.13.0' '/nix/store/lfx4in7iqbbx5b6b85cndw268ria5512-deploy-rs-unstable-2023-12-20' '/nix/store/8nwmr2kmkrl1mnggka7fjibcglk68rc0-dnscontrol-4.6.0' '/nix/store/h3ayxf5dk1gdf3s5716fh1ys815qxxag-patchelf-0.15.0' '/nix/store/v5qyd49a256y44pz75qnsp9741mg336k-update-autotools-gnu-config-scripts-hook' '/nix/store/h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh' '/nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh' '/nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/jivxp510zxakaaic7qkrb7v1dd2rdbw9-multiple-outputs.sh' '/nix/store/wzdsbnv2ba3nj91aql8jjdddfmkkdh7h-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh' '/nix/store/wmknncrif06fqxa16hpdldhixk95nds0-strip.sh' '/nix/store/vylmp73qymnv4siaqn1kl2hghj07hrj8-gcc-wrapper-12.3.0' '/nix/store/qcg3rpl1l103zb1xfsw40wm9j5hzrp7y-binutils-wrapper-2.40' )
157
+
declare -a pkgsBuildTarget=()
158
+
declare -a pkgsHostHost=()
159
+
declare -a pkgsHostTarget=()
160
+
declare -a pkgsTargetTarget=()
161
+
declare -a postFixupHooks=('_makeSymlinksRelativeInAllOutputs' '_multioutPropagateDev' )
162
+
declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' )
163
+
declare -a preConfigureHooks=('_multioutConfig' )
164
+
preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase'
165
+
declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' )
166
+
preferLocalBuild='1'
167
+
export preferLocalBuild
168
+
prefix='/home/anish/usr/helm/outputs/out'
169
+
declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' )
170
+
propagatedBuildInputs=''
171
+
export propagatedBuildInputs
172
+
declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' )
173
+
propagatedNativeBuildInputs=''
174
+
export propagatedNativeBuildInputs
175
+
declare -a propagatedTargetDepFiles=('propagated-target-target-deps' )
176
+
shell='/nix/store/7dpxg7ki7g8ynkdwcqf493p2x8divb4i-bash-5.2-p15/bin/bash'
177
+
export shell
178
+
shellHook=''
179
+
export shellHook
180
+
stdenv='/nix/store/kv5wkk7xgc8paw9azshzlmxraffqcg0i-stdenv-linux'
181
+
export stdenv
182
+
strictDeps=''
183
+
export strictDeps
184
+
system='x86_64-linux'
185
+
export system
186
+
declare -a unpackCmdHooks=('_defaultUnpack' )
187
+
_accumFlagsArray ()
188
+
{
189
+
190
+
local name;
191
+
if [ -n "$__structuredAttrs" ]; then
192
+
for name in "$@";
193
+
do
194
+
local -n nameref="$name";
195
+
flagsArray+=(${nameref+"${nameref[@]}"});
196
+
done;
197
+
else
198
+
for name in "$@";
199
+
do
200
+
local -n nameref="$name";
201
+
case "$name" in
202
+
*Array)
203
+
flagsArray+=(${nameref+"${nameref[@]}"})
204
+
;;
205
+
*)
206
+
flagsArray+=(${nameref-})
207
+
;;
208
+
esac;
209
+
done;
210
+
fi
211
+
}
212
+
_activatePkgs ()
213
+
{
214
+
215
+
local hostOffset targetOffset;
216
+
local pkg;
217
+
for hostOffset in "${allPlatOffsets[@]}";
218
+
do
219
+
local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}";
220
+
for targetOffset in "${allPlatOffsets[@]}";
221
+
do
222
+
(( hostOffset <= targetOffset )) || continue;
223
+
local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]";
224
+
local pkgsSlice="${!pkgsRef}[@]";
225
+
for pkg in ${!pkgsSlice+"${!pkgsSlice}"};
226
+
do
227
+
activatePackage "$pkg" "$hostOffset" "$targetOffset";
228
+
done;
229
+
done;
230
+
done
231
+
}
232
+
_addRpathPrefix ()
233
+
{
234
+
235
+
if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then
236
+
export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}";
237
+
fi
238
+
}
239
+
_addToEnv ()
240
+
{
241
+
242
+
local depHostOffset depTargetOffset;
243
+
local pkg;
244
+
for depHostOffset in "${allPlatOffsets[@]}";
245
+
do
246
+
local hookVar="${pkgHookVarVars[depHostOffset + 1]}";
247
+
local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}";
248
+
for depTargetOffset in "${allPlatOffsets[@]}";
249
+
do
250
+
(( depHostOffset <= depTargetOffset )) || continue;
251
+
local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]";
252
+
if [[ -z "${strictDeps-}" ]]; then
253
+
local visitedPkgs="";
254
+
for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}";
255
+
do
256
+
if [[ "$visitedPkgs" = *"$pkg"* ]]; then
257
+
continue;
258
+
fi;
259
+
runHook "${!hookRef}" "$pkg";
260
+
visitedPkgs+=" $pkg";
261
+
done;
262
+
else
263
+
local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]";
264
+
local pkgsSlice="${!pkgsRef}[@]";
265
+
for pkg in ${!pkgsSlice+"${!pkgsSlice}"};
266
+
do
267
+
runHook "${!hookRef}" "$pkg";
268
+
done;
269
+
fi;
270
+
done;
271
+
done
272
+
}
273
+
_allFlags ()
274
+
{
275
+
276
+
export system pname name version;
277
+
for varName in $(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }');
278
+
do
279
+
if (( "${NIX_DEBUG:-0}" >= 1 )); then
280
+
printf "@%s@ -> %q\n" "${varName}" "${!varName}" 1>&2;
281
+
fi;
282
+
args+=("--subst-var" "$varName");
283
+
done
284
+
}
285
+
_assignFirst ()
286
+
{
287
+
288
+
local varName="$1";
289
+
local _var;
290
+
local REMOVE=REMOVE;
291
+
shift;
292
+
for _var in "$@";
293
+
do
294
+
if [ -n "${!_var-}" ]; then
295
+
eval "${varName}"="${_var}";
296
+
return;
297
+
fi;
298
+
done;
299
+
echo;
300
+
echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}.";
301
+
echo " The following variables were all unset or empty:";
302
+
echo " $*";
303
+
if [ -z "${out:-}" ]; then
304
+
echo ' If you do not want an "out" output in your derivation, make sure to define';
305
+
echo ' the other specific required outputs. This can be achieved by picking one';
306
+
echo " of the above as an output.";
307
+
echo ' You do not have to remove "out" if you want to have a different default';
308
+
echo ' output, because the first output is taken as a default.';
309
+
echo;
310
+
fi;
311
+
return 1
312
+
}
313
+
_callImplicitHook ()
314
+
{
315
+
316
+
local def="$1";
317
+
local hookName="$2";
318
+
if declare -F "$hookName" > /dev/null; then
319
+
"$hookName";
320
+
else
321
+
if type -p "$hookName" > /dev/null; then
322
+
source "$hookName";
323
+
else
324
+
if [ -n "${!hookName:-}" ]; then
325
+
eval "${!hookName}";
326
+
else
327
+
return "$def";
328
+
fi;
329
+
fi;
330
+
fi
331
+
}
332
+
_defaultUnpack ()
333
+
{
334
+
335
+
local fn="$1";
336
+
local destination;
337
+
if [ -d "$fn" ]; then
338
+
destination="$(stripHash "$fn")";
339
+
if [ -e "$destination" ]; then
340
+
echo "Cannot copy $fn to $destination: destination already exists!";
341
+
echo "Did you specify two \"srcs\" with the same \"name\"?";
342
+
return 1;
343
+
fi;
344
+
cp -pr --reflink=auto -- "$fn" "$destination";
345
+
else
346
+
case "$fn" in
347
+
*.tar.xz | *.tar.lzma | *.txz)
348
+
xz -d < "$fn" | tar xf - --warning=no-timestamp
349
+
;;
350
+
*.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz)
351
+
tar xf "$fn" --warning=no-timestamp
352
+
;;
353
+
*)
354
+
return 1
355
+
;;
356
+
esac;
357
+
fi
358
+
}
359
+
_doStrip ()
360
+
{
361
+
362
+
local -ra flags=(dontStripHost dontStripTarget);
363
+
local -ra debugDirs=(stripDebugList stripDebugListTarget);
364
+
local -ra allDirs=(stripAllList stripAllListTarget);
365
+
local -ra stripCmds=(STRIP STRIP_FOR_TARGET);
366
+
local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET);
367
+
stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin};
368
+
stripDebugListTarget=${stripDebugListTarget[*]:-};
369
+
stripAllList=${stripAllList[*]:-};
370
+
stripAllListTarget=${stripAllListTarget[*]:-};
371
+
local i;
372
+
for i in ${!stripCmds[@]};
373
+
do
374
+
local -n flag="${flags[$i]}";
375
+
local -n debugDirList="${debugDirs[$i]}";
376
+
local -n allDirList="${allDirs[$i]}";
377
+
local -n stripCmd="${stripCmds[$i]}";
378
+
local -n ranlibCmd="${ranlibCmds[$i]}";
379
+
if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then
380
+
continue;
381
+
fi;
382
+
stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}";
383
+
stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}";
384
+
done
385
+
}
386
+
_eval ()
387
+
{
388
+
389
+
if declare -F "$1" > /dev/null 2>&1; then
390
+
"$@";
391
+
else
392
+
eval "$1";
393
+
fi
394
+
}
395
+
_makeSymlinksRelative ()
396
+
{
397
+
398
+
local symlinkTarget;
399
+
if [ "${dontRewriteSymlinks-}" ] || [ ! -e "$prefix" ]; then
400
+
return;
401
+
fi;
402
+
while IFS= read -r -d '' f; do
403
+
symlinkTarget=$(readlink "$f");
404
+
if [[ "$symlinkTarget"/ != "$prefix"/* ]]; then
405
+
continue;
406
+
fi;
407
+
if [ ! -e "$symlinkTarget" ]; then
408
+
echo "the symlink $f is broken, it points to $symlinkTarget (which is missing)";
409
+
fi;
410
+
echo "rewriting symlink $f to be relative to $prefix";
411
+
ln -snrf "$symlinkTarget" "$f";
412
+
done < <(find $prefix -type l -print0)
413
+
}
414
+
_makeSymlinksRelativeInAllOutputs ()
415
+
{
416
+
417
+
local output;
418
+
for output in $(getAllOutputNames);
419
+
do
420
+
prefix="${!output}" _makeSymlinksRelative;
421
+
done
422
+
}
423
+
_moveLib64 ()
424
+
{
425
+
426
+
if [ "${dontMoveLib64-}" = 1 ]; then
427
+
return;
428
+
fi;
429
+
if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then
430
+
return;
431
+
fi;
432
+
echo "moving $prefix/lib64/* to $prefix/lib";
433
+
mkdir -p $prefix/lib;
434
+
shopt -s dotglob;
435
+
for i in $prefix/lib64/*;
436
+
do
437
+
mv --no-clobber "$i" $prefix/lib;
438
+
done;
439
+
shopt -u dotglob;
440
+
rmdir $prefix/lib64;
441
+
ln -s lib $prefix/lib64
442
+
}
443
+
_moveSbin ()
444
+
{
445
+
446
+
if [ "${dontMoveSbin-}" = 1 ]; then
447
+
return;
448
+
fi;
449
+
if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then
450
+
return;
451
+
fi;
452
+
echo "moving $prefix/sbin/* to $prefix/bin";
453
+
mkdir -p $prefix/bin;
454
+
shopt -s dotglob;
455
+
for i in $prefix/sbin/*;
456
+
do
457
+
mv "$i" $prefix/bin;
458
+
done;
459
+
shopt -u dotglob;
460
+
rmdir $prefix/sbin;
461
+
ln -s bin $prefix/sbin
462
+
}
463
+
_moveSystemdUserUnits ()
464
+
{
465
+
466
+
if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then
467
+
return;
468
+
fi;
469
+
if [ ! -e "${prefix:?}/lib/systemd/user" ]; then
470
+
return;
471
+
fi;
472
+
local source="$prefix/lib/systemd/user";
473
+
local target="$prefix/share/systemd/user";
474
+
echo "moving $source/* to $target";
475
+
mkdir -p "$target";
476
+
( shopt -s dotglob;
477
+
for i in "$source"/*;
478
+
do
479
+
mv "$i" "$target";
480
+
done );
481
+
rmdir "$source";
482
+
ln -s "$target" "$source"
483
+
}
484
+
_moveToShare ()
485
+
{
486
+
487
+
if [ -n "$__structuredAttrs" ]; then
488
+
if [ -z "${forceShare-}" ]; then
489
+
forceShare=(man doc info);
490
+
fi;
491
+
else
492
+
forceShare=(${forceShare:-man doc info});
493
+
fi;
494
+
if [[ -z "$out" ]]; then
495
+
return;
496
+
fi;
497
+
for d in "${forceShare[@]}";
498
+
do
499
+
if [ -d "$out/$d" ]; then
500
+
if [ -d "$out/share/$d" ]; then
501
+
echo "both $d/ and share/$d/ exist!";
502
+
else
503
+
echo "moving $out/$d to $out/share/$d";
504
+
mkdir -p $out/share;
505
+
mv $out/$d $out/share/;
506
+
fi;
507
+
fi;
508
+
done
509
+
}
510
+
_multioutConfig ()
511
+
{
512
+
513
+
if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then
514
+
return;
515
+
fi;
516
+
if [ -z "${shareDocName:-}" ]; then
517
+
local confScript="${configureScript:-}";
518
+
if [ -z "$confScript" ] && [ -x ./configure ]; then
519
+
confScript=./configure;
520
+
fi;
521
+
if [ -f "$confScript" ]; then
522
+
local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")";
523
+
fi;
524
+
if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then
525
+
shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')";
526
+
fi;
527
+
fi;
528
+
prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --oldincludedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale;
529
+
prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal
530
+
}
531
+
_multioutDevs ()
532
+
{
533
+
534
+
if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then
535
+
return;
536
+
fi;
537
+
moveToOutput include "${!outputInclude}";
538
+
moveToOutput lib/pkgconfig "${!outputDev}";
539
+
moveToOutput share/pkgconfig "${!outputDev}";
540
+
moveToOutput lib/cmake "${!outputDev}";
541
+
moveToOutput share/aclocal "${!outputDev}";
542
+
for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc;
543
+
do
544
+
echo "Patching '$f' includedir to output ${!outputInclude}";
545
+
sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f";
546
+
done
547
+
}
548
+
_multioutDocs ()
549
+
{
550
+
551
+
local REMOVE=REMOVE;
552
+
moveToOutput share/info "${!outputInfo}";
553
+
moveToOutput share/doc "${!outputDoc}";
554
+
moveToOutput share/gtk-doc "${!outputDevdoc}";
555
+
moveToOutput share/devhelp/books "${!outputDevdoc}";
556
+
moveToOutput share/man "${!outputMan}";
557
+
moveToOutput share/man/man3 "${!outputDevman}"
558
+
}
559
+
_multioutPropagateDev ()
560
+
{
561
+
562
+
if [ "$(getAllOutputNames)" = "out" ]; then
563
+
return;
564
+
fi;
565
+
local outputFirst;
566
+
for outputFirst in $(getAllOutputNames);
567
+
do
568
+
break;
569
+
done;
570
+
local propagaterOutput="$outputDev";
571
+
if [ -z "$propagaterOutput" ]; then
572
+
propagaterOutput="$outputFirst";
573
+
fi;
574
+
if [ -z "${propagatedBuildOutputs+1}" ]; then
575
+
local po_dirty="$outputBin $outputInclude $outputLib";
576
+
set +o pipefail;
577
+
propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `;
578
+
set -o pipefail;
579
+
fi;
580
+
if [ -z "$propagatedBuildOutputs" ]; then
581
+
return;
582
+
fi;
583
+
mkdir -p "${!propagaterOutput}"/nix-support;
584
+
for output in $propagatedBuildOutputs;
585
+
do
586
+
echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs;
587
+
done
588
+
}
589
+
_overrideFirst ()
590
+
{
591
+
592
+
if [ -z "${!1-}" ]; then
593
+
_assignFirst "$@";
594
+
fi
595
+
}
596
+
_pruneLibtoolFiles ()
597
+
{
598
+
599
+
if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then
600
+
return;
601
+
fi;
602
+
find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \;
603
+
}
604
+
_updateSourceDateEpochFromSourceRoot ()
605
+
{
606
+
607
+
if [ -n "$sourceRoot" ]; then
608
+
updateSourceDateEpoch "$sourceRoot";
609
+
fi
610
+
}
611
+
activatePackage ()
612
+
{
613
+
614
+
local pkg="$1";
615
+
local -r hostOffset="$2";
616
+
local -r targetOffset="$3";
617
+
(( hostOffset <= targetOffset )) || exit 1;
618
+
if [ -f "$pkg" ]; then
619
+
source "$pkg";
620
+
fi;
621
+
if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then
622
+
addToSearchPath _PATH "$pkg/bin";
623
+
fi;
624
+
if (( hostOffset <= -1 )); then
625
+
addToSearchPath _XDG_DATA_DIRS "$pkg/share";
626
+
fi;
627
+
if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then
628
+
addToSearchPath _HOST_PATH "$pkg/bin";
629
+
fi;
630
+
if [[ -f "$pkg/nix-support/setup-hook" ]]; then
631
+
source "$pkg/nix-support/setup-hook";
632
+
fi
633
+
}
634
+
addEnvHooks ()
635
+
{
636
+
637
+
local depHostOffset="$1";
638
+
shift;
639
+
local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]";
640
+
local pkgHookVar;
641
+
for pkgHookVar in "${!pkgHookVarsSlice}";
642
+
do
643
+
eval "${pkgHookVar}s"'+=("$@")';
644
+
done
645
+
}
646
+
addToSearchPath ()
647
+
{
648
+
649
+
addToSearchPathWithCustomDelimiter ":" "$@"
650
+
}
651
+
addToSearchPathWithCustomDelimiter ()
652
+
{
653
+
654
+
local delimiter="$1";
655
+
local varName="$2";
656
+
local dir="$3";
657
+
if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then
658
+
export "${varName}=${!varName:+${!varName}${delimiter}}${dir}";
659
+
fi
660
+
}
661
+
appendToVar ()
662
+
{
663
+
664
+
local -n nameref="$1";
665
+
local useArray type;
666
+
if [ -n "$__structuredAttrs" ]; then
667
+
useArray=true;
668
+
else
669
+
useArray=false;
670
+
fi;
671
+
if declare -p "$1" 2> /dev/null | grep -q '^'; then
672
+
type="$(declare -p "$1")";
673
+
if [[ "$type" =~ "declare -A" ]]; then
674
+
echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2;
675
+
return 1;
676
+
else
677
+
if [[ "$type" =~ "declare -a" ]]; then
678
+
useArray=true;
679
+
else
680
+
useArray=false;
681
+
fi;
682
+
fi;
683
+
fi;
684
+
shift;
685
+
if $useArray; then
686
+
nameref=(${nameref+"${nameref[@]}"} "$@");
687
+
else
688
+
nameref="${nameref-} $*";
689
+
fi
690
+
}
691
+
auditTmpdir ()
692
+
{
693
+
694
+
local dir="$1";
695
+
[ -e "$dir" ] || return 0;
696
+
echo "checking for references to $TMPDIR/ in $dir...";
697
+
local i;
698
+
find "$dir" -type f -print0 | while IFS= read -r -d '' i; do
699
+
if [[ "$i" =~ .build-id ]]; then
700
+
continue;
701
+
fi;
702
+
if isELF "$i"; then
703
+
if {
704
+
printf :;
705
+
patchelf --print-rpath "$i"
706
+
} | grep -q -F ":$TMPDIR/"; then
707
+
echo "RPATH of binary $i contains a forbidden reference to $TMPDIR/";
708
+
exit 1;
709
+
fi;
710
+
fi;
711
+
if isScript "$i"; then
712
+
if [ -e "$(dirname "$i")/.$(basename "$i")-wrapped" ]; then
713
+
if grep -q -F "$TMPDIR/" "$i"; then
714
+
echo "wrapper script $i contains a forbidden reference to $TMPDIR/";
715
+
exit 1;
716
+
fi;
717
+
fi;
718
+
fi;
719
+
done
720
+
}
721
+
bintoolsWrapper_addLDVars ()
722
+
{
723
+
724
+
local role_post;
725
+
getHostRoleEnvHook;
726
+
if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then
727
+
export NIX_LDFLAGS${role_post}+=" -L$1/lib64";
728
+
fi;
729
+
if [[ -d "$1/lib" ]]; then
730
+
local -a glob=($1/lib/lib*);
731
+
if [ "${#glob[*]}" -gt 0 ]; then
732
+
export NIX_LDFLAGS${role_post}+=" -L$1/lib";
733
+
fi;
734
+
fi
735
+
}
736
+
buildPhase ()
737
+
{
738
+
739
+
runHook preBuild;
740
+
if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then
741
+
echo "no Makefile or custom buildPhase, doing nothing";
742
+
else
743
+
foundMakefile=1;
744
+
local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL=$SHELL);
745
+
_accumFlagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray;
746
+
echoCmd 'build flags' "${flagsArray[@]}";
747
+
make ${makefile:+-f $makefile} "${flagsArray[@]}";
748
+
unset flagsArray;
749
+
fi;
750
+
runHook postBuild
751
+
}
752
+
ccWrapper_addCVars ()
753
+
{
754
+
755
+
local role_post;
756
+
getHostRoleEnvHook;
757
+
if [ -d "$1/include" ]; then
758
+
export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include";
759
+
fi;
760
+
if [ -d "$1/Library/Frameworks" ]; then
761
+
export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks";
762
+
fi
763
+
}
764
+
checkPhase ()
765
+
{
766
+
767
+
runHook preCheck;
768
+
if [[ -z "${foundMakefile:-}" ]]; then
769
+
echo "no Makefile or custom checkPhase, doing nothing";
770
+
runHook postCheck;
771
+
return;
772
+
fi;
773
+
if [[ -z "${checkTarget:-}" ]]; then
774
+
if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then
775
+
checkTarget=check;
776
+
else
777
+
if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then
778
+
checkTarget=test;
779
+
fi;
780
+
fi;
781
+
fi;
782
+
if [[ -z "${checkTarget:-}" ]]; then
783
+
echo "no check/test target in ${makefile:-Makefile}, doing nothing";
784
+
else
785
+
local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL=$SHELL);
786
+
_accumFlagsArray makeFlags makeFlagsArray;
787
+
if [ -n "$__structuredAttrs" ]; then
788
+
flagsArray+=("${checkFlags[@]:-VERBOSE=y}");
789
+
else
790
+
flagsArray+=(${checkFlags:-VERBOSE=y});
791
+
fi;
792
+
_accumFlagsArray checkFlagsArray;
793
+
flagsArray+=(${checkTarget});
794
+
echoCmd 'check flags' "${flagsArray[@]}";
795
+
make ${makefile:+-f $makefile} "${flagsArray[@]}";
796
+
unset flagsArray;
797
+
fi;
798
+
runHook postCheck
799
+
}
800
+
compressManPages ()
801
+
{
802
+
803
+
local dir="$1";
804
+
if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then
805
+
return;
806
+
fi;
807
+
echo "gzipping man pages under $dir/share/man/";
808
+
find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | while IFS= read -r -d '' f; do
809
+
if gzip -c -n "$f" > "$f".gz; then
810
+
rm "$f";
811
+
else
812
+
rm "$f".gz;
813
+
fi;
814
+
done;
815
+
find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do
816
+
local target;
817
+
target="$(readlink -f "$f")";
818
+
if [ -f "$target".gz ]; then
819
+
ln -sf "$target".gz "$f".gz && rm "$f";
820
+
fi;
821
+
done
822
+
}
823
+
configurePhase ()
824
+
{
825
+
826
+
runHook preConfigure;
827
+
: "${configureScript=}";
828
+
if [[ -z "$configureScript" && -x ./configure ]]; then
829
+
configureScript=./configure;
830
+
fi;
831
+
if [ -z "${dontFixLibtool:-}" ]; then
832
+
export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}";
833
+
local i;
834
+
find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do
835
+
echo "fixing libtool script $i";
836
+
fixLibtool "$i";
837
+
done;
838
+
CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX);
839
+
find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;;
840
+
rm -f "$CONFIGURE_MTIME_REFERENCE";
841
+
fi;
842
+
if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then
843
+
prependToVar configureFlags "${prefixKey:---prefix=}$prefix";
844
+
fi;
845
+
if [[ -f "$configureScript" ]]; then
846
+
if [ -z "${dontAddDisableDepTrack:-}" ]; then
847
+
if grep -q dependency-tracking "$configureScript"; then
848
+
prependToVar configureFlags --disable-dependency-tracking;
849
+
fi;
850
+
fi;
851
+
if [ -z "${dontDisableStatic:-}" ]; then
852
+
if grep -q enable-static "$configureScript"; then
853
+
prependToVar configureFlags --disable-static;
854
+
fi;
855
+
fi;
856
+
fi;
857
+
if [ -n "$configureScript" ]; then
858
+
local -a flagsArray;
859
+
_accumFlagsArray configureFlags configureFlagsArray;
860
+
echoCmd 'configure flags' "${flagsArray[@]}";
861
+
$configureScript "${flagsArray[@]}";
862
+
unset flagsArray;
863
+
else
864
+
echo "no configure script, doing nothing";
865
+
fi;
866
+
runHook postConfigure
867
+
}
868
+
consumeEntire ()
869
+
{
870
+
871
+
if IFS='' read -r -d '' "$1"; then
872
+
echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2;
873
+
return 1;
874
+
fi
875
+
}
876
+
distPhase ()
877
+
{
878
+
879
+
runHook preDist;
880
+
local flagsArray=();
881
+
_accumFlagsArray distFlags distFlagsArray;
882
+
flagsArray+=(${distTarget:-dist});
883
+
echo 'dist flags: %q' "${flagsArray[@]}";
884
+
make ${makefile:+-f $makefile} "${flagsArray[@]}";
885
+
if [ "${dontCopyDist:-0}" != 1 ]; then
886
+
mkdir -p "$out/tarballs";
887
+
cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs";
888
+
fi;
889
+
runHook postDist
890
+
}
891
+
dumpVars ()
892
+
{
893
+
894
+
if [ "${noDumpEnvVars:-0}" != 1 ]; then
895
+
export 2> /dev/null >| "$NIX_BUILD_TOP/env-vars" || true;
896
+
fi
897
+
}
898
+
echoCmd ()
899
+
{
900
+
901
+
printf "%s:" "$1";
902
+
shift;
903
+
printf ' %q' "$@";
904
+
echo
905
+
}
906
+
exitHandler ()
907
+
{
908
+
909
+
exitCode="$?";
910
+
set +e;
911
+
if [ -n "${showBuildStats:-}" ]; then
912
+
read -r -d '' -a buildTimes < <(times);
913
+
echo "build times:";
914
+
echo "user time for the shell ${buildTimes[0]}";
915
+
echo "system time for the shell ${buildTimes[1]}";
916
+
echo "user time for all child processes ${buildTimes[2]}";
917
+
echo "system time for all child processes ${buildTimes[3]}";
918
+
fi;
919
+
if (( "$exitCode" != 0 )); then
920
+
runHook failureHook;
921
+
if [ -n "${succeedOnFailure:-}" ]; then
922
+
echo "build failed with exit code $exitCode (ignored)";
923
+
mkdir -p "$out/nix-support";
924
+
printf "%s" "$exitCode" > "$out/nix-support/failed";
925
+
exit 0;
926
+
fi;
927
+
else
928
+
runHook exitHook;
929
+
fi;
930
+
return "$exitCode"
931
+
}
932
+
findInputs ()
933
+
{
934
+
935
+
local -r pkg="$1";
936
+
local -r hostOffset="$2";
937
+
local -r targetOffset="$3";
938
+
(( hostOffset <= targetOffset )) || exit 1;
939
+
local varVar="${pkgAccumVarVars[hostOffset + 1]}";
940
+
local varRef="$varVar[$((targetOffset - hostOffset))]";
941
+
local var="${!varRef}";
942
+
unset -v varVar varRef;
943
+
local varSlice="$var[*]";
944
+
case "${!varSlice-}" in
945
+
*" $pkg "*)
946
+
return 0
947
+
;;
948
+
esac;
949
+
unset -v varSlice;
950
+
eval "$var"'+=("$pkg")';
951
+
if ! [ -e "$pkg" ]; then
952
+
echo "build input $pkg does not exist" 1>&2;
953
+
exit 1;
954
+
fi;
955
+
function mapOffset ()
956
+
{
957
+
local -r inputOffset="$1";
958
+
local -n outputOffset="$2";
959
+
if (( inputOffset <= 0 )); then
960
+
outputOffset=$((inputOffset + hostOffset));
961
+
else
962
+
outputOffset=$((inputOffset - 1 + targetOffset));
963
+
fi
964
+
};
965
+
local relHostOffset;
966
+
for relHostOffset in "${allPlatOffsets[@]}";
967
+
do
968
+
local files="${propagatedDepFilesVars[relHostOffset + 1]}";
969
+
local hostOffsetNext;
970
+
mapOffset "$relHostOffset" hostOffsetNext;
971
+
(( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue;
972
+
local relTargetOffset;
973
+
for relTargetOffset in "${allPlatOffsets[@]}";
974
+
do
975
+
(( "$relHostOffset" <= "$relTargetOffset" )) || continue;
976
+
local fileRef="${files}[$relTargetOffset - $relHostOffset]";
977
+
local file="${!fileRef}";
978
+
unset -v fileRef;
979
+
local targetOffsetNext;
980
+
mapOffset "$relTargetOffset" targetOffsetNext;
981
+
(( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue;
982
+
[[ -f "$pkg/nix-support/$file" ]] || continue;
983
+
local pkgNext;
984
+
read -r -d '' pkgNext < "$pkg/nix-support/$file" || true;
985
+
for pkgNext in $pkgNext;
986
+
do
987
+
findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext";
988
+
done;
989
+
done;
990
+
done
991
+
}
992
+
fixLibtool ()
993
+
{
994
+
995
+
local search_path;
996
+
for flag in $NIX_LDFLAGS;
997
+
do
998
+
case $flag in
999
+
-L*)
1000
+
search_path+=" ${flag#-L}"
1001
+
;;
1002
+
esac;
1003
+
done;
1004
+
sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^'
1005
+
}
1006
+
fixupPhase ()
1007
+
{
1008
+
1009
+
local output;
1010
+
for output in $(getAllOutputNames);
1011
+
do
1012
+
if [ -e "${!output}" ]; then
1013
+
chmod -R u+w "${!output}";
1014
+
fi;
1015
+
done;
1016
+
runHook preFixup;
1017
+
local output;
1018
+
for output in $(getAllOutputNames);
1019
+
do
1020
+
prefix="${!output}" runHook fixupOutput;
1021
+
done;
1022
+
recordPropagatedDependencies;
1023
+
if [ -n "${setupHook:-}" ]; then
1024
+
mkdir -p "${!outputDev}/nix-support";
1025
+
substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook";
1026
+
fi;
1027
+
if [ -n "${setupHooks:-}" ]; then
1028
+
mkdir -p "${!outputDev}/nix-support";
1029
+
local hook;
1030
+
for hook in ${setupHooks[@]};
1031
+
do
1032
+
local content;
1033
+
consumeEntire content < "$hook";
1034
+
substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook";
1035
+
unset -v content;
1036
+
done;
1037
+
unset -v hook;
1038
+
fi;
1039
+
if [ -n "${propagatedUserEnvPkgs:-}" ]; then
1040
+
mkdir -p "${!outputBin}/nix-support";
1041
+
printWords $propagatedUserEnvPkgs > "${!outputBin}/nix-support/propagated-user-env-packages";
1042
+
fi;
1043
+
runHook postFixup
1044
+
}
1045
+
genericBuild ()
1046
+
{
1047
+
1048
+
export GZIP_NO_TIMESTAMPS=1;
1049
+
if [ -f "${buildCommandPath:-}" ]; then
1050
+
source "$buildCommandPath";
1051
+
return;
1052
+
fi;
1053
+
if [ -n "${buildCommand:-}" ]; then
1054
+
eval "$buildCommand";
1055
+
return;
1056
+
fi;
1057
+
if [ -z "${phases[*]:-}" ]; then
1058
+
phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}";
1059
+
fi;
1060
+
for curPhase in ${phases[*]};
1061
+
do
1062
+
runPhase "$curPhase";
1063
+
done
1064
+
}
1065
+
getAllOutputNames ()
1066
+
{
1067
+
1068
+
if [ -n "$__structuredAttrs" ]; then
1069
+
echo "${!outputs[*]}";
1070
+
else
1071
+
echo "$outputs";
1072
+
fi
1073
+
}
1074
+
getHostRole ()
1075
+
{
1076
+
1077
+
getRole "$hostOffset"
1078
+
}
1079
+
getHostRoleEnvHook ()
1080
+
{
1081
+
1082
+
getRole "$depHostOffset"
1083
+
}
1084
+
getRole ()
1085
+
{
1086
+
1087
+
case $1 in
1088
+
-1)
1089
+
role_post='_FOR_BUILD'
1090
+
;;
1091
+
0)
1092
+
role_post=''
1093
+
;;
1094
+
1)
1095
+
role_post='_FOR_TARGET'
1096
+
;;
1097
+
*)
1098
+
echo "binutils-wrapper-2.40: used as improper sort of dependency" 1>&2;
1099
+
return 1
1100
+
;;
1101
+
esac
1102
+
}
1103
+
getTargetRole ()
1104
+
{
1105
+
1106
+
getRole "$targetOffset"
1107
+
}
1108
+
getTargetRoleEnvHook ()
1109
+
{
1110
+
1111
+
getRole "$depTargetOffset"
1112
+
}
1113
+
getTargetRoleWrapper ()
1114
+
{
1115
+
1116
+
case $targetOffset in
1117
+
-1)
1118
+
export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1
1119
+
;;
1120
+
0)
1121
+
export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1
1122
+
;;
1123
+
1)
1124
+
export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1
1125
+
;;
1126
+
*)
1127
+
echo "binutils-wrapper-2.40: used as improper sort of dependency" 1>&2;
1128
+
return 1
1129
+
;;
1130
+
esac
1131
+
}
1132
+
installCheckPhase ()
1133
+
{
1134
+
1135
+
runHook preInstallCheck;
1136
+
if [[ -z "${foundMakefile:-}" ]]; then
1137
+
echo "no Makefile or custom installCheckPhase, doing nothing";
1138
+
else
1139
+
if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then
1140
+
echo "no installcheck target in ${makefile:-Makefile}, doing nothing";
1141
+
else
1142
+
local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL=$SHELL);
1143
+
_accumFlagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray;
1144
+
flagsArray+=(${installCheckTarget:-installcheck});
1145
+
echoCmd 'installcheck flags' "${flagsArray[@]}";
1146
+
make ${makefile:+-f $makefile} "${flagsArray[@]}";
1147
+
unset flagsArray;
1148
+
fi;
1149
+
fi;
1150
+
runHook postInstallCheck
1151
+
}
1152
+
installPhase ()
1153
+
{
1154
+
1155
+
runHook preInstall;
1156
+
if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then
1157
+
echo "no Makefile or custom installPhase, doing nothing";
1158
+
runHook postInstall;
1159
+
return;
1160
+
else
1161
+
foundMakefile=1;
1162
+
fi;
1163
+
if [ -n "$prefix" ]; then
1164
+
mkdir -p "$prefix";
1165
+
fi;
1166
+
local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL=$SHELL);
1167
+
_accumFlagsArray makeFlags makeFlagsArray installFlags installFlagsArray;
1168
+
if [ -n "$__structuredAttrs" ]; then
1169
+
flagsArray+=("${installTargets[@]:-install}");
1170
+
else
1171
+
flagsArray+=(${installTargets:-install});
1172
+
fi;
1173
+
echoCmd 'install flags' "${flagsArray[@]}";
1174
+
make ${makefile:+-f $makefile} "${flagsArray[@]}";
1175
+
unset flagsArray;
1176
+
runHook postInstall
1177
+
}
1178
+
isELF ()
1179
+
{
1180
+
1181
+
local fn="$1";
1182
+
local fd;
1183
+
local magic;
1184
+
exec {fd}< "$fn";
1185
+
read -r -n 4 -u "$fd" magic;
1186
+
exec {fd}>&-;
1187
+
if [ "$magic" = 'ELF' ]; then
1188
+
return 0;
1189
+
else
1190
+
return 1;
1191
+
fi
1192
+
}
1193
+
isMachO ()
1194
+
{
1195
+
1196
+
local fn="$1";
1197
+
local fd;
1198
+
local magic;
1199
+
exec {fd}< "$fn";
1200
+
read -r -n 4 -u "$fd" magic;
1201
+
exec {fd}>&-;
1202
+
if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then
1203
+
return 0;
1204
+
else
1205
+
if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then
1206
+
return 0;
1207
+
else
1208
+
if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then
1209
+
return 0;
1210
+
else
1211
+
return 1;
1212
+
fi;
1213
+
fi;
1214
+
fi
1215
+
}
1216
+
isScript ()
1217
+
{
1218
+
1219
+
local fn="$1";
1220
+
local fd;
1221
+
local magic;
1222
+
exec {fd}< "$fn";
1223
+
read -r -n 2 -u "$fd" magic;
1224
+
exec {fd}>&-;
1225
+
if [[ "$magic" =~ \#! ]]; then
1226
+
return 0;
1227
+
else
1228
+
return 1;
1229
+
fi
1230
+
}
1231
+
mapOffset ()
1232
+
{
1233
+
1234
+
local -r inputOffset="$1";
1235
+
local -n outputOffset="$2";
1236
+
if (( inputOffset <= 0 )); then
1237
+
outputOffset=$((inputOffset + hostOffset));
1238
+
else
1239
+
outputOffset=$((inputOffset - 1 + targetOffset));
1240
+
fi
1241
+
}
1242
+
moveToOutput ()
1243
+
{
1244
+
1245
+
local patt="$1";
1246
+
local dstOut="$2";
1247
+
local output;
1248
+
for output in $(getAllOutputNames);
1249
+
do
1250
+
if [ "${!output}" = "$dstOut" ]; then
1251
+
continue;
1252
+
fi;
1253
+
local srcPath;
1254
+
for srcPath in "${!output}"/$patt;
1255
+
do
1256
+
if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then
1257
+
continue;
1258
+
fi;
1259
+
if [ "$dstOut" = REMOVE ]; then
1260
+
echo "Removing $srcPath";
1261
+
rm -r "$srcPath";
1262
+
else
1263
+
local dstPath="$dstOut${srcPath#${!output}}";
1264
+
echo "Moving $srcPath to $dstPath";
1265
+
if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then
1266
+
rmdir "$srcPath" --ignore-fail-on-non-empty;
1267
+
if [ -d "$srcPath" ]; then
1268
+
mv -t "$dstPath" "$srcPath"/*;
1269
+
rmdir "$srcPath";
1270
+
fi;
1271
+
else
1272
+
mkdir -p "$(readlink -m "$dstPath/..")";
1273
+
mv "$srcPath" "$dstPath";
1274
+
fi;
1275
+
fi;
1276
+
local srcParent="$(readlink -m "$srcPath/..")";
1277
+
if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then
1278
+
echo "Removing empty $srcParent/ and (possibly) its parents";
1279
+
rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true;
1280
+
fi;
1281
+
done;
1282
+
done
1283
+
}
1284
+
patchELF ()
1285
+
{
1286
+
1287
+
local dir="$1";
1288
+
[ -e "$dir" ] || return 0;
1289
+
echo "shrinking RPATHs of ELF executables and libraries in $dir";
1290
+
local i;
1291
+
while IFS= read -r -d '' i; do
1292
+
if [[ "$i" =~ .build-id ]]; then
1293
+
continue;
1294
+
fi;
1295
+
if ! isELF "$i"; then
1296
+
continue;
1297
+
fi;
1298
+
echo "shrinking $i";
1299
+
patchelf --shrink-rpath "$i" || true;
1300
+
done < <(find "$dir" -type f -print0)
1301
+
}
1302
+
patchPhase ()
1303
+
{
1304
+
1305
+
runHook prePatch;
1306
+
local -a patchesArray;
1307
+
if [ -n "$__structuredAttrs" ]; then
1308
+
patchesArray=(${patches:+"${patches[@]}"});
1309
+
else
1310
+
patchesArray=(${patches:-});
1311
+
fi;
1312
+
for i in "${patchesArray[@]}";
1313
+
do
1314
+
echo "applying patch $i";
1315
+
local uncompress=cat;
1316
+
case "$i" in
1317
+
*.gz)
1318
+
uncompress="gzip -d"
1319
+
;;
1320
+
*.bz2)
1321
+
uncompress="bzip2 -d"
1322
+
;;
1323
+
*.xz)
1324
+
uncompress="xz -d"
1325
+
;;
1326
+
*.lzma)
1327
+
uncompress="lzma -d"
1328
+
;;
1329
+
esac;
1330
+
local -a flagsArray;
1331
+
if [ -n "$__structuredAttrs" ]; then
1332
+
flagsArray=("${patchFlags[@]:--p1}");
1333
+
else
1334
+
flagsArray=(${patchFlags:--p1});
1335
+
fi;
1336
+
$uncompress < "$i" 2>&1 | patch "${flagsArray[@]}";
1337
+
done;
1338
+
runHook postPatch
1339
+
}
1340
+
patchShebangs ()
1341
+
{
1342
+
1343
+
local pathName;
1344
+
local update;
1345
+
while [[ $# -gt 0 ]]; do
1346
+
case "$1" in
1347
+
--host)
1348
+
pathName=HOST_PATH;
1349
+
shift
1350
+
;;
1351
+
--build)
1352
+
pathName=PATH;
1353
+
shift
1354
+
;;
1355
+
--update)
1356
+
update=true;
1357
+
shift
1358
+
;;
1359
+
--)
1360
+
shift;
1361
+
break
1362
+
;;
1363
+
-* | --*)
1364
+
echo "Unknown option $1 supplied to patchShebangs" 1>&2;
1365
+
return 1
1366
+
;;
1367
+
*)
1368
+
break
1369
+
;;
1370
+
esac;
1371
+
done;
1372
+
echo "patching script interpreter paths in $@";
1373
+
local f;
1374
+
local oldPath;
1375
+
local newPath;
1376
+
local arg0;
1377
+
local args;
1378
+
local oldInterpreterLine;
1379
+
local newInterpreterLine;
1380
+
if [[ $# -eq 0 ]]; then
1381
+
echo "No arguments supplied to patchShebangs" 1>&2;
1382
+
return 0;
1383
+
fi;
1384
+
local f;
1385
+
while IFS= read -r -d '' f; do
1386
+
isScript "$f" || continue;
1387
+
read -r oldInterpreterLine < "$f";
1388
+
read -r oldPath arg0 args <<< "${oldInterpreterLine:2}";
1389
+
if [[ -z "${pathName:-}" ]]; then
1390
+
if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then
1391
+
pathName=HOST_PATH;
1392
+
else
1393
+
pathName=PATH;
1394
+
fi;
1395
+
fi;
1396
+
if [[ "$oldPath" == *"/bin/env" ]]; then
1397
+
if [[ $arg0 == "-S" ]]; then
1398
+
arg0=${args%% *};
1399
+
args=${args#* };
1400
+
newPath="$(PATH="${!pathName}" command -v "env" || true)";
1401
+
args="-S $(PATH="${!pathName}" command -v "$arg0" || true) $args";
1402
+
else
1403
+
if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then
1404
+
echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2;
1405
+
exit 1;
1406
+
else
1407
+
newPath="$(PATH="${!pathName}" command -v "$arg0" || true)";
1408
+
fi;
1409
+
fi;
1410
+
else
1411
+
if [[ -z $oldPath ]]; then
1412
+
oldPath="/bin/sh";
1413
+
fi;
1414
+
newPath="$(PATH="${!pathName}" command -v "$(basename "$oldPath")" || true)";
1415
+
args="$arg0 $args";
1416
+
fi;
1417
+
newInterpreterLine="$newPath $args";
1418
+
newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}};
1419
+
if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then
1420
+
if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then
1421
+
echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\"";
1422
+
escapedInterpreterLine=${newInterpreterLine//\\/\\\\};
1423
+
timestamp=$(stat --printf "%y" "$f");
1424
+
sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f";
1425
+
touch --date "$timestamp" "$f";
1426
+
fi;
1427
+
fi;
1428
+
done < <(find "$@" -type f -perm -0100 -print0)
1429
+
}
1430
+
patchShebangsAuto ()
1431
+
{
1432
+
1433
+
if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then
1434
+
if [[ "$output" != out && "$output" = "$outputDev" ]]; then
1435
+
patchShebangs --build "$prefix";
1436
+
else
1437
+
patchShebangs --host "$prefix";
1438
+
fi;
1439
+
fi
1440
+
}
1441
+
prependToVar ()
1442
+
{
1443
+
1444
+
local -n nameref="$1";
1445
+
local useArray type;
1446
+
if [ -n "$__structuredAttrs" ]; then
1447
+
useArray=true;
1448
+
else
1449
+
useArray=false;
1450
+
fi;
1451
+
if declare -p "$1" 2> /dev/null | grep -q '^'; then
1452
+
type="$(declare -p "$1")";
1453
+
if [[ "$type" =~ "declare -A" ]]; then
1454
+
echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2;
1455
+
return 1;
1456
+
else
1457
+
if [[ "$type" =~ "declare -a" ]]; then
1458
+
useArray=true;
1459
+
else
1460
+
useArray=false;
1461
+
fi;
1462
+
fi;
1463
+
fi;
1464
+
shift;
1465
+
if $useArray; then
1466
+
nameref=("$@" ${nameref+"${nameref[@]}"});
1467
+
else
1468
+
nameref="$* ${nameref-}";
1469
+
fi
1470
+
}
1471
+
printLines ()
1472
+
{
1473
+
1474
+
(( "$#" > 0 )) || return 0;
1475
+
printf '%s\n' "$@"
1476
+
}
1477
+
printWords ()
1478
+
{
1479
+
1480
+
(( "$#" > 0 )) || return 0;
1481
+
printf '%s ' "$@"
1482
+
}
1483
+
recordPropagatedDependencies ()
1484
+
{
1485
+
1486
+
declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated);
1487
+
declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}");
1488
+
local propagatedInputsIndex;
1489
+
for propagatedInputsIndex in "${!flatVars[@]}";
1490
+
do
1491
+
local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]";
1492
+
local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}";
1493
+
[[ -n "${!propagatedInputsSlice}" ]] || continue;
1494
+
mkdir -p "${!outputDev}/nix-support";
1495
+
printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile";
1496
+
done
1497
+
}
1498
+
runHook ()
1499
+
{
1500
+
1501
+
local hookName="$1";
1502
+
shift;
1503
+
local hooksSlice="${hookName%Hook}Hooks[@]";
1504
+
local hook;
1505
+
for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"};
1506
+
do
1507
+
_eval "$hook" "$@";
1508
+
done;
1509
+
return 0
1510
+
}
1511
+
runOneHook ()
1512
+
{
1513
+
1514
+
local hookName="$1";
1515
+
shift;
1516
+
local hooksSlice="${hookName%Hook}Hooks[@]";
1517
+
local hook ret=1;
1518
+
for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"};
1519
+
do
1520
+
if _eval "$hook" "$@"; then
1521
+
ret=0;
1522
+
break;
1523
+
fi;
1524
+
done;
1525
+
return "$ret"
1526
+
}
1527
+
runPhase ()
1528
+
{
1529
+
1530
+
local curPhase="$*";
1531
+
if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then
1532
+
return;
1533
+
fi;
1534
+
if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then
1535
+
return;
1536
+
fi;
1537
+
if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then
1538
+
return;
1539
+
fi;
1540
+
if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then
1541
+
return;
1542
+
fi;
1543
+
if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then
1544
+
return;
1545
+
fi;
1546
+
if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then
1547
+
return;
1548
+
fi;
1549
+
if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then
1550
+
return;
1551
+
fi;
1552
+
if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then
1553
+
return;
1554
+
fi;
1555
+
if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then
1556
+
return;
1557
+
fi;
1558
+
if [[ -n $NIX_LOG_FD ]]; then
1559
+
echo "@nix { \"action\": \"setPhase\", \"phase\": \"$curPhase\" }" >&"$NIX_LOG_FD";
1560
+
fi;
1561
+
showPhaseHeader "$curPhase";
1562
+
dumpVars;
1563
+
local startTime=$(date +"%s");
1564
+
eval "${!curPhase:-$curPhase}";
1565
+
local endTime=$(date +"%s");
1566
+
showPhaseFooter "$curPhase" "$startTime" "$endTime";
1567
+
if [ "$curPhase" = unpackPhase ]; then
1568
+
[ -n "${sourceRoot:-}" ] && chmod +x "${sourceRoot}";
1569
+
cd "${sourceRoot:-.}";
1570
+
fi
1571
+
}
1572
+
showPhaseFooter ()
1573
+
{
1574
+
1575
+
local phase="$1";
1576
+
local startTime="$2";
1577
+
local endTime="$3";
1578
+
local delta=$(( endTime - startTime ));
1579
+
(( delta < 30 )) && return;
1580
+
local H=$((delta/3600));
1581
+
local M=$((delta%3600/60));
1582
+
local S=$((delta%60));
1583
+
echo -n "$phase completed in ";
1584
+
(( H > 0 )) && echo -n "$H hours ";
1585
+
(( M > 0 )) && echo -n "$M minutes ";
1586
+
echo "$S seconds"
1587
+
}
1588
+
showPhaseHeader ()
1589
+
{
1590
+
1591
+
local phase="$1";
1592
+
echo "Running phase: $phase"
1593
+
}
1594
+
stripDirs ()
1595
+
{
1596
+
1597
+
local cmd="$1";
1598
+
local ranlibCmd="$2";
1599
+
local paths="$3";
1600
+
local stripFlags="$4";
1601
+
local excludeFlags=();
1602
+
local pathsNew=;
1603
+
[ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1;
1604
+
[ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1;
1605
+
local pattern;
1606
+
if [ -n "${stripExclude:-}" ]; then
1607
+
for pattern in "${stripExclude[@]}";
1608
+
do
1609
+
excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')');
1610
+
done;
1611
+
fi;
1612
+
local p;
1613
+
for p in ${paths};
1614
+
do
1615
+
if [ -e "$prefix/$p" ]; then
1616
+
pathsNew="${pathsNew} $prefix/$p";
1617
+
fi;
1618
+
done;
1619
+
paths=${pathsNew};
1620
+
if [ -n "${paths}" ]; then
1621
+
echo "stripping (with command $cmd and flags $stripFlags) in $paths";
1622
+
local striperr;
1623
+
striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')";
1624
+
find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -print0 | xargs -r -0 -n1 -- realpath -z | sort -u -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?;
1625
+
[[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 );
1626
+
rm "$striperr";
1627
+
find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null;
1628
+
fi
1629
+
}
1630
+
stripHash ()
1631
+
{
1632
+
1633
+
local strippedName casematchOpt=0;
1634
+
strippedName="$(basename -- "$1")";
1635
+
shopt -q nocasematch && casematchOpt=1;
1636
+
shopt -u nocasematch;
1637
+
if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then
1638
+
echo "${strippedName:33}";
1639
+
else
1640
+
echo "$strippedName";
1641
+
fi;
1642
+
if (( casematchOpt )); then
1643
+
shopt -s nocasematch;
1644
+
fi
1645
+
}
1646
+
substitute ()
1647
+
{
1648
+
1649
+
local input="$1";
1650
+
local output="$2";
1651
+
shift 2;
1652
+
if [ ! -f "$input" ]; then
1653
+
echo "substitute(): ERROR: file '$input' does not exist" 1>&2;
1654
+
return 1;
1655
+
fi;
1656
+
local content;
1657
+
consumeEntire content < "$input";
1658
+
if [ -e "$output" ]; then
1659
+
chmod +w "$output";
1660
+
fi;
1661
+
substituteStream content "file '$input'" "$@" > "$output"
1662
+
}
1663
+
substituteAll ()
1664
+
{
1665
+
1666
+
local input="$1";
1667
+
local output="$2";
1668
+
local -a args=();
1669
+
_allFlags;
1670
+
substitute "$input" "$output" "${args[@]}"
1671
+
}
1672
+
substituteAllInPlace ()
1673
+
{
1674
+
1675
+
local fileName="$1";
1676
+
shift;
1677
+
substituteAll "$fileName" "$fileName" "$@"
1678
+
}
1679
+
substituteAllStream ()
1680
+
{
1681
+
1682
+
local -a args=();
1683
+
_allFlags;
1684
+
substituteStream "$1" "$2" "${args[@]}"
1685
+
}
1686
+
substituteInPlace ()
1687
+
{
1688
+
1689
+
local -a fileNames=();
1690
+
for arg in "$@";
1691
+
do
1692
+
if [[ "$arg" = "--"* ]]; then
1693
+
break;
1694
+
fi;
1695
+
fileNames+=("$arg");
1696
+
shift;
1697
+
done;
1698
+
for file in "${fileNames[@]}";
1699
+
do
1700
+
substitute "$file" "$file" "$@";
1701
+
done
1702
+
}
1703
+
substituteStream ()
1704
+
{
1705
+
1706
+
local var=$1;
1707
+
local description=$2;
1708
+
shift 2;
1709
+
while (( "$#" )); do
1710
+
case "$1" in
1711
+
--replace)
1712
+
pattern="$2";
1713
+
replacement="$3";
1714
+
shift 3;
1715
+
local savedvar;
1716
+
savedvar="${!var}";
1717
+
eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}';
1718
+
if [ "$pattern" != "$replacement" ]; then
1719
+
if [ "${!var}" == "$savedvar" ]; then
1720
+
echo "substituteStream(): WARNING: pattern '$pattern' doesn't match anything in $description" 1>&2;
1721
+
fi;
1722
+
fi
1723
+
;;
1724
+
--subst-var)
1725
+
local varName="$2";
1726
+
shift 2;
1727
+
if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then
1728
+
echo "substituteStream(): ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2;
1729
+
return 1;
1730
+
fi;
1731
+
if [ -z ${!varName+x} ]; then
1732
+
echo "substituteStream(): ERROR: variable \$$varName is unset" 1>&2;
1733
+
return 1;
1734
+
fi;
1735
+
pattern="@$varName@";
1736
+
replacement="${!varName}";
1737
+
eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'
1738
+
;;
1739
+
--subst-var-by)
1740
+
pattern="@$2@";
1741
+
replacement="$3";
1742
+
eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}';
1743
+
shift 3
1744
+
;;
1745
+
*)
1746
+
echo "substituteStream(): ERROR: Invalid command line argument: $1" 1>&2;
1747
+
return 1
1748
+
;;
1749
+
esac;
1750
+
done;
1751
+
printf "%s" "${!var}"
1752
+
}
1753
+
unpackFile ()
1754
+
{
1755
+
1756
+
curSrc="$1";
1757
+
echo "unpacking source archive $curSrc";
1758
+
if ! runOneHook unpackCmd "$curSrc"; then
1759
+
echo "do not know how to unpack source archive $curSrc";
1760
+
exit 1;
1761
+
fi
1762
+
}
1763
+
unpackPhase ()
1764
+
{
1765
+
1766
+
runHook preUnpack;
1767
+
if [ -z "${srcs:-}" ]; then
1768
+
if [ -z "${src:-}" ]; then
1769
+
echo 'variable $src or $srcs should point to the source';
1770
+
exit 1;
1771
+
fi;
1772
+
srcs="$src";
1773
+
fi;
1774
+
local -a srcsArray;
1775
+
if [ -n "$__structuredAttrs" ]; then
1776
+
srcsArray=("${srcs[@]}");
1777
+
else
1778
+
srcsArray=($srcs);
1779
+
fi;
1780
+
local dirsBefore="";
1781
+
for i in *;
1782
+
do
1783
+
if [ -d "$i" ]; then
1784
+
dirsBefore="$dirsBefore $i ";
1785
+
fi;
1786
+
done;
1787
+
for i in "${srcsArray[@]}";
1788
+
do
1789
+
unpackFile "$i";
1790
+
done;
1791
+
: "${sourceRoot=}";
1792
+
if [ -n "${setSourceRoot:-}" ]; then
1793
+
runOneHook setSourceRoot;
1794
+
else
1795
+
if [ -z "$sourceRoot" ]; then
1796
+
for i in *;
1797
+
do
1798
+
if [ -d "$i" ]; then
1799
+
case $dirsBefore in
1800
+
*\ $i\ *)
1801
+
1802
+
;;
1803
+
*)
1804
+
if [ -n "$sourceRoot" ]; then
1805
+
echo "unpacker produced multiple directories";
1806
+
exit 1;
1807
+
fi;
1808
+
sourceRoot="$i"
1809
+
;;
1810
+
esac;
1811
+
fi;
1812
+
done;
1813
+
fi;
1814
+
fi;
1815
+
if [ -z "$sourceRoot" ]; then
1816
+
echo "unpacker appears to have produced no directories";
1817
+
exit 1;
1818
+
fi;
1819
+
echo "source root is $sourceRoot";
1820
+
if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then
1821
+
chmod -R u+w -- "$sourceRoot";
1822
+
fi;
1823
+
runHook postUnpack
1824
+
}
1825
+
updateAutotoolsGnuConfigScriptsPhase ()
1826
+
{
1827
+
1828
+
if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then
1829
+
return;
1830
+
fi;
1831
+
for script in config.sub config.guess;
1832
+
do
1833
+
for f in $(find . -type f -name "$script");
1834
+
do
1835
+
echo "Updating Autotools / GNU config script to a newer upstream version: $f";
1836
+
cp -f "/nix/store/7lk76vdawbx478qq9lvi3mgf73rvcyhd-gnu-config-2023-09-19/$script" "$f";
1837
+
done;
1838
+
done
1839
+
}
1840
+
updateSourceDateEpoch ()
1841
+
{
1842
+
1843
+
local path="$1";
1844
+
local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ %p\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1));
1845
+
local time="${res[0]//\.[0-9]*/}";
1846
+
local newestFile="${res[1]}";
1847
+
if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then
1848
+
echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile";
1849
+
export SOURCE_DATE_EPOCH="$time";
1850
+
local now="$(date +%s)";
1851
+
if [ "$time" -gt $((now - 60)) ]; then
1852
+
echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic";
1853
+
fi;
1854
+
fi
1855
+
}
1856
+
PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}"
1857
+
XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}"
1858
+
export NIX_BUILD_TOP="$(mktemp -d -t nix-shell.XXXXXX)"
1859
+
export TMP="$NIX_BUILD_TOP"
1860
+
export TMPDIR="$NIX_BUILD_TOP"
1861
+
export TEMP="$NIX_BUILD_TOP"
1862
+
export TEMPDIR="$NIX_BUILD_TOP"
1863
+
eval "$shellHook"
dns/test_nullhex.sh
dns/test_nullhex.sh
+3
-3
flake.lock
+3
-3
flake.lock
···
451
451
},
452
452
"nixpkgs_2": {
453
453
"locked": {
454
-
"lastModified": 1704874635,
455
-
"narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=",
454
+
"lastModified": 1710420202,
455
+
"narHash": "sha256-MvFKESbq4rUWuaf2RKPNYENaSZEw/jaCLo2gU6oREcM=",
456
456
"owner": "nixos",
457
457
"repo": "nixpkgs",
458
-
"rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356",
458
+
"rev": "878ef7d9721bee9f81f8a80819f9211ad1f993da",
459
459
"type": "github"
460
460
},
461
461
"original": {
+2
-1
flake.nix
+2
-1
flake.nix
···
1
1
{
2
-
description = "Your new nix config";
2
+
description = "Sealight NixOS Config";
3
3
4
4
inputs = {
5
5
# Nixpkgs
···
271
271
hostname = "mossnet.lan";
272
272
autoRollback = false;
273
273
magicRollback = false;
274
+
remoteBuild = true;
274
275
profiles.system = {
275
276
user = "root";
276
277
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.box;
-1
home/core/default.nix
-1
home/core/default.nix
+1
home/gui/default.nix
+1
home/gui/default.nix
+11
-6
home/profiles/cli/default.nix
+11
-6
home/profiles/cli/default.nix
···
26
26
iftop
27
27
wget
28
28
curl
29
-
exa
29
+
eza
30
30
bat
31
31
fd
32
32
ncdu
33
+
du-dust
34
+
# dia-cli
33
35
duf
34
36
trash-cli
35
37
nix-index
···
216
218
gen-secret = "< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c\${1:-32};echo;";
217
219
218
220
# modern cli tools
219
-
ls = "exa --icons";
220
-
l = "exa -l --icons";
221
-
la = "exa -la --icons";
221
+
ls = "eza --icons";
222
+
l = "esa -l --icons";
223
+
la = "eza -la --icons";
222
224
tree = "ls --tree --icons";
223
225
cat = "bat";
224
226
unzip = "aunpack";
···
229
231
make-secret = "< /dev/urandom \\tr -dc _A-Za-z0-9 | head -c \${1:-32};echo;";
230
232
231
233
# task warrior
232
-
# TODO: make blocked a context?
233
234
t = "task -BLOCKED -idea -backlog";
235
+
tw = "t rc.context:work";
236
+
# TODO find a reasonable way to manage this from a non-nix managed file in ~/.task/context or something
237
+
# we can do something like task rc.context:$(cat ~/.task/context) to read context
238
+
# and write a little script make-context = cat $@ > ~/.task/context or something
234
239
tt = "taskwarrior-tui -r list";
235
240
ti = "task +idea";
236
241
tb = "task +backlog list";
237
242
ttb = "taskwarrior-tui -r backlog";
238
243
tr = "task newest limit:page";
239
-
tw = "task +wait";
244
+
twait = "task +wait";
240
245
ta = "task add";
241
246
tai = "task add +idea";
242
247
tn = "task-note";
home/profiles/desktop/Xresources
home/profiles/desktop/Xresources
home/profiles/desktop/polybar/run.sh
home/profiles/desktop/polybar/run.sh
+1
-1
home/profiles/email/default.nix
+1
-1
home/profiles/email/default.nix
···
175
175
bind editor ^T complete
176
176
177
177
# Press A to archive
178
-
macro index,pager A "<clear-flag>N<save-message>=/Archive" "mark message as Archived"
178
+
macro index,pager A "<clear-flag><save-message>=/Archive" "mark message as Archived"
179
179
# Press C to add contact to Khard address book
180
180
macro index,pager C \
181
181
"<pipe-message>khard add-email<return>" \
+1
-1
home/profiles/firefox/default.nix
+1
-1
home/profiles/firefox/default.nix
···
21
21
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
22
22
# Find extensions: https://github.com/nix-community/nur-combined/blob/master/repos/rycee/pkgs/firefox-addons/generated-firefox-addons.nix
23
23
ublock-origin
24
-
wallabagger
24
+
# wallabagger
25
25
# tree-style-tab
26
26
tridactyl
27
27
promnesia
+3
-3
home/profiles/nvim/default.nix
+3
-3
home/profiles/nvim/default.nix
···
148
148
# kitaab zettel
149
149
kz = "cd ~/kitaab/vimwiki; vim -c :VimwikiIndex -c :ZettelNew; cd $OLDPWD";
150
150
# kitaab recents
151
-
kr = "cd /home/anish/kitaab/vimwiki; exa --sort=modified --reverse | fzf --preview 'bat --style=numbers --color=always --terminal-width -1 ./{}';cd $OLDPWD";
151
+
kr = "cd /home/anish/kitaab/vimwiki; eza --sort=modified --reverse | fzf --preview 'bat --style=numbers --color=always --terminal-width -1 ./{}';cd $OLDPWD";
152
152
# kitaab get by tagged
153
-
kt = "cd /home/anish/kitaab/vimwiki; exa *_index.wiki | fzf --preview 'bat --style=numbers --color=always --terminal-width -1 ./{}';cd $OLDPWD";
153
+
kt = "cd /home/anish/kitaab/vimwiki; eza *_index.wiki | fzf --preview 'bat --style=numbers --color=always --terminal-width -1 ./{}';cd $OLDPWD";
154
154
# List files that have no links in them
155
155
ku = "cd /home/anish/kitaab/;vim ./vimwiki/$(python3 poonam/main.py report --titles=false | tail -n +4 | fzf --preview 'bat --style=numbers --color=always --terminal-width -1 ./vimwiki/{}');cd $OLDPWD";
156
156
};
···
804
804
}
805
805
}
806
806
-- You gotta run :SCNvimGenerateAssets for this first
807
-
require("luasnip").add_snippets("supercollider", require("scnvim/utils").get_snippets())
807
+
-- require("luasnip").add_snippets("supercollider", require("scnvim/utils").get_snippets())
808
808
809
809
-- zen mode
810
810
require('zen-mode').setup{
home/profiles/task/bin/set-backlog.sh
home/profiles/task/bin/set-backlog.sh
home/profiles/task/bin/set-focus.sh
home/profiles/task/bin/set-focus.sh
+1
-1
home/profiles/task/default.nix
+1
-1
home/profiles/task/default.nix
···
9
9
# this way, we get a copy of the file, and we make sure it's writable
10
10
".taskrc".source = ./taskrc;
11
11
".taskrc".executable = true;
12
-
".taskrc".onChange = "cp ~/.taskrc ~/.taskrc2;rm ~/.taskrc;mv ~/.taskrc2 ~/.taskrc;chmod +w ~/.taskrc";
12
+
# ".taskrc".onChange = "cp ~/.taskrc ~/.taskrc2;rm ~/.taskrc;mv ~/.taskrc2 ~/.taskrc;chmod +w ~/.taskrc";
13
13
".task/keys/ca.cert".source = ./ca.cert;
14
14
".task/keys/public.cert".source = ./public.cert;
15
15
+5
home/profiles/task/taskrc
+5
home/profiles/task/taskrc
···
82
82
report.every.labels=ID,Active,Deps,P,Project,Tag,Recur,S,Due,Until,Description
83
83
report.every.columns=id,start.age,depends,priority,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description
84
84
85
+
report.poms.filter=(status:pending -idea -backlog -BLOCKED)
86
+
report.poms.labels=UUID,ID,Project,Tag,Description
87
+
report.poms.columns=uuid,id,project,tags,description
88
+
report.poms.sort=start+,urgency+
89
+
85
90
# Urgency
86
91
urgency.user.project.wait.coefficient=-10.0
87
92
urgency.user.project.craft.coefficient=1.9
+5
-4
hosts/box/default.nix
+5
-4
hosts/box/default.nix
···
7
7
../profiles/taskd
8
8
../profiles/shaarli
9
9
../profiles/dns
10
-
../profiles/monitoring
10
+
# ../profiles/monitoring
11
11
../profiles/nfs
12
12
../profiles/gonic
13
-
../profiles/headphones
13
+
../profiles/headphones
14
14
../profiles/radicale
15
-
../profiles/seafile
15
+
../profiles/seafile
16
16
../profiles/syncthing
17
17
../profiles/dhyan
18
18
../profiles/calibre
···
22
22
../profiles/grasp
23
23
# ../profiles/archivebox
24
24
# ../profiles/woodpecker-agent
25
-
../profiles/jellyfin
25
+
# ../profiles/jellyfin
26
26
../profiles/ulogger-server
27
27
../profiles/photoprism
28
+
#../profiles/postgres_upgrade_script
28
29
];
29
30
30
31
# Backups
+7
-1
hosts/curve/default.nix
+7
-1
hosts/curve/default.nix
···
20
20
# import profiling tools
21
21
programs.systemtap.enable = true;
22
22
23
+
virtualisation.docker.enable = true;
24
+
virtualisation.docker.storageDriver = "btrfs";
25
+
environment.systemPackages = with pkgs; [
26
+
docker-compose
27
+
];
28
+
23
29
# Speed up boot by removing dependency on network
24
30
systemd = {
25
31
targets.network-online.wantedBy = pkgs.lib.mkForce [ ]; # Normally ["multi-user.target"]
···
87
93
#virtualisation.docker.enable = true;
88
94
boot.blacklistedKernelModules = [ "qcserial" ];
89
95
# Used for packer Capsul
90
-
users.users.anish.extraGroups = [ "adbusers" "wheel" "plugdev" "libvertd" ];
96
+
users.users.anish.extraGroups = [ "adbusers" "wheel" "plugdev" "libvertd" "docker" ];
91
97
virtualisation.libvirtd.enable = true;
92
98
hardware.keyboard.zsa.enable = true;
93
99
services.udev.extraRules = ''
+12
-16
hosts/curve/hardware-configuration.nix
+12
-16
hosts/curve/hardware-configuration.nix
···
5
5
6
6
{
7
7
imports =
8
-
[
9
-
(modulesPath + "/installer/scan/not-detected.nix")
8
+
[ (modulesPath + "/installer/scan/not-detected.nix")
10
9
];
11
10
12
-
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc" ];
11
+
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
13
12
boot.initrd.kernelModules = [ "dm-snapshot" ];
14
13
boot.kernelModules = [ "kvm-intel" ];
15
14
boot.extraModulePackages = [ ];
16
15
17
-
fileSystems."/boot" =
18
-
{
19
-
device = "/dev/disk/by-uuid/2C41-3DAA";
20
-
fsType = "vfat";
21
-
};
22
-
23
16
fileSystems."/" =
24
-
{
25
-
device = "/dev/disk/by-uuid/a4ae2855-10b9-49f3-adb0-acd82b74eeb9";
17
+
{ device = "/dev/disk/by-uuid/e1268753-4f18-4e6f-8edb-d4724ad8eb4a";
26
18
fsType = "btrfs";
27
19
options = [ "subvol=root" ];
28
20
};
29
21
30
22
fileSystems."/home" =
31
-
{
32
-
device = "/dev/disk/by-uuid/a4ae2855-10b9-49f3-adb0-acd82b74eeb9";
23
+
{ device = "/dev/disk/by-uuid/e1268753-4f18-4e6f-8edb-d4724ad8eb4a";
33
24
fsType = "btrfs";
34
25
options = [ "subvol=home" ];
35
26
};
36
27
28
+
fileSystems."/boot" =
29
+
{ device = "/dev/disk/by-uuid/8244-A184";
30
+
fsType = "vfat";
31
+
};
32
+
37
33
swapDevices =
38
-
[{ device = "/dev/disk/by-uuid/23658926-6ffa-42dc-8915-a6479c385e0b"; }];
34
+
[ { device = "/dev/disk/by-uuid/e220fea6-cf3b-4687-bfe1-9cf6d3ba57f7"; }
35
+
];
39
36
40
37
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
41
38
# (the default) this is the recommended approach. When using systemd-networkd it's
···
46
43
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
47
44
48
45
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
49
-
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
50
-
# hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
46
+
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
51
47
}
+337
hosts/development/mirlo/docker-compose.nix
+337
hosts/development/mirlo/docker-compose.nix
···
1
+
# Auto-generated using compose2nix v0.1.6.
2
+
{ pkgs, lib, ... }:
3
+
4
+
{
5
+
# Runtime
6
+
virtualisation.podman = {
7
+
enable = true;
8
+
autoPrune.enable = true;
9
+
dockerCompat = true;
10
+
defaultNetwork.settings = {
11
+
# Required for container networking to be able to use names.
12
+
dns_enabled = true;
13
+
};
14
+
};
15
+
virtualisation.oci-containers.backend = "podman";
16
+
17
+
# Containers
18
+
virtualisation.oci-containers.containers."blackbird-api" = {
19
+
image = "";
20
+
environment = {
21
+
API_DOMAIN = "http://localhost:3000";
22
+
DATABASE_URL = "postgresql://nomads:nomads@pgsql:5432/nomads?schema=public";
23
+
JWT_SECRET = "test1234";
24
+
MEDIA_LOCATION = "./data/media/";
25
+
MEDIA_LOCATION_DOWNLOAD_CACHE = "/data/media/downloadCache";
26
+
MEDIA_LOCATION_INCOMING = "/data/media/incoming";
27
+
MINIO_HOST = "minio";
28
+
MINIO_PORT = "9000";
29
+
MINIO_ROOT_PASSWORD = "password";
30
+
MINIO_ROOT_USER = "blackbird";
31
+
NODE_ENV = "development";
32
+
PORT = "3000";
33
+
POSTGRES_LOCAL_MACHINE_PORT = "5434";
34
+
POSTGRES_PASSWORD = "nomads";
35
+
POSTGRES_USER = "nomads";
36
+
REACT_APP_API_DOMAIN = "http://localhost:3000";
37
+
REDIS_HOST = "redis";
38
+
REDIS_PASSWORD = "password";
39
+
REDIS_PORT = "6379";
40
+
REFRESH_TOKEN_SECRET = "test1234";
41
+
STATIC_MEDIA_HOST = "http://localhost:3000";
42
+
STRIPE_KEY = "";
43
+
};
44
+
volumes = [
45
+
"/home/anish/.ssh:/root/.ssh:rw"
46
+
"/home/anish/usr/mirlo:/var/www/api:rw"
47
+
"/home/anish/usr/mirlo/data/media/downloadCache:/data/media/downloadCache:rw"
48
+
"/home/anish/usr/mirlo/data/media/incoming:/data/media/incoming:rw"
49
+
];
50
+
ports = [
51
+
"3000:3000/tcp"
52
+
];
53
+
cmd = [ "/bin/sh" "-c" "yarn && yarn migrate:deploy && yarn dev:api" ];
54
+
dependsOn = [
55
+
"blackbird-minio"
56
+
"blackbird-pgsql"
57
+
"blackbird-redis"
58
+
];
59
+
log-driver = "journald";
60
+
extraOptions = [
61
+
"--network-alias=api"
62
+
"--network=mirlo-api-network"
63
+
"--network=mirlo-redis-network"
64
+
];
65
+
};
66
+
systemd.services."podman-blackbird-api" = {
67
+
serviceConfig = {
68
+
Restart = lib.mkOverride 500 "always";
69
+
};
70
+
after = [
71
+
"podman-network-mirlo-api-network.service"
72
+
"podman-network-mirlo-redis-network.service"
73
+
];
74
+
requires = [
75
+
"podman-network-mirlo-api-network.service"
76
+
"podman-network-mirlo-redis-network.service"
77
+
];
78
+
partOf = [
79
+
"podman-compose-mirlo-root.target"
80
+
];
81
+
unitConfig.UpheldBy = [
82
+
"podman-blackbird-minio.service"
83
+
"podman-blackbird-pgsql.service"
84
+
"podman-blackbird-redis.service"
85
+
];
86
+
wantedBy = [
87
+
"podman-compose-mirlo-root.target"
88
+
];
89
+
};
90
+
virtualisation.oci-containers.containers."blackbird-background" = {
91
+
image = "";
92
+
environment = {
93
+
API_DOMAIN = "http://localhost:3000";
94
+
DATABASE_URL = "postgresql://nomads:nomads@pgsql:5432/nomads?schema=public";
95
+
JWT_SECRET = "test1234";
96
+
MEDIA_LOCATION = "./data/media/";
97
+
MEDIA_LOCATION_DOWNLOAD_CACHE = "/data/media/downloadCache";
98
+
MEDIA_LOCATION_INCOMING = "/data/media/incoming";
99
+
MINIO_HOST = "minio";
100
+
MINIO_PORT = "9000";
101
+
MINIO_ROOT_PASSWORD = "password";
102
+
MINIO_ROOT_USER = "blackbird";
103
+
NODE_ENV = "development";
104
+
PORT = "3000";
105
+
POSTGRES_LOCAL_MACHINE_PORT = "5434";
106
+
POSTGRES_PASSWORD = "nomads";
107
+
POSTGRES_USER = "nomads";
108
+
REACT_APP_API_DOMAIN = "http://localhost:3000";
109
+
REDIS_HOST = "redis";
110
+
REDIS_PASSWORD = "password";
111
+
REDIS_PORT = "6379";
112
+
REFRESH_TOKEN_SECRET = "test1234";
113
+
STATIC_MEDIA_HOST = "http://localhost:3000";
114
+
STRIPE_KEY = "";
115
+
};
116
+
volumes = [
117
+
"/home/anish/.ssh:/root/.ssh:rw"
118
+
"/home/anish/usr/mirlo:/var/www/api:rw"
119
+
"/home/anish/usr/mirlo/data/media/processing:/data/media/processing:rw"
120
+
];
121
+
dependsOn = [
122
+
"blackbird-api"
123
+
"blackbird-minio"
124
+
"blackbird-pgsql"
125
+
"blackbird-redis"
126
+
];
127
+
log-driver = "journald";
128
+
extraOptions = [
129
+
"--network-alias=background"
130
+
"--network=mirlo-api-network"
131
+
"--network=mirlo-redis-network"
132
+
];
133
+
};
134
+
systemd.services."podman-blackbird-background" = {
135
+
serviceConfig = {
136
+
Restart = lib.mkOverride 500 "always";
137
+
};
138
+
after = [
139
+
"podman-network-mirlo-api-network.service"
140
+
"podman-network-mirlo-redis-network.service"
141
+
];
142
+
requires = [
143
+
"podman-network-mirlo-api-network.service"
144
+
"podman-network-mirlo-redis-network.service"
145
+
];
146
+
partOf = [
147
+
"podman-compose-mirlo-root.target"
148
+
];
149
+
unitConfig.UpheldBy = [
150
+
"podman-blackbird-api.service"
151
+
"podman-blackbird-minio.service"
152
+
"podman-blackbird-pgsql.service"
153
+
"podman-blackbird-redis.service"
154
+
];
155
+
wantedBy = [
156
+
"podman-compose-mirlo-root.target"
157
+
];
158
+
};
159
+
virtualisation.oci-containers.containers."blackbird-minio" = {
160
+
image = "minio/minio";
161
+
environment = {
162
+
API_DOMAIN = "http://localhost:3000";
163
+
DATABASE_URL = "postgresql://nomads:nomads@pgsql:5432/nomads?schema=public";
164
+
JWT_SECRET = "test1234";
165
+
MEDIA_LOCATION = "./data/media/";
166
+
MEDIA_LOCATION_DOWNLOAD_CACHE = "/data/media/downloadCache";
167
+
MEDIA_LOCATION_INCOMING = "/data/media/incoming";
168
+
MINIO_HOST = "minio";
169
+
MINIO_PORT = "9000";
170
+
MINIO_ROOT_PASSWORD = "password";
171
+
MINIO_ROOT_USER = "blackbird";
172
+
PORT = "3000";
173
+
POSTGRES_LOCAL_MACHINE_PORT = "5434";
174
+
POSTGRES_PASSWORD = "nomads";
175
+
POSTGRES_USER = "nomads";
176
+
REACT_APP_API_DOMAIN = "http://localhost:3000";
177
+
REDIS_HOST = "redis";
178
+
REDIS_PASSWORD = "password";
179
+
REDIS_PORT = "6379";
180
+
REFRESH_TOKEN_SECRET = "test1234";
181
+
STATIC_MEDIA_HOST = "http://localhost:3000";
182
+
STRIPE_KEY = "";
183
+
};
184
+
volumes = [
185
+
"/home/anish/usr/mirlo/data/minio_storage:/data:rw"
186
+
];
187
+
ports = [
188
+
"9000:9000/tcp"
189
+
"9001:9001/tcp"
190
+
];
191
+
cmd = [ "server" "--console-address" ":9001" "/data" ];
192
+
log-driver = "journald";
193
+
extraOptions = [
194
+
"--network-alias=minio"
195
+
"--network=mirlo-api-network:alias=minio"
196
+
];
197
+
};
198
+
systemd.services."podman-blackbird-minio" = {
199
+
serviceConfig = {
200
+
Restart = lib.mkOverride 500 "no";
201
+
};
202
+
after = [
203
+
"podman-network-mirlo-api-network.service"
204
+
];
205
+
requires = [
206
+
"podman-network-mirlo-api-network.service"
207
+
];
208
+
partOf = [
209
+
"podman-compose-mirlo-root.target"
210
+
];
211
+
wantedBy = [
212
+
"podman-compose-mirlo-root.target"
213
+
];
214
+
};
215
+
virtualisation.oci-containers.containers."blackbird-pgsql" = {
216
+
image = "postgres:14-alpine";
217
+
environment = {
218
+
API_DOMAIN = "http://localhost:3000";
219
+
DATABASE_URL = "postgresql://nomads:nomads@pgsql:5432/nomads?schema=public";
220
+
JWT_SECRET = "test1234";
221
+
MEDIA_LOCATION = "./data/media/";
222
+
MEDIA_LOCATION_DOWNLOAD_CACHE = "/data/media/downloadCache";
223
+
MEDIA_LOCATION_INCOMING = "/data/media/incoming";
224
+
MINIO_HOST = "minio";
225
+
MINIO_PORT = "9000";
226
+
MINIO_ROOT_PASSWORD = "password";
227
+
MINIO_ROOT_USER = "blackbird";
228
+
PORT = "3000";
229
+
POSTGRES_LOCAL_MACHINE_PORT = "5434";
230
+
POSTGRES_PASSWORD = "nomads";
231
+
POSTGRES_USER = "nomads";
232
+
REACT_APP_API_DOMAIN = "http://localhost:3000";
233
+
REDIS_HOST = "redis";
234
+
REDIS_PASSWORD = "password";
235
+
REDIS_PORT = "6379";
236
+
REFRESH_TOKEN_SECRET = "test1234";
237
+
STATIC_MEDIA_HOST = "http://localhost:3000";
238
+
STRIPE_KEY = "";
239
+
};
240
+
volumes = [
241
+
"/home/anish/usr/mirlo/data/pgsql:/var/lib/postgresql/data:rw"
242
+
"/home/anish/usr/mirlo/data/pgsql_backups:/backups:rw"
243
+
];
244
+
ports = [
245
+
"5432:5432/tcp"
246
+
];
247
+
log-driver = "journald";
248
+
extraOptions = [
249
+
"--network-alias=pgsql"
250
+
"--network=mirlo-api-network:alias=pgsql"
251
+
];
252
+
};
253
+
systemd.services."podman-blackbird-pgsql" = {
254
+
serviceConfig = {
255
+
Restart = lib.mkOverride 500 "no";
256
+
};
257
+
after = [
258
+
"podman-network-mirlo-api-network.service"
259
+
];
260
+
requires = [
261
+
"podman-network-mirlo-api-network.service"
262
+
];
263
+
partOf = [
264
+
"podman-compose-mirlo-root.target"
265
+
];
266
+
wantedBy = [
267
+
"podman-compose-mirlo-root.target"
268
+
];
269
+
};
270
+
virtualisation.oci-containers.containers."blackbird-redis" = {
271
+
image = "redis";
272
+
ports = [
273
+
"6379:6379/tcp"
274
+
];
275
+
cmd = [ "redis-server" "--appendonly" "yes" "--requirepass " ];
276
+
log-driver = "journald";
277
+
extraOptions = [
278
+
"--network-alias=redis"
279
+
"--network=mirlo-redis-network"
280
+
];
281
+
};
282
+
systemd.services."podman-blackbird-redis" = {
283
+
serviceConfig = {
284
+
Restart = lib.mkOverride 500 "always";
285
+
};
286
+
after = [
287
+
"podman-network-mirlo-redis-network.service"
288
+
];
289
+
requires = [
290
+
"podman-network-mirlo-redis-network.service"
291
+
];
292
+
partOf = [
293
+
"podman-compose-mirlo-root.target"
294
+
];
295
+
wantedBy = [
296
+
"podman-compose-mirlo-root.target"
297
+
];
298
+
};
299
+
300
+
# Networks
301
+
systemd.services."podman-network-mirlo-api-network" = {
302
+
path = [ pkgs.podman ];
303
+
serviceConfig = {
304
+
Type = "oneshot";
305
+
RemainAfterExit = true;
306
+
ExecStop = "${pkgs.podman}/bin/podman network rm -f mirlo-api-network";
307
+
};
308
+
script = ''
309
+
podman network inspect mirlo-api-network || podman network create mirlo-api-network --opt isolate=true
310
+
'';
311
+
partOf = [ "podman-compose-mirlo-root.target" ];
312
+
wantedBy = [ "podman-compose-mirlo-root.target" ];
313
+
};
314
+
systemd.services."podman-network-mirlo-redis-network" = {
315
+
path = [ pkgs.podman ];
316
+
serviceConfig = {
317
+
Type = "oneshot";
318
+
RemainAfterExit = true;
319
+
ExecStop = "${pkgs.podman}/bin/podman network rm -f mirlo-redis-network";
320
+
};
321
+
script = ''
322
+
podman network inspect mirlo-redis-network || podman network create mirlo-redis-network --opt isolate=true
323
+
'';
324
+
partOf = [ "podman-compose-mirlo-root.target" ];
325
+
wantedBy = [ "podman-compose-mirlo-root.target" ];
326
+
};
327
+
328
+
# Root service
329
+
# When started, this will automatically create all resources and start
330
+
# the containers. When stopped, this will teardown all resources.
331
+
systemd.targets."podman-compose-mirlo-root" = {
332
+
unitConfig = {
333
+
Description = "Root target generated by compose2nix.";
334
+
};
335
+
wantedBy = [ "multi-user.target" ];
336
+
};
337
+
}
+4
-3
hosts/helix/default.nix
+4
-3
hosts/helix/default.nix
···
11
11
# ../profiles/mount-mossnet
12
12
../profiles/freshrss
13
13
../profiles/microbin
14
+
# ../profiles/postgres_upgrade_script
14
15
];
15
16
16
17
# Capsul specific
···
27
28
privateKeyFile = "/run/agenix/helix-wg";
28
29
};
29
30
30
-
services.postgresql.package = pkgs.postgresql_11;
31
+
services.postgresql.package = pkgs.postgresql_15;
31
32
services.postgresqlBackup = {
32
33
# TODO needs working wireguard to box
33
34
enable = false;
34
-
databases = [ "gitea" "freshrss" "woodpecker" ];
35
+
databases = [ "gitea" "freshrss" ]; # "woodpecker"
35
36
location = "/mnt/two/postgres";
36
37
};
37
38
···
41
42
paths = [
42
43
"/var/lib/gitea"
43
44
"/var/lib/freshrss"
44
-
"/var/lib/woodpecker"
45
+
# "/var/lib/woodpecker"
45
46
"/var/lib/microbin"
46
47
];
47
48
+1
-1
hosts/profiles/core/default.nix
+1
-1
hosts/profiles/core/default.nix
+5
-2
hosts/profiles/desktop/default.nix
+5
-2
hosts/profiles/desktop/default.nix
···
99
99
papirus-icon-theme
100
100
calendar-cli
101
101
wyrd
102
-
tic-80
102
+
# tic-80
103
103
ytfzf
104
104
yt-dlp
105
105
];
···
123
123
};
124
124
xserver = {
125
125
enable = true;
126
-
xkb.layout = "us,dvorak";
126
+
# TODO should be xkb.layout
127
+
layout = "us";
128
+
# xkb.variant = "dvorak";
127
129
desktopManager.wallpaper.mode = "fill";
128
130
displayManager = {
131
+
# startx.enable = true;
129
132
defaultSession = "none+bspwm";
130
133
sessionCommands = ''
131
134
${pkgs.xorg.xrdb}/bin/xrdb -merge <<EOF
+8
-7
hosts/profiles/freshrss/default.nix
+8
-7
hosts/profiles/freshrss/default.nix
···
17
17
18
18
services.postgresql = {
19
19
enable = true; # Ensure postgresql is enabled
20
-
authentication = ''
21
-
local freshrss all ident map=freshrss-users
22
-
'';
23
-
identMap = # Map the freshrss user to postgresql
24
-
''
25
-
freshrss-users freshrss freshrss
26
-
'';
20
+
# authentication = ''
21
+
# local freshrss all ident map=freshrss-users
22
+
# '';
23
+
# identMap = # Map the freshrss user to postgresql
24
+
# ''
25
+
# freshrss-users freshrss freshrss
26
+
# freshrss-users postgres freshrss
27
+
# '';
27
28
ensureDatabases = [ "freshrss" ];
28
29
ensureUsers = [{
29
30
name = "freshrss";
+8
-7
hosts/profiles/gitea/default.nix
+8
-7
hosts/profiles/gitea/default.nix
···
46
46
environment.systemPackages = [ pkgs.pandoc ];
47
47
services.postgresql = {
48
48
enable = true; # Ensure postgresql is enabled
49
-
authentication = ''
50
-
local gitea all ident map=gitea-users
51
-
'';
52
-
identMap = # Map the gitea user to postgresql
53
-
''
54
-
gitea-users gitea gitea
55
-
'';
49
+
# authentication = ''
50
+
# local gitea all ident map=gitea-users
51
+
# '';
52
+
# identMap = # Map the gitea user to postgresql
53
+
# ''
54
+
# gitea-users gitea gitea
55
+
# gitea-users postgres gitea
56
+
# '';
56
57
ensureDatabases = [ "gitea" ];
57
58
ensureUsers = [{
58
59
name = "gitea";
+2
-2
hosts/profiles/microbin/default.nix
+2
-2
hosts/profiles/microbin/default.nix
···
1
1
{ config, lib, pkgs, ... }:
2
2
{
3
3
services.microbin.enable = true;
4
-
services.microbin.hostname = "bin.sealight.xyz";
5
-
services.microbin.port = 4949;
4
+
services.microbin.settings.PUBLIC_PATH = "bin.sealight.xyz";
5
+
services.microbin.settings.MICROBIN_PORT = 4949;
6
6
networking.firewall.allowedTCPPorts = [ 4949 ];
7
7
services.nginx.virtualHosts."bin.sealight.xyz" = {
8
8
enableACME = true;
+2
-2
hosts/profiles/music/default.nix
+2
-2
hosts/profiles/music/default.nix
···
16
16
orca-c
17
17
supercollider
18
18
dirt
19
-
sunvox
19
+
# sunvox
20
20
vcv-rack
21
21
lmms
22
22
bespokesynth
···
38
38
alsa.enable = true;
39
39
alsa.support32Bit = false;
40
40
pulse.enable = true;
41
-
jack.enable = true;
41
+
jack.enable = true;
42
42
# Deprecated as of 23.05
43
43
# config = {
44
44
# pipewire."context.properties"."default.clock.rate" = "48000";
+3
-4
hosts/profiles/postgres_upgrade_script/default.nix
+3
-4
hosts/profiles/postgres_upgrade_script/default.nix
···
6
6
# TODO it's perhaps advisable to stop all services that depend on postgresql
7
7
systemctl stop postgresql
8
8
9
-
# TODO replace `<new version>` with the psqlSchema here
10
9
# The schema can be found by running:
11
-
# nix-instantiate '<nixpkgs>' --eval -A postgresql_14.psqlSchema
12
-
export NEWDATA="/var/lib/postgresql/<new version>"
10
+
# nix eval --raw nixpkgs#postgresql_15.psqlSchema
11
+
export NEWDATA="/var/lib/postgresql/15"
13
12
14
13
# TODO specify the postgresql package you'd like to upgrade to
15
-
export NEWBIN="${pkgs.postgresql_14}/bin"
14
+
export NEWBIN="${pkgs.postgresql_15}/bin"
16
15
17
16
export OLDDATA="${config.services.postgresql.dataDir}"
18
17
export OLDBIN="${config.services.postgresql.package}/bin"
hosts/profiles/sync/music/get-music.sh
hosts/profiles/sync/music/get-music.sh
+1
-1
hosts/profiles/ulogger-server/default.nix
+1
-1
hosts/profiles/ulogger-server/default.nix
+3
-2
hosts/profiles/wallabag/default.nix
+3
-2
hosts/profiles/wallabag/default.nix
···
25
25
services.wallabag = {
26
26
enable = true;
27
27
hostName = "read.mossnet.lan";
28
-
package = pkgs.wallabag;
28
+
package = pkgs.my-wallabag;
29
+
dataDir = "/var/lib/wallabag";
29
30
conf = ''
30
31
# This file is a "template" of what your parameters.yml file should look like
31
32
parameters:
···
42
43
# with PostgreSQL and SQLite, you must set "utf8"
43
44
database_charset: utf8
44
45
45
-
domain_name: http://read.mossnet.lan/
46
+
domain_name: http://read.mossnet.lan
46
47
server_name: "mossnet wallabag instance"
47
48
48
49
mailer_dsn: null://
install-encrypted.sh
install-encrypted.sh
+1
-1
install-yubikey.sh
+1
-1
install-yubikey.sh
+1
-1
modules/nixos/default.nix
+1
-1
modules/nixos/default.nix
+15
-21
modules/nixos/wallabag.nix
+15
-21
modules/nixos/wallabag.nix
···
26
26
console = pkgs.writeShellScriptBin "wallabag-console" ''
27
27
export WALLABAG_DATA="${cfg.dataDir}"
28
28
cd "${cfg.dataDir}"
29
-
${pkgs.php}/bin/php ${pkgs.wallabag}/bin/console --env=prod $@
29
+
${pkgs.php}/bin/php ${cfg.package}/bin/console --env=prod $@
30
30
'';
31
31
32
32
in
···
166
166
forceSSL = false;
167
167
root = "${cfg.package}/web";
168
168
169
-
extraConfig = ''
170
-
add_header X-Frame-Options SAMEORIGIN;
171
-
add_header X-Content-Type-Options nosniff;
172
-
add_header X-XSS-Protection "1; mode=block";
173
-
'';
169
+
# extraConfig = ''
170
+
# add_header X-Frame-Options SAMEORIGIN;
171
+
# add_header X-Content-Type-Options nosniff;
172
+
# add_header X-XSS-Protection "1; mode=block";
173
+
# '';
174
174
175
175
locations."/" = {
176
176
tryFiles = "$uri /app.php$is_args$args";
···
179
179
locations."/assets".root = "${cfg.dataDir}/web";
180
180
181
181
locations."~ ^/app\\.php(/|$)" = {
182
-
fastcgiParams = {
183
-
SCRIPT_FILENAME = "$realpath_root$fastcgi_script_name";
184
-
DOCUMENT_ROOT = "$realpath_root";
185
-
};
182
+
# fastcgiParams = {
183
+
# SCRIPT_FILENAME = "$realpath_root$fastcgi_script_name";
184
+
# DOCUMENT_ROOT = "$realpath_root";
185
+
# };
186
186
extraConfig = ''
187
187
fastcgi_pass unix:${config.services.phpfpm.pools."${poolName}".socket};
188
-
include ${config.services.nginx.package}/conf/fastcgi_params;
189
-
include ${config.services.nginx.package}/conf/fastcgi.conf;
188
+
fastcgi_split_path_info ^(.+\.php)(/.*)$;
189
+
include ${pkgs.nginx}/conf/fastcgi_params;
190
+
fastcgi_param SCRIPT_FILENAME ${cfg.package}/web/$fastcgi_script_name;
191
+
fastcgi_param DOCUMENT_ROOT ${cfg.package}/web;
192
+
fastcgi_read_timeout 120;
190
193
internal;
191
194
'';
192
-
# extraConfig = ''
193
-
# fastcgi_pass unix:${config.services.phpfpm.pools."${poolName}".socket};
194
-
# fastcgi_split_path_info ^(.+\.php)(/.*)$;
195
-
# include ${pkgs.nginx}/conf/fastcgi_params;
196
-
# fastcgi_param SCRIPT_FILENAME ${cfg.package}/web/$fastcgi_script_name;
197
-
# fastcgi_param DOCUMENT_ROOT ${cfg.package}/web;
198
-
# fastcgi_read_timeout 120;
199
-
# internal;
200
-
# '';
201
195
};
202
196
203
197
locations."~ /(?!app)\\.php$" = {
+15
-3
mount-crypted.sh
+15
-3
mount-crypted.sh
···
1
1
#!/usr/bin/env bash
2
+
3
+
# nix-shell https://github.com/sgillespie/nixos-yubikey-luks/archive/master.tar.gz
4
+
5
+
rbtohex() {
6
+
( od -An -vtx1 | tr -d ' \n' )
7
+
}
8
+
9
+
hextorb() {
10
+
( tr '[:lower:]' '[:upper:]' | sed -e 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI'| xargs printf )
11
+
}
12
+
2
13
key_length=512
3
-
iterations="$(head -n 2 /boot/crypted-storage/default)"
4
-
salt="$(head -n 1 /boot/crypted-storage/default)"
14
+
iterations=1000000
15
+
salt="$(head -n 1 /mnt/crypt-storage/default)"
5
16
chal="$(echo -n $salt | openssl dgst -binary -sha512 | rbtohex)"
6
17
resp="$(ykchalresp -2 -x $chal 2>/dev/null)"
7
-
user_key="$(read -s)"
18
+
user_key=
19
+
read -r user_key
8
20
luks_key="$(echo -n $user_key | pbkdf2-sha512 $(($key_length / 8)) $iterations $resp | rbtohex)"
9
21
echo -n $luks_key | hextorb | sudo cryptsetup luksOpen /dev/sda2 crypted --key-file=-
+2
pkgs/default.nix
+2
pkgs/default.nix
···
8
8
kobopatch = pkgs.callPackage ./kobopatch.nix { };
9
9
my-mautrix-discord = pkgs.callPackage ./mautrix-discord.nix { }; # Handled by matrix-appservices input
10
10
ulogger-server = pkgs.callPackage ./ulogger.nix { };
11
+
my-wallabag = pkgs.callPackage ./wallabag.nix { };
12
+
mautrix-slack = pkgs.callPackage ./mautrix-slack.nix { };
11
13
}
+1
-1
pkgs/koboutils.nix
+1
-1
pkgs/koboutils.nix
+29
pkgs/mautrix-slack.nix
+29
pkgs/mautrix-slack.nix
···
1
+
{ lib, buildGoModule, fetchFromGitHub, olm }:
2
+
3
+
buildGoModule rec {
4
+
pname = "mautrix-discord";
5
+
version = "unstable-2022-11-04";
6
+
7
+
src = fetchFromGitHub {
8
+
owner = "mautrix";
9
+
repo = "slack";
10
+
rev = "4530ff397d08d93b673cd71da4c2a75d969ca0df";
11
+
hash = "";
12
+
};
13
+
14
+
buildInputs = [ olm ];
15
+
16
+
vendorHash = "sha256-yday2mSnPwuhXWkCG4XY7qoBl3DXHcSvzBoZbjgYz/c=";
17
+
18
+
ldflags = [ "-s" "-w" ]; # https://github.com/NixOS/nixpkgs/issues/177698
19
+
20
+
doCheck = false; # No tests available
21
+
22
+
meta = with lib; {
23
+
homepage = "https://go.mau.fi/mautrix-slack";
24
+
description = "Matrix to Slack hybrid puppeting/relaybot bridge";
25
+
license = licenses.agpl3Plus;
26
+
maintainers = with maintainers; [ ];
27
+
};
28
+
}
29
+
+2
-2
pkgs/tic-80.nix
+2
-2
pkgs/tic-80.nix
+26
pkgs/wallabag-data.patch
+26
pkgs/wallabag-data.patch
···
1
+
diff --git a/app/AppKernel.php b/app/AppKernel.php
2
+
index 61b734e06..d25d1aaa3 100644
3
+
--- a/app/AppKernel.php
4
+
+++ b/app/AppKernel.php
5
+
@@ -62,14 +62,19 @@ class AppKernel extends Kernel
6
+
return $bundles;
7
+
}
8
+
9
+
+ public function getProjectDir()
10
+
+ {
11
+
+ return getenv('WALLABAG_DATA') ?: dirname(__DIR__);
12
+
+ }
13
+
+
14
+
public function getCacheDir()
15
+
{
16
+
- return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
17
+
+ return $this->getProjectDir() . '/var/cache/' . $this->getEnvironment();
18
+
}
19
+
20
+
public function getLogDir()
21
+
{
22
+
- return dirname(__DIR__) . '/var/logs';
23
+
+ return $this->getProjectDir() . '/var/logs';
24
+
}
25
+
26
+
public function registerContainerConfiguration(LoaderInterface $loader)
+57
pkgs/wallabag.nix
+57
pkgs/wallabag.nix
···
1
+
{ lib
2
+
, stdenv
3
+
, fetchurl
4
+
}:
5
+
6
+
# Point the environment variable $WALLABAG_DATA to a data directory
7
+
# that contains the folder `app` which must be a clone of
8
+
# wallabag's configuration files with your customized `parameters.yml`.
9
+
# In practice you need to copy `${pkgs.wallabag}/app` and the
10
+
# customizzed `parameters.yml` to $WALLABAG_DATA.
11
+
# These need to be updated every package upgrade.
12
+
#
13
+
# After a package upgrade, empty the `var/cache` folder or unexpected
14
+
# error will occur.
15
+
16
+
let
17
+
pname = "wallabag";
18
+
version = "2.6.8";
19
+
in
20
+
stdenv.mkDerivation {
21
+
inherit pname version;
22
+
23
+
# Release tarball includes vendored files
24
+
src = fetchurl {
25
+
url = "https://github.com/wallabag/wallabag/releases/download/${version}/wallabag-${version}.tar.gz";
26
+
hash = "sha256-pmQXafqpd5rTwBIYG9NnwIIPta6Ek7iYaPaHvz1s550=";
27
+
};
28
+
29
+
patches = [
30
+
./wallabag-data.patch # exposes $WALLABAG_DATA
31
+
];
32
+
33
+
dontBuild = true;
34
+
35
+
installPhase = ''
36
+
runHook preInstall
37
+
38
+
mkdir $out
39
+
cp -R * $out/
40
+
41
+
runHook postInstall
42
+
'';
43
+
44
+
meta = with lib; {
45
+
description = "wallabag is a self hostable application for saving web pages";
46
+
longDescription = ''
47
+
wallabag is a self-hostable PHP application allowing you to not
48
+
miss any content anymore. Click, save and read it when you can.
49
+
It extracts content so that you can read it when you have time.
50
+
'';
51
+
license = licenses.mit;
52
+
homepage = "http://wallabag.org";
53
+
changelog = "https://github.com/wallabag/wallabag/releases/tag/${version}";
54
+
maintainers = with maintainers; [ schneefux ];
55
+
platforms = platforms.all;
56
+
};
57
+
}