+30
.aider.chat.history.md
+30
.aider.chat.history.md
···
···
1
+
2
+
# aider chat started at 2025-02-07 16:38:26
3
+
4
+
> Newer aider version v0.74.1 is available.
5
+
> python3.11 -m pip install --upgrade --upgrade-strategy only-if-needed aider-chat
6
+
> Run pip install? (Y)es/(N)o [Yes]: y
7
+
> /nix/store/8hkpwrgr7h06di861vhx612xfkrjzpak-python3-3.11.11/bin/python3.11: No module named pip
8
+
> Add .aider*, .env to .gitignore (recommended)? (Y)es/(N)o [Yes]: n
9
+
> /nix/store/cyihi1p1d92g2zg1frmppbm97h893adk-aider-chat-0.62.0/bin/aider
10
+
> Warning: gpt-4o-2024-08-06 expects these environment variables
11
+
> - OPENAI_API_KEY: Not set
12
+
> If you just set these environment variables using `setx` you may need to restart your terminal or command prompt for the changes to take effect.
13
+
> Warning: gpt-4o-mini expects these environment variables
14
+
> - OPENAI_API_KEY: Not set
15
+
> If you just set these environment variables using `setx` you may need to restart your terminal or command prompt for the changes to take effect.
16
+
> You can skip this check with --no-show-model-warnings
17
+
> https://aider.chat/docs/llms/warnings.html
18
+
> Open documentation url for more info? (Y)es/(N)o [Yes]: n
19
+
> Aider v0.62.0
20
+
> Main model: gpt-4o-2024-08-06 with diff edit format
21
+
> Weak model: gpt-4o-mini
22
+
> Git repo: .git with 293 files
23
+
> Repo-map: using 1024 tokens, auto refresh
24
+
> Use /help <question> for help, run "aider --help" to see cmd line args
25
+
>
26
+
>
27
+
> ^C again to exit
28
+
>
29
+
>
30
+
> ^C KeyboardInterrupt
+6
.aider.input.history
+6
.aider.input.history
-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"
···
-1
.gitignore
-1
.gitignore
···
1
-
.direnv/
···
+221
apps/aarch64-darwin/apply
+221
apps/aarch64-darwin/apply
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
RED='\033[0;31m'
4
+
GREEN='\033[0;32m'
5
+
YELLOW='\033[1;33m'
6
+
NC='\033[0m' # No Color
7
+
8
+
# Determine the operating system
9
+
export OS=$(uname)
10
+
11
+
# Primary network interface
12
+
if [[ "$OS" != "Darwin" ]]; then
13
+
export PRIMARY_IFACE=$(ip -o -4 route show to default | awk '{print $5}')
14
+
echo -e "${GREEN}Found primary network interface $PRIMARY_IFACE${NC}"
15
+
fi
16
+
17
+
# Custom print function
18
+
_print() {
19
+
if [[ "$OS" == "Darwin" ]]; then
20
+
echo -e "$1"
21
+
else
22
+
echo "$1"
23
+
fi
24
+
}
25
+
26
+
# Custom prompt function
27
+
_prompt() {
28
+
local message="$1"
29
+
local variable="$2"
30
+
31
+
_print "$message"
32
+
read -r $variable
33
+
}
34
+
35
+
insert_secrets_output() {
36
+
local pattern="outputs = { self, darwin, nix-homebrew, homebrew-bundle, homebrew-core, homebrew-cask, home-manager, nixpkgs, disko, agenix } @inputs:"
37
+
local insert_text="secrets "
38
+
39
+
awk -v pat="$pattern" -v insert="$insert_text" '
40
+
$0 ~ pat {
41
+
sub(/} @inputs:/, ", " insert "} @inputs:"); # Replace the closing brace with the insert text followed by the brace
42
+
gsub(/ ,/, ","); # Correct any spaces before commas
43
+
print
44
+
next
45
+
}
46
+
{ print }
47
+
' flake.nix > flake.nix.tmp
48
+
49
+
mv flake.nix.tmp flake.nix
50
+
}
51
+
52
+
insert_secrets_input() {
53
+
# Define file path
54
+
FILE_PATH="flake.nix"
55
+
56
+
# Backup the original file
57
+
cp "$FILE_PATH" "${FILE_PATH}.bak"
58
+
59
+
# Temporary file for the text to insert
60
+
TEMP_FILE="temp_insert.txt"
61
+
62
+
# Write the formatted text to the temporary file
63
+
cat > "$TEMP_FILE" << 'EOF'
64
+
secrets = {
65
+
url = "git+ssh://git@github.com/%GITHUB_USER%/%GITHUB_SECRETS_REPO%.git";
66
+
flake = false;
67
+
};
68
+
EOF
69
+
70
+
# Check if the 'secrets' block already exists
71
+
if grep -q 'url = "git+ssh://git@github.com/%GITHUB_USER%/%GITHUB_SECRETS_REPO%.git"' "$FILE_PATH"; then
72
+
echo "The 'secrets' block already exists in the file."
73
+
rm "$TEMP_FILE"
74
+
rm "${FILE_PATH}.bak"
75
+
exit 0
76
+
fi
77
+
78
+
# Find the start and end line numbers of the 'disko' block
79
+
START_LINE=$(grep -n 'disko = {' "$FILE_PATH" | head -n 1 | cut -d: -f1)
80
+
END_LINE=$(tail -n +$START_LINE "$FILE_PATH" | grep -n '};' | head -n 1 | cut -d: -f1)
81
+
END_LINE=$((START_LINE + END_LINE - 1))
82
+
83
+
# Create a new file with the insertion
84
+
{
85
+
sed -n "1,${END_LINE}p" "$FILE_PATH"
86
+
cat "$TEMP_FILE"
87
+
sed -n "$((END_LINE + 1)),\$p" "$FILE_PATH"
88
+
} > "${FILE_PATH}.new"
89
+
90
+
# Replace the original file with the new file
91
+
mv "${FILE_PATH}.new" "$FILE_PATH"
92
+
93
+
# Clean up the temporary files
94
+
rm "$TEMP_FILE"
95
+
rm "${FILE_PATH}.bak"
96
+
}
97
+
98
+
# Fetch username from the system
99
+
export USERNAME=$(whoami)
100
+
101
+
# If the username is 'nixos' or 'root', ask the user for their username
102
+
if [[ "$USERNAME" == "nixos" ]] || [[ "$USERNAME" == "root" ]]; then
103
+
_prompt "${YELLOW}You're running as $USERNAME. Please enter your desired username: ${NC}" USERNAME
104
+
fi
105
+
106
+
# Check if git is available
107
+
if command -v git >/dev/null 2>&1; then
108
+
# Fetch email and name from git config
109
+
export GIT_EMAIL=$(git config --get user.email)
110
+
export GIT_NAME=$(git config --get user.name)
111
+
else
112
+
_print "${RED}Git is not available on this system.${NC}"
113
+
fi
114
+
115
+
# If git email is not found or git is not available, ask the user
116
+
if [[ -z "$GIT_EMAIL" ]]; then
117
+
_prompt "${YELLOW}Please enter your email: ${NC}" GIT_EMAIL
118
+
fi
119
+
120
+
# If git name is not found or git is not available, ask the user
121
+
if [[ -z "$GIT_NAME" ]]; then
122
+
_prompt "${YELLOW}Please enter your name: ${NC}" GIT_NAME
123
+
fi
124
+
125
+
_prompt "${YELLOW}Please enter your Github username: ${NC}" GITHUB_USER
126
+
_prompt "${YELLOW}Please enter your Github secrets repository name: ${NC}" GITHUB_SECRETS_REPO
127
+
128
+
export GITHUB_USER
129
+
export GITHUB_SECRETS_REPO
130
+
131
+
select_boot_disk() {
132
+
local disks
133
+
local _boot_disk
134
+
135
+
_print "${YELLOW}Available disks:${NC}"
136
+
disks=$(lsblk -nd --output NAME,SIZE | grep -v loop)
137
+
echo "$disks"
138
+
139
+
# Warning message for data deletion
140
+
_print "${RED}WARNING: All data on the chosen disk will be erased during the installation!${NC}"
141
+
_prompt "${YELLOW}Please choose your boot disk (e.g., nvme0n1, sda): ${NC}" _boot_disk
142
+
143
+
# Confirmation for disk selection to prevent accidental data loss
144
+
_print "${YELLOW}You have selected $_boot_disk as the boot disk. This will delete everything on this disk. Are you sure? (Y/N): ${NC}"
145
+
read -r confirmation
146
+
if [[ "$confirmation" =~ ^[Yy]$ ]]; then
147
+
export BOOT_DISK=$_boot_disk
148
+
else
149
+
_print "${RED}Disk selection cancelled by the user. Please run the script again to select the correct disk.${NC}"
150
+
exit 1
151
+
fi
152
+
}
153
+
154
+
# Set hostname and find primary disk if this is NixOS
155
+
if [[ "$OS" != "Darwin" ]]; then
156
+
_prompt "${YELLOW}Please enter a hostname for the system: ${NC}" HOST_NAME
157
+
export HOST_NAME
158
+
select_boot_disk
159
+
fi
160
+
161
+
# Confirmation step
162
+
confirm_details() {
163
+
_print "${GREEN}Username: $USERNAME"
164
+
_print "Email: $GIT_EMAIL"
165
+
_print "Name: $GIT_NAME${NC}"
166
+
167
+
if([[ "$OS" != "Darwin" ]]); then
168
+
_print "${GREEN}Primary interface: $PRIMARY_IFACE"
169
+
_print "Boot disk: $BOOT_DISK"
170
+
_print "Hostname: $HOST_NAME${NC}"
171
+
fi
172
+
173
+
_print "${GREEN}Secrets repository: $GITHUB_USER/$GITHUB_SECRETS_REPO${NC}"
174
+
175
+
_prompt "${YELLOW}Is this correct? (Y/N): ${NC}" choice
176
+
177
+
case "$choice" in
178
+
[Nn] ) _print "${RED}Exiting script.${NC}" && exit 1;;
179
+
[Yy] ) _print "${GREEN}Continuing...${NC}";;
180
+
* ) _print "${RED}Invalid option. Exiting script.${NC}" && exit 1;;
181
+
esac
182
+
}
183
+
184
+
# Call the confirmation function
185
+
confirm_details
186
+
187
+
# Function to replace tokens in each file
188
+
replace_tokens() {
189
+
local file="$1"
190
+
if [[ $(basename $1) != "apply" ]]; then
191
+
if [[ "$OS" == "Darwin" ]]; then
192
+
# macOS
193
+
LC_ALL=C LANG=C sed -i '' -e "s/%USER%/$USERNAME/g" "$file"
194
+
LC_ALL=C LANG=C sed -i '' -e "s/%EMAIL%/$GIT_EMAIL/g" "$file"
195
+
LC_ALL=C LANG=C sed -i '' -e "s/%NAME%/$GIT_NAME/g" "$file"
196
+
LC_ALL=C LANG=C sed -i '' -e "s/%GITHUB_USER%/$GITHUB_USER/g" "$file"
197
+
LC_ALL=C LANG=C sed -i '' -e "s/%GITHUB_SECRETS_REPO%/$GITHUB_SECRETS_REPO/g" "$file"
198
+
else
199
+
# Linux or other
200
+
sed -i -e "s/%USER%/$USERNAME/g" "$file"
201
+
sed -i -e "s/%EMAIL%/$GIT_EMAIL/g" "$file"
202
+
sed -i -e "s/%NAME%/$GIT_NAME/g" "$file"
203
+
sed -i -e "s/%INTERFACE%/$PRIMARY_IFACE/g" "$file"
204
+
sed -i -e "s/%DISK%/$BOOT_DISK/g" "$file"
205
+
sed -i -e "s/%HOST%/$HOST_NAME/g" "$file"
206
+
sed -i -e "s/%GITHUB_USER%/$GITHUB_USER/g" "$file"
207
+
sed -i -e "s/%GITHUB_SECRETS_REPO%/$GITHUB_SECRETS_REPO/g" "$file"
208
+
fi
209
+
fi
210
+
}
211
+
212
+
# Insert secrets repo into flake
213
+
insert_secrets_input
214
+
insert_secrets_output
215
+
216
+
# Traverse directories and call replace_tokens on each Nix file
217
+
export -f replace_tokens
218
+
find . -type f -exec bash -c 'replace_tokens "$0"' {} \;
219
+
220
+
echo "$USERNAME" > /tmp/username.txt
221
+
_print "${GREEN}User $USERNAME information applied.${NC}"
+19
apps/aarch64-darwin/build
+19
apps/aarch64-darwin/build
···
···
1
+
#!/bin/sh -e
2
+
3
+
GREEN='\033[1;32m'
4
+
YELLOW='\033[1;33m'
5
+
RED='\033[1;31m'
6
+
NC='\033[0m'
7
+
8
+
SYSTEM_TYPE="aarch64-darwin"
9
+
FLAKE_SYSTEM="darwinConfigurations.${SYSTEM_TYPE}.system"
10
+
11
+
export NIXPKGS_ALLOW_UNFREE=1
12
+
13
+
echo "${YELLOW}Starting build...${NC}"
14
+
nix --extra-experimental-features 'nix-command flakes' build .#$FLAKE_SYSTEM $@
15
+
16
+
echo "${YELLOW}Cleaning up...${NC}"
17
+
unlink ./result
18
+
19
+
echo "${GREEN}Switch to new generation complete!${NC}"
+22
apps/aarch64-darwin/build-switch
+22
apps/aarch64-darwin/build-switch
···
···
1
+
#!/bin/sh -e
2
+
3
+
GREEN='\033[1;32m'
4
+
YELLOW='\033[1;33m'
5
+
RED='\033[1;31m'
6
+
NC='\033[0m'
7
+
8
+
SYSTEM_TYPE="aarch64-darwin"
9
+
FLAKE_SYSTEM="darwinConfigurations.${SYSTEM_TYPE}.system"
10
+
11
+
export NIXPKGS_ALLOW_UNFREE=1
12
+
13
+
echo "${YELLOW}Starting build...${NC}"
14
+
nix --extra-experimental-features 'nix-command flakes' build .#$FLAKE_SYSTEM $@
15
+
16
+
echo "${YELLOW}Switching to new generation...${NC}"
17
+
./result/sw/bin/darwin-rebuild switch --flake .#${SYSTEM_TYPE} $@
18
+
19
+
echo "${YELLOW}Cleaning up...${NC}"
20
+
unlink ./result
21
+
22
+
echo "${GREEN}Switch to new generation complete!${NC}"
+33
apps/aarch64-darwin/check-keys
+33
apps/aarch64-darwin/check-keys
···
···
1
+
#!/usr/bin/env bash
2
+
set -e
3
+
4
+
RED='\033[0;31m'
5
+
GREEN='\033[0;32m'
6
+
NC='\033[0m'
7
+
8
+
username=${USER}
9
+
export SSH_DIR=/Users/${username}/.ssh
10
+
11
+
lint_keys() {
12
+
if [[ -f "${SSH_DIR}/id_ed25519" && -f "${SSH_DIR}/id_ed25519.pub" && -f "${SSH_DIR}/id_ed25519_agenix" && -f "${SSH_DIR}/id_ed25519_agenix.pub" ]]; then
13
+
echo -e "${GREEN}All SSH keys are present.${NC}"
14
+
else
15
+
echo -e "${RED}Some SSH keys are missing.${NC}"
16
+
if [[ ! -f "${SSH_DIR}/id_ed25519" ]]; then
17
+
echo -e "${RED}Missing: id_ed25519${NC}"
18
+
fi
19
+
if [[ ! -f "${SSH_DIR}/id_ed25519.pub" ]]; then
20
+
echo -e "${RED}Missing: id_ed25519.pub${NC}"
21
+
fi
22
+
if [[ ! -f "${SSH_DIR}/id_ed25519_agenix" ]]; then
23
+
echo -e "${RED}Missing: id_ed25519_agenix${NC}"
24
+
fi
25
+
if [[ ! -f "${SSH_DIR}/id_ed25519_agenix.pub" ]]; then
26
+
echo -e "${RED}Missing: id_ed25519_agenix.pub${NC}"
27
+
fi
28
+
echo -e "${GREEN}Run the createKeys command to generate the missing keys.${NC}"
29
+
exit 1
30
+
fi
31
+
}
32
+
33
+
lint_keys
+68
apps/aarch64-darwin/copy-keys
+68
apps/aarch64-darwin/copy-keys
···
···
1
+
#!/usr/bin/env bash
2
+
set -e
3
+
4
+
RED='\033[0;31m'
5
+
GREEN='\033[0;32m'
6
+
NC='\033[0m'
7
+
8
+
username=${USER}
9
+
export SSH_DIR=/Users/${username}/.ssh
10
+
11
+
handle_no_usb() {
12
+
echo -e ${RED}No USB drive found or mounted.${NC}"
13
+
echo -e ${GREEN}If you have not yet set up your keys, run the script to generate new SSH keys.${NC}"
14
+
exit 1
15
+
}
16
+
17
+
mount_usb() {
18
+
MOUNT_PATH=""
19
+
for dev in $(diskutil list | grep -o 'disk[0-9]'); do
20
+
MOUNT_PATH="$(diskutil info /dev/${dev} | grep \"Mount Point\" | awk -F: '{print $2}' | xargs)"
21
+
if [ -n "${MOUNT_PATH}" ]; then
22
+
echo -e "${GREEN}USB drive found at ${MOUNT_PATH}.${NC}"
23
+
break
24
+
fi
25
+
done
26
+
27
+
if [ -z "${MOUNT_PATH}" ]; then
28
+
echo -e "${RED}No USB drive found.${NC}"
29
+
fi
30
+
}
31
+
32
+
copy_keys() {
33
+
if [ -n "${MOUNT_PATH}" ]; then
34
+
cp "${MOUNT_PATH}/id_ed25519_agenix.pub" ${SSH_DIR}
35
+
cp "${MOUNT_PATH}/id_ed25519_agenix" ${SSH_DIR}
36
+
chmod 600 ${SSH_DIR}/id_ed25519_{agenix,agenix.pub}
37
+
else
38
+
echo -e "${RED}No USB drive found. Aborting.${NC}"
39
+
exit 1
40
+
fi
41
+
}
42
+
43
+
setup_ssh_directory() {
44
+
mkdir -p ${SSH_DIR}
45
+
}
46
+
47
+
set_keys() {
48
+
cp ${MOUNT_PATH}/id_ed25519_github.pub ${SSH_DIR}/id_ed25519.pub
49
+
cp ${MOUNT_PATH}/id_ed25519_github ${SSH_DIR}/id_ed25519
50
+
chmod 600 ${SSH_DIR}/id_ed25519
51
+
chmod 644 ${SSH_DIR}/id_ed25519.pub
52
+
}
53
+
54
+
change_ownership() {
55
+
chown ${username}:staff ${SSH_DIR}/id_ed25519{,.pub}
56
+
chown ${username}:staff ${SSH_DIR}/id_ed25519_{agenix,agenix.pub}
57
+
}
58
+
59
+
setup_ssh_directory
60
+
mount_usb
61
+
62
+
if [ -z "${MOUNT_PATH}" ]; then
63
+
handle_no_usb
64
+
else
65
+
copy_keys
66
+
set_keys
67
+
change_ownership
68
+
fi
+46
apps/aarch64-darwin/create-keys
+46
apps/aarch64-darwin/create-keys
···
···
1
+
#!/usr/bin/env bash
2
+
set -e
3
+
4
+
RED='\033[0;31m'
5
+
GREEN='\033[0;32m'
6
+
NC='\033[0m'
7
+
8
+
username=${USER}
9
+
export SSH_DIR=/Users/${username}/.ssh
10
+
11
+
setup_ssh_directory() {
12
+
mkdir -p ${SSH_DIR}
13
+
}
14
+
15
+
prompt_for_key_generation() {
16
+
local key_name=$1
17
+
if [[ -f "${SSH_DIR}/${key_name}" ]]; then
18
+
echo -e "${RED}Existing SSH key found for ${key_name}.${NC}"
19
+
cat "${SSH_DIR}/${key_name}.pub"
20
+
read -p "Do you want to replace it? (y/n) " -n 1 -r
21
+
echo
22
+
if [[ $REPLY =~ ^[Yy]$ ]]; then
23
+
return 0 # Indicate key should be replaced
24
+
else
25
+
return 1 # Indicate key should be kept
26
+
fi
27
+
fi
28
+
return 0 # Indicate no key exists, so it should be created
29
+
}
30
+
31
+
generate_key() {
32
+
local key_name=$1
33
+
if prompt_for_key_generation "$key_name"; then
34
+
ssh-keygen -t ed25519 -f "${SSH_DIR}/${key_name}" -N ""
35
+
chown ${username}:staff "${SSH_DIR}/${key_name}"{,.pub}
36
+
else
37
+
echo -e "${GREEN}Kept existing ${key_name}.${NC}"
38
+
fi
39
+
}
40
+
41
+
setup_ssh_directory
42
+
generate_key "id_ed25519"
43
+
generate_key "id_ed25519_agenix"
44
+
45
+
echo -e "${GREEN}SSH key setup complete.${NC}"
46
+
echo -e "${GREEN}Remember to add the necessary keys to Github or other services as required.${NC}"
+24
apps/aarch64-darwin/rollback
+24
apps/aarch64-darwin/rollback
···
···
1
+
#!/bin/sh -e
2
+
3
+
GREEN='\033[1;32m'
4
+
YELLOW='\033[1;33m'
5
+
RED='\033[1;31m'
6
+
NC='\033[0m'
7
+
8
+
FLAKE="Dustins-MBP"
9
+
10
+
echo "${YELLOW}Available generations:${NC}"
11
+
/run/current-system/sw/bin/darwin-rebuild --list-generations
12
+
13
+
echo "${YELLOW}Enter the generation number for rollback:${NC}"
14
+
read GEN_NUM
15
+
16
+
if [ -z "$GEN_NUM" ]; then
17
+
echo "${RED}No generation number entered. Aborting rollback.${NC}"
18
+
exit 1
19
+
fi
20
+
21
+
echo "${YELLOW}Rolling back to generation $GEN_NUM...${NC}"
22
+
/run/current-system/sw/bin/darwin-rebuild switch --flake .#$FLAKE --switch-generation $GEN_NUM
23
+
24
+
echo "${GREEN}Rollback to generation $GEN_NUM complete!${NC}"
+1
apps/aarch64-linux
+1
apps/aarch64-linux
···
···
1
+
x86_64-linux
+142
apps/x86_64-linux/apply
+142
apps/x86_64-linux/apply
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
RED='\033[0;31m'
4
+
GREEN='\033[0;32m'
5
+
YELLOW='\033[1;33m'
6
+
NC='\033[0m' # No Color
7
+
8
+
# Determine the operating system
9
+
export OS=$(uname)
10
+
11
+
# Primary network interface
12
+
if [[ "$OS" != "Darwin" ]]; then
13
+
export PRIMARY_IFACE=$(ip -o -4 route show to default | awk '{print $5}')
14
+
echo -e "${GREEN}Found primary network interface $PRIMARY_IFACE${NC}"
15
+
fi
16
+
17
+
# Custom print function
18
+
_print() {
19
+
if [[ "$OS" == "Darwin" ]]; then
20
+
echo -e "$1"
21
+
else
22
+
echo "$1"
23
+
fi
24
+
}
25
+
26
+
# Custom prompt function
27
+
_prompt() {
28
+
local message="$1"
29
+
local variable="$2"
30
+
31
+
_print "$message"
32
+
read -r $variable
33
+
}
34
+
35
+
# Fetch username from the system
36
+
export USERNAME=$(whoami)
37
+
38
+
# If the username is 'nixos' or 'root', ask the user for their username
39
+
if [[ "$USERNAME" == "nixos" ]] || [[ "$USERNAME" == "root" ]]; then
40
+
_prompt "${YELLOW}You're running as $USERNAME. Please enter your desired username: ${NC}" USERNAME
41
+
fi
42
+
43
+
# Check if git is available
44
+
if command -v git >/dev/null 2>&1; then
45
+
# Fetch email and name from git config
46
+
export GIT_EMAIL=$(git config --get user.email)
47
+
export GIT_NAME=$(git config --get user.name)
48
+
else
49
+
_print "${RED}Git is not available on this system.${NC}"
50
+
fi
51
+
52
+
# If git email is not found or git is not available, ask the user
53
+
if [[ -z "$GIT_EMAIL" ]]; then
54
+
_prompt "${YELLOW}Please enter your email: ${NC}" GIT_EMAIL
55
+
fi
56
+
57
+
# If git name is not found or git is not available, ask the user
58
+
if [[ -z "$GIT_NAME" ]]; then
59
+
_prompt "${YELLOW}Please enter your name: ${NC}" GIT_NAME
60
+
fi
61
+
62
+
select_boot_disk() {
63
+
local disks
64
+
local _boot_disk
65
+
66
+
_print "${YELLOW}Available disks:${NC}"
67
+
disks=$(lsblk -nd --output NAME,SIZE | grep -v loop)
68
+
echo "$disks"
69
+
70
+
# Warning message for data deletion
71
+
_print "${RED}WARNING: All data on the chosen disk will be erased during the installation!${NC}"
72
+
_prompt "${YELLOW}Please choose your boot disk (e.g., nvme0n1, sda): ${NC}" _boot_disk
73
+
74
+
# Confirmation for disk selection to prevent accidental data loss
75
+
_print "${YELLOW}You have selected $_boot_disk as the boot disk. This will delete everything on this disk. Are you sure? (Y/N): ${NC}"
76
+
read -r confirmation
77
+
if [[ "$confirmation" =~ ^[Yy]$ ]]; then
78
+
export BOOT_DISK=$_boot_disk
79
+
else
80
+
_print "${RED}Disk selection cancelled by the user. Please run the script again to select the correct disk.${NC}"
81
+
exit 1
82
+
fi
83
+
}
84
+
85
+
# Set hostname and find primary disk if this is NixOS
86
+
if [[ "$OS" != "Darwin" ]]; then
87
+
_prompt "${YELLOW}Please enter a hostname for the system: ${NC}" HOST_NAME
88
+
export HOST_NAME
89
+
select_boot_disk
90
+
fi
91
+
92
+
# Confirmation step
93
+
confirm_details() {
94
+
_print "${GREEN}Username: $USERNAME"
95
+
_print "Email: $GIT_EMAIL"
96
+
_print "Name: $GIT_NAME${NC}"
97
+
98
+
if([[ "$OS" != "Darwin" ]]); then
99
+
_print "${GREEN}Primary interface: $PRIMARY_IFACE"
100
+
_print "Boot disk: $BOOT_DISK"
101
+
_print "Hostname: $HOST_NAME${NC}"
102
+
fi
103
+
104
+
_prompt "${YELLOW}Is this correct? (Y/N): ${NC}" choice
105
+
106
+
case "$choice" in
107
+
[Nn] ) _print "${RED}Exiting script.${NC}" && exit 1;;
108
+
[Yy] ) _print "${GREEN}Continuing...${NC}";;
109
+
* ) _print "${RED}Invalid option. Exiting script.${NC}" && exit 1;;
110
+
esac
111
+
}
112
+
113
+
# Call the confirmation function
114
+
confirm_details
115
+
116
+
# Function to replace tokens in each file
117
+
replace_tokens() {
118
+
local file="$1"
119
+
if [[ $(basename $1) != "apply" ]]; then
120
+
if [[ "$OS" == "Darwin" ]]; then
121
+
# macOS
122
+
LC_ALL=C LANG=C sed -i '' -e "s/%USER%/$USERNAME/g" "$file"
123
+
LC_ALL=C LANG=C sed -i '' -e "s/%EMAIL%/$GIT_EMAIL/g" "$file"
124
+
LC_ALL=C LANG=C sed -i '' -e "s/%NAME%/$GIT_NAME/g" "$file"
125
+
else
126
+
# Linux or other
127
+
sed -i -e "s/%USER%/$USERNAME/g" "$file"
128
+
sed -i -e "s/%EMAIL%/$GIT_EMAIL/g" "$file"
129
+
sed -i -e "s/%NAME%/$GIT_NAME/g" "$file"
130
+
sed -i -e "s/%INTERFACE%/$PRIMARY_IFACE/g" "$file"
131
+
sed -i -e "s/%DISK%/$BOOT_DISK/g" "$file"
132
+
sed -i -e "s/%HOST%/$HOST_NAME/g" "$file"
133
+
fi
134
+
fi
135
+
}
136
+
137
+
# Traverse directories and call replace_tokens on each Nix file
138
+
export -f replace_tokens
139
+
find . -type f -exec bash -c 'replace_tokens "$0"' {} \;
140
+
141
+
echo "$USERNAME" > /tmp/username.txt
142
+
_print "${GREEN}User $USERNAME information applied.${NC}"
+28
apps/x86_64-linux/build-switch
+28
apps/x86_64-linux/build-switch
···
···
1
+
#!/bin/sh -e
2
+
3
+
RED='\033[1;31m'
4
+
GREEN='\033[1;32m'
5
+
YELLOW='\033[1;33m'
6
+
NC='\033[0m'
7
+
8
+
SYSTEM=$(uname -m)
9
+
10
+
case "$SYSTEM" in
11
+
x86_64)
12
+
FLAKE_TARGET="x86_64-linux"
13
+
;;
14
+
aarch64)
15
+
FLAKE_TARGET="aarch64-linux"
16
+
;;
17
+
*)
18
+
echo -e "${RED}Unsupported architecture: $SYSTEM${NC}"
19
+
exit 1
20
+
;;
21
+
esac
22
+
23
+
echo -e "${YELLOW}Starting...${NC}"
24
+
25
+
# We pass SSH from user to root so root can download secrets from our private Github
26
+
sudo SSH_AUTH_SOCK=$SSH_AUTH_SOCK /run/current-system/sw/bin/nixos-rebuild switch --flake .#$FLAKE_TARGET $@
27
+
28
+
echo -e "${GREEN}Switch to new generation complete!${NC}"
+33
apps/x86_64-linux/check-keys
+33
apps/x86_64-linux/check-keys
···
···
1
+
#!/usr/bin/env bash
2
+
set -e
3
+
4
+
RED='\033[0;31m'
5
+
GREEN='\033[0;32m'
6
+
NC='\033[0m'
7
+
8
+
# We're assuming this is being run as root in the NixOS installer
9
+
export SSH_DIR=/root/.ssh
10
+
11
+
check_keys() {
12
+
if [[ -f "${SSH_DIR}/id_ed25519" && -f "${SSH_DIR}/id_ed25519.pub" && -f "${SSH_DIR}/id_ed25519_agenix" && -f "${SSH_DIR}/id_ed25519_agenix.pub" ]]; then
13
+
echo -e "${GREEN}All SSH keys are present.${NC}"
14
+
else
15
+
echo -e "${RED}Some SSH keys are missing.${NC}"
16
+
if [[ ! -f "${SSH_DIR}/id_ed25519" ]]; then
17
+
echo -e "${RED}Missing: id_ed25519${NC}"
18
+
fi
19
+
if [[ ! -f "${SSH_DIR}/id_ed25519.pub" ]]; then
20
+
echo -e "${RED}Missing: id_ed25519.pub${NC}"
21
+
fi
22
+
if [[ ! -f "${SSH_DIR}/id_ed25519_agenix" ]]; then
23
+
echo -e "${RED}Missing: id_ed25519_agenix${NC}"
24
+
fi
25
+
if [[ ! -f "${SSH_DIR}/id_ed25519_agenix.pub" ]]; then
26
+
echo -e "${RED}Missing: id_ed25519_agenix.pub${NC}"
27
+
fi
28
+
echo -e "${GREEN}Run the createKeys script to generate the missing keys.${NC}"
29
+
exit 1
30
+
fi
31
+
}
32
+
33
+
check_keys
+71
apps/x86_64-linux/copy-keys
+71
apps/x86_64-linux/copy-keys
···
···
1
+
#!/usr/bin/env bash
2
+
set -e
3
+
4
+
unmount_usb() {
5
+
if mountpoint -q /mnt/usb; then
6
+
sudo umount /mnt/usb
7
+
echo -e "\e[0;32mUSB drive unmounted.\e[0m"
8
+
fi
9
+
}
10
+
11
+
mount_usb() {
12
+
if mountpoint -q /mnt/usb; then
13
+
echo -e "\e[0;32mUSB drive already mounted.\e[0m"
14
+
else
15
+
device_found=false
16
+
for dev in sda sdb sdc sdd sde sdf sdg sdh sdi sdj sdk sdl; do
17
+
if sudo blkid /dev/$dev | grep -iq 'TYPE="vfat"'; then
18
+
device_found=true
19
+
mkdir -p /mnt/usb
20
+
sudo mount /dev/$dev /mnt/usb && { echo -e "\e[0;32mUSB drive mounted successfully on /dev/$dev.\e[0m"; break; } || echo -e "\e[0;31mFailed to mount /dev/$dev.\e[0m"
21
+
fi
22
+
done
23
+
if [ "$device_found" = false ]; then
24
+
echo -e "\e[0;31mNo USB devices found.\e[0m"
25
+
fi
26
+
fi
27
+
}
28
+
29
+
setup_ssh_directory() {
30
+
export SSH_DIR=/root/.ssh
31
+
mkdir -p $SSH_DIR
32
+
}
33
+
34
+
check_file_exists() {
35
+
if [[ ! -f $1 ]]; then
36
+
echo -e "\e[0;31mError: File $1 does not exist.\e[0m"
37
+
exit 1
38
+
fi
39
+
}
40
+
41
+
copy_keys() {
42
+
check_file_exists "/mnt/usb/id_ed25519_agenix.pub"
43
+
check_file_exists "/mnt/usb/id_ed25519_agenix"
44
+
cp /mnt/usb/id_ed25519_agenix.pub $SSH_DIR
45
+
cp /mnt/usb/id_ed25519_agenix $SSH_DIR
46
+
chmod 600 $SSH_DIR/id_ed25519_{agenix,agenix.pub}
47
+
echo -e "\e[0;32mKeys copied successfully.\e[0m"
48
+
}
49
+
50
+
set_keys() {
51
+
check_file_exists "/mnt/usb/id_ed25519_github.pub"
52
+
check_file_exists "/mnt/usb/id_ed25519_github"
53
+
cp /mnt/usb/id_ed25519_github.pub $SSH_DIR/id_ed25519.pub
54
+
cp /mnt/usb/id_ed25519_github $SSH_DIR/id_ed25519
55
+
chmod 600 $SSH_DIR/id_ed25519
56
+
chmod 644 $SSH_DIR/id_ed25519.pub
57
+
}
58
+
59
+
change_ownership() {
60
+
chown nixos:wheel $SSH_DIR/id_ed25519{,.pub}
61
+
chown nixos:wheel $SSH_DIR/id_ed25519_{agenix,agenix.pub}
62
+
}
63
+
64
+
trap unmount_usb EXIT
65
+
66
+
setup_ssh_directory
67
+
mount_usb
68
+
copy_keys
69
+
set_keys
70
+
change_ownership
71
+
unmount_usb
+27
apps/x86_64-linux/create-keys
+27
apps/x86_64-linux/create-keys
···
···
1
+
#!/usr/bin/env bash
2
+
set -e
3
+
4
+
RED='\033[0;31m'
5
+
GREEN='\033[0;32m'
6
+
NC='\033[0m'
7
+
8
+
# We're assuming this is being run as root in the NixOS installer
9
+
export SSH_DIR=/root/.ssh
10
+
11
+
setup_ssh_directory() {
12
+
mkdir -p ${SSH_DIR}
13
+
}
14
+
15
+
generate_keys() {
16
+
ssh-keygen -t ed25519 -f "${SSH_DIR}/id_ed25519" -N ""
17
+
ssh-keygen -t ed25519 -f "${SSH_DIR}/id_ed25519_agenix" -N ""
18
+
chmod 600 ${SSH_DIR}/id_ed25519{,_agenix}{,.pub}
19
+
}
20
+
21
+
setup_ssh_directory
22
+
generate_keys
23
+
24
+
echo -e "${GREEN}New SSH keys have been generated.${NC}"
25
+
echo -e "${GREEN}1) Add the id_ed25519 key to Github.${NC}"
26
+
cat "${SSH_DIR}/id_ed25519.pub"
27
+
echo -e "${GREEN}2) Create a private nix-secrets repo in Github, even if it's empty.${NC}"
+80
apps/x86_64-linux/install
+80
apps/x86_64-linux/install
···
···
1
+
#!/usr/bin/env bash
2
+
set -exu
3
+
4
+
check_installer() {
5
+
if [ -e /etc/NIXOS ]; then
6
+
echo -e "\e[1;32mRunning in the NixOS installer environment.\e[0m"
7
+
else
8
+
echo -e "\e[1;31mNot running in the NixOS installer environment.\e[0m"
9
+
exit 1
10
+
fi
11
+
}
12
+
13
+
cleanup() {
14
+
rm -rf nixos-config-main.zip nixos-config-main nixos-config
15
+
}
16
+
17
+
download_config() {
18
+
curl -LJ0 https://github.com/dustinlyons/nixos-config/archive/main.zip -o nixos-config-main.zip
19
+
unzip nixos-config-main.zip
20
+
mv nixos-config-main/templates/starter nixos-config
21
+
cd nixos-config
22
+
}
23
+
24
+
run_apply() {
25
+
./apps/x86_64-linux/apply
26
+
if [ ! -f /tmp/username.txt ]; then
27
+
echo -e "\e[1;31mError: /tmp/username.txt does not exist.\e[0m"
28
+
exit 1
29
+
fi
30
+
export USERNAME=$(cat /tmp/username.txt)
31
+
}
32
+
33
+
run_disko() {
34
+
sudo nix run --extra-experimental-features nix-command --extra-experimental-features flakes \
35
+
github:nix-community/disko -- --mode zap_create_mount ./modules/nixos/disk-config.nix
36
+
}
37
+
38
+
setup_files() {
39
+
sudo mkdir -p /mnt/etc/nixos
40
+
sudo cp -r * /mnt/etc/nixos
41
+
cd /mnt/etc/nixos
42
+
}
43
+
44
+
install_nixos() {
45
+
ARCH=$(uname -m)
46
+
47
+
case "$ARCH" in
48
+
x86_64)
49
+
FLAKE_TARGET="x86_64-linux"
50
+
;;
51
+
aarch64)
52
+
FLAKE_TARGET="aarch64-linux"
53
+
;;
54
+
*)
55
+
echo -e "${RED}Unsupported architecture: $ARCH${CLEAR}"
56
+
exit 1
57
+
;;
58
+
esac
59
+
60
+
sudo nixos-install --flake .#$FLAKE_TARGET $@
61
+
sudo chmod -R 775 /mnt/etc/nixos
62
+
}
63
+
64
+
prompt_reboot() {
65
+
read -p "Do you want to reboot now? (y/yes) " choice
66
+
case "$choice" in
67
+
y|Y|yes|YES ) echo -e "\e[1;32mRebooting...\e[0m" && sudo reboot;;
68
+
* ) echo -e "\e[1;33mReboot skipped.\e[0m";;
69
+
esac
70
+
}
71
+
72
+
cleanup
73
+
check_installer
74
+
download_config
75
+
run_apply
76
+
run_disko
77
+
setup_files
78
+
install_nixos
79
+
cleanup
80
+
prompt_reboot
+104
apps/x86_64-linux/install-with-secrets
+104
apps/x86_64-linux/install-with-secrets
···
···
1
+
#!/usr/bin/env bash
2
+
set -exu
3
+
4
+
check_installer() {
5
+
if [ -e /etc/NIXOS ]; then
6
+
echo -e "\e[1;32mRunning in the NixOS installer environment.\e[0m"
7
+
else
8
+
echo -e "\e[1;31mNot running in the NixOS installer environment.\e[0m"
9
+
exit 1
10
+
fi
11
+
}
12
+
13
+
cleanup() {
14
+
rm -rf nixos-config-main.zip nixos-config-main nixos-config
15
+
}
16
+
17
+
download_config() {
18
+
curl -LJ0 https://github.com/dustinlyons/nixos-config/archive/main.zip -o nixos-config-main.zip
19
+
unzip nixos-config-main.zip
20
+
mv nixos-config-main/templates/starterWithSecrets nixos-config
21
+
cd nixos-config
22
+
}
23
+
24
+
run_apply() {
25
+
./apps/x86_64-linux/apply
26
+
if [ ! -f /tmp/username.txt ]; then
27
+
echo -e "\e[1;31mError: /tmp/username.txt does not exist.\e[0m"
28
+
exit 1
29
+
fi
30
+
export USERNAME=$(cat /tmp/username.txt)
31
+
}
32
+
33
+
run_disko() {
34
+
sudo nix run --extra-experimental-features nix-command --extra-experimental-features flakes \
35
+
github:nix-community/disko -- --mode zap_create_mount ./modules/nixos/disk-config.nix
36
+
}
37
+
38
+
setup_files() {
39
+
sudo mkdir -p /mnt/etc/nixos
40
+
sudo cp -r * /mnt/etc/nixos
41
+
cd /mnt/etc/nixos
42
+
43
+
mkdir -p /root/.ssh
44
+
touch /root/.ssh/known_hosts
45
+
ssh-keyscan -t ed25519 github.com >> /root/.ssh/known_hosts
46
+
}
47
+
48
+
setup_ssh_keys() {
49
+
mkdir -p /mnt/home/${USERNAME}/.ssh
50
+
chown nixos /mnt/home/${USERNAME}/.ssh
51
+
52
+
chown nixos /root/.ssh/id_ed25519_agenix{,.pub}
53
+
cp --preserve=all /root/.ssh/id_ed25519_agenix /mnt/home/${USERNAME}/.ssh/id_ed25519
54
+
cp --preserve=all /root/.ssh/id_ed25519_agenix.pub /mnt/home/${USERNAME}/.ssh/id_ed25519.pub
55
+
cp --preserve=all /root/.ssh/id_ed25519 /mnt/home/${USERNAME}/.ssh/id_github
56
+
cp --preserve=all /root/.ssh/id_ed25519.pub /mnt/home/${USERNAME}/.ssh/id_github.pub
57
+
58
+
chmod 600 /mnt/home/${USERNAME}/.ssh/id_ed25519{,.pub}
59
+
chmod 600 /mnt/home/${USERNAME}/.ssh/id_github{,.pub}
60
+
}
61
+
62
+
link_home_dir() {
63
+
ln -s /mnt/home/${USERNAME} /home/${USERNAME} # Used to grab initial secrets
64
+
}
65
+
66
+
install_nixos() {
67
+
ARCH=$(uname -m)
68
+
69
+
case "$ARCH" in
70
+
x86_64)
71
+
FLAKE_TARGET="x86_64-linux"
72
+
;;
73
+
aarch64)
74
+
FLAKE_TARGET="aarch64-linux"
75
+
;;
76
+
*)
77
+
echo -e "${RED}Unsupported architecture: $ARCH${CLEAR}"
78
+
exit 1
79
+
;;
80
+
esac
81
+
82
+
sudo nixos-install --flake .#$FLAKE_TARGET $@
83
+
sudo chmod -R 775 /mnt/etc/nixos
84
+
}
85
+
86
+
prompt_reboot() {
87
+
read -p "Do you want to reboot now? (y/yes) " choice
88
+
case "$choice" in
89
+
y|Y|yes|YES ) echo -e "\e[1;32mRebooting...\e[0m" && sudo reboot;;
90
+
* ) echo -e "\e[1;33mReboot skipped.\e[0m";;
91
+
esac
92
+
}
93
+
94
+
cleanup
95
+
check_installer
96
+
download_config
97
+
run_apply
98
+
run_disko
99
+
setup_files
100
+
setup_ssh_keys
101
+
link_home_dir
102
+
install_nixos
103
+
cleanup
104
+
prompt_reboot
+4
-5
dns/dnsconfig.js
+4
-5
dns/dnsconfig.js
···
6
7
D("lakhwara.com", REG_NONE,
8
DnsProvider(DNS_HEDNS),
9
-
DefaultTTL(300),
10
//SOA('@', 'ns1.he.net.', 'hostmaster.he.net.', 2022041702, 86400, 7200, 3600000, 86400, TTL(172800)),
11
-
A('anish', '69.61.2.203'),
12
-
A('@', '69.61.2.203'),
13
-
//A('coaching', '103.16.130.98'),
14
TXT('anish', 'datkey=dat://1a240a14fab2bae9c85ebad29bddc04505aaba24e5fb809c2ccb4cdf71e3a7d5'),
15
CNAME('fm1._domainkey', 'fm1.lakhwara.com.dkim.fmhosted.com.'),
16
CNAME('fm2._domainkey', 'fm2.lakhwara.com.dkim.fmhosted.com.'),
17
CNAME('fm3._domainkey', 'fm3.lakhwara.com.dkim.fmhosted.com.'),
18
MX('@', 10, 'in1-smtp.messagingengine.com.'),
19
MX('@', 20, 'in2-smtp.messagingengine.com.'),
20
//NAMESERVER('ns1.he.net.'),
···
39
A('git', '69.61.2.203', TTL(300)),
40
A('bin', '69.61.2.203', TTL(300)),
41
A('ci', '69.61.2.203', TTL(300)),
42
-
A('write', '69.61.2.203', TTL(300)),
43
// vultr -> nulled: lituus
44
A('@', '45.77.48.108', TTL(300)),
45
A('jitsi', '45.77.48.108', TTL(300)),
···
6
7
D("lakhwara.com", REG_NONE,
8
DnsProvider(DNS_HEDNS),
9
+
DefaultTTL(86400),
10
//SOA('@', 'ns1.he.net.', 'hostmaster.he.net.', 2022041702, 86400, 7200, 3600000, 86400, TTL(172800)),
11
+
A('anish', '103.16.130.98'),
12
+
A('coaching', '103.16.130.98'),
13
TXT('anish', 'datkey=dat://1a240a14fab2bae9c85ebad29bddc04505aaba24e5fb809c2ccb4cdf71e3a7d5'),
14
CNAME('fm1._domainkey', 'fm1.lakhwara.com.dkim.fmhosted.com.'),
15
CNAME('fm2._domainkey', 'fm2.lakhwara.com.dkim.fmhosted.com.'),
16
CNAME('fm3._domainkey', 'fm3.lakhwara.com.dkim.fmhosted.com.'),
17
+
A('@', '103.16.130.98'),
18
MX('@', 10, 'in1-smtp.messagingengine.com.'),
19
MX('@', 20, 'in2-smtp.messagingengine.com.'),
20
//NAMESERVER('ns1.he.net.'),
···
39
A('git', '69.61.2.203', TTL(300)),
40
A('bin', '69.61.2.203', TTL(300)),
41
A('ci', '69.61.2.203', TTL(300)),
42
// vultr -> nulled: lituus
43
A('@', '45.77.48.108', TTL(300)),
44
A('jitsi', '45.77.48.108', TTL(300)),
dns/test_nullhex.sh
dns/test_nullhex.sh
+756
-65
flake.lock
+756
-65
flake.lock
···
6
"home-manager": "home-manager",
7
"nixpkgs": [
8
"nixpkgs"
9
-
],
10
-
"systems": "systems"
11
},
12
"locked": {
13
-
"lastModified": 1723293904,
14
-
"narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
15
"owner": "ryantm",
16
"repo": "agenix",
17
-
"rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
18
"type": "github"
19
},
20
"original": {
···
35
},
36
"locked": {
37
"lastModified": 1682226636,
38
-
"narHash": "sha256-fmETHfUtQ5zOVr/4MT5wE7eNALCSQCnEUYZYmV3UEwg=",
39
"ref": "main",
40
"rev": "095d14ff2469c8f3de7cbf45d229c0f46a733aae",
41
"revCount": 77,
···
48
"url": "ssh://gitea@git.sealight.xyz/aynish/basant"
49
}
50
},
51
"darwin": {
52
"inputs": {
53
"nixpkgs": [
···
56
]
57
},
58
"locked": {
59
-
"lastModified": 1700795494,
60
-
"narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=",
61
"owner": "lnl7",
62
"repo": "nix-darwin",
63
-
"rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d",
64
"type": "github"
65
},
66
"original": {
···
70
"type": "github"
71
}
72
},
73
"deploy-rs": {
74
"inputs": {
75
"flake-compat": "flake-compat",
···
79
"utils": "utils"
80
},
81
"locked": {
82
-
"lastModified": 1718194053,
83
-
"narHash": "sha256-FaGrf7qwZ99ehPJCAwgvNY5sLCqQ3GDiE/6uLhxxwSY=",
84
"owner": "serokell",
85
"repo": "deploy-rs",
86
-
"rev": "3867348fa92bc892eba5d9ddb2d7a97b9e127a8a",
87
"type": "github"
88
},
89
"original": {
···
110
"dirt-samples-src": {
111
"flake": false,
112
"locked": {
113
-
"lastModified": 1698439458,
114
-
"narHash": "sha256-Mp8qBpsOvW9Zguv95Kv7EU6S3ICaF2aO02Wz6xGURtE=",
115
"owner": "tidalcycles",
116
"repo": "dirt-samples",
117
-
"rev": "9a6dff8f9ec3cd55b287290cf04e01afa6b8f532",
118
"type": "github"
119
},
120
"original": {
121
"owner": "tidalcycles",
122
"repo": "dirt-samples",
123
"type": "github"
124
}
···
130
]
131
},
132
"locked": {
133
-
"lastModified": 1724031427,
134
-
"narHash": "sha256-o1HdAf+7IGv9M13R3c+zc/sJ0QgeEnhsvHBcodI4UpM=",
135
"owner": "nix-community",
136
"repo": "disko",
137
-
"rev": "4e719b38fa7c85f4f65d0308ca7084c91e7bdd6d",
138
"type": "github"
139
},
140
"original": {
···
143
"type": "github"
144
}
145
},
146
"flake-compat": {
147
"flake": false,
148
"locked": {
···
175
"type": "github"
176
}
177
},
178
"flake-utils": {
179
"locked": {
180
"lastModified": 1638122382,
···
205
"type": "github"
206
}
207
},
208
"grasp": {
209
"inputs": {
210
"flake-utils": "flake-utils_2",
···
229
},
230
"hardware": {
231
"locked": {
232
-
"lastModified": 1723310128,
233
-
"narHash": "sha256-IiH8jG6PpR4h9TxSGMYh+2/gQiJW9MwehFvheSb5rPc=",
234
"owner": "nixos",
235
"repo": "nixos-hardware",
236
-
"rev": "c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf",
237
"type": "github"
238
},
239
"original": {
···
250
]
251
},
252
"locked": {
253
-
"lastModified": 1703113217,
254
-
"narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=",
255
"owner": "nix-community",
256
"repo": "home-manager",
257
-
"rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1",
258
"type": "github"
259
},
260
"original": {
···
270
]
271
},
272
"locked": {
273
-
"lastModified": 1720042825,
274
-
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
275
"owner": "nix-community",
276
"repo": "home-manager",
277
-
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
278
"type": "github"
279
},
280
"original": {
281
"owner": "nix-community",
282
-
"ref": "release-24.05",
283
"repo": "home-manager",
284
"type": "github"
285
}
286
},
287
"nix-matrix-appservices": {
288
"inputs": {
289
"devshell": "devshell",
290
"flake-compat": "flake-compat_2",
291
"nixlib": "nixlib",
292
-
"nixpkgs": "nixpkgs"
293
},
294
"locked": {
295
"lastModified": 1683490239,
···
322
},
323
"nixos-hardware": {
324
"locked": {
325
-
"lastModified": 1723310128,
326
-
"narHash": "sha256-IiH8jG6PpR4h9TxSGMYh+2/gQiJW9MwehFvheSb5rPc=",
327
"owner": "NixOS",
328
"repo": "nixos-hardware",
329
-
"rev": "c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf",
330
"type": "github"
331
},
332
"original": {
···
338
},
339
"nixpkgs": {
340
"locked": {
341
"lastModified": 1662099760,
342
"narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=",
343
"owner": "NixOS",
···
352
"type": "github"
353
}
354
},
355
-
"nixpkgs_2": {
356
"locked": {
357
-
"lastModified": 1723938990,
358
-
"narHash": "sha256-9tUadhnZQbWIiYVXH8ncfGXGvkNq3Hag4RCBEMUk7MI=",
359
"owner": "nixos",
360
"repo": "nixpkgs",
361
-
"rev": "c42fcfbdfeae23e68fc520f9182dde9f38ad1890",
362
"type": "github"
363
},
364
"original": {
365
"owner": "nixos",
366
-
"ref": "nixos-24.05",
367
"repo": "nixpkgs",
368
"type": "github"
369
}
370
},
371
"nur": {
372
"locked": {
373
-
"lastModified": 1724040334,
374
-
"narHash": "sha256-Ia4gRRmhFn4oJ4SJKJPDNPomsRRFWU+bqCK7yuiLW4E=",
375
"owner": "nix-community",
376
"repo": "NUR",
377
-
"rev": "24471a48600e18669d13d24c9640b9859357d2cf",
378
"type": "github"
379
},
380
"original": {
···
383
"type": "github"
384
}
385
},
386
"poonam": {
387
"inputs": {
388
"nixpkgs": [
···
390
]
391
},
392
"locked": {
393
-
"lastModified": 1724050814,
394
-
"narHash": "sha256-THf50ZcBPY6r7/cyvE8bxYDvrctHrWbYaMx4udr4OUM=",
395
"ref": "main",
396
-
"rev": "7628c26fd92f684ab5c7572c63de4af8b4b3a7b4",
397
-
"revCount": 1464,
398
"type": "git",
399
"url": "ssh://gitea@git.sealight.xyz/aynish/kitaab"
400
},
···
404
"url": "ssh://gitea@git.sealight.xyz/aynish/kitaab"
405
}
406
},
407
"root": {
408
"inputs": {
409
"agenix": "agenix",
410
"basant": "basant",
411
"deploy-rs": "deploy-rs",
412
"disko": "disko",
413
"grasp": "grasp",
414
"hardware": "hardware",
415
"home-manager": "home-manager_2",
416
"nix-matrix-appservices": "nix-matrix-appservices",
417
"nixos-hardware": "nixos-hardware",
418
-
"nixpkgs": "nixpkgs_2",
419
"nur": "nur",
420
"poonam": "poonam",
421
"rust-overlay": "rust-overlay",
422
"tidalcycles": "tidalcycles",
423
"unstable": "unstable",
424
"vimwikicli": "vimwikicli"
···
426
},
427
"rust-overlay": {
428
"inputs": {
429
"nixpkgs": [
430
"nixpkgs"
431
]
432
},
433
"locked": {
434
-
"lastModified": 1724034091,
435
-
"narHash": "sha256-b1g7w0sw+MDAhUAeCoX1vlTghsqcDZkxr+k9OZmxPa8=",
436
"owner": "oxalica",
437
"repo": "rust-overlay",
438
-
"rev": "c7d36e0947826e0751a5214ffe82533fbc909bc0",
439
"type": "github"
440
},
441
"original": {
···
444
"type": "github"
445
}
446
},
447
"superdirt-src": {
448
"flake": false,
449
"locked": {
450
-
"lastModified": 1697377840,
451
-
"narHash": "sha256-9qU9CHYAXbN1IE3xXDqGipuroifVaSVXj3c/cDfwM80=",
452
"owner": "musikinformatik",
453
"repo": "superdirt",
454
-
"rev": "c7f32998572984705d340e7c1b9ed9ad998a39b6",
455
"type": "github"
456
},
457
"original": {
458
"owner": "musikinformatik",
459
"repo": "superdirt",
460
"type": "github"
461
}
···
490
"type": "github"
491
}
492
},
493
"tidal-src": {
494
"flake": false,
495
"locked": {
496
-
"lastModified": 1712519522,
497
-
"narHash": "sha256-LbvxQmVxHElidCgvt+w0g1k+QQbNLebK46vtRCgsLeQ=",
498
"owner": "tidalcycles",
499
"repo": "tidal",
500
-
"rev": "88f09edf6bef2228d5f530dea872b08a9d803066",
501
"type": "github"
502
},
503
"original": {
504
"owner": "tidalcycles",
505
-
"ref": "v1.9.5",
506
"repo": "tidal",
507
"type": "github"
508
}
···
515
],
516
"superdirt-src": "superdirt-src",
517
"tidal-src": "tidal-src",
518
"vim-tidal-src": "vim-tidal-src",
519
"vowel-src": "vowel-src"
520
},
521
"locked": {
522
-
"lastModified": 1723223284,
523
-
"narHash": "sha256-NAT+g5nsaJZkpR0sCZjerd1xx233ZUdRH3ZWwZhzq/c=",
524
"owner": "mitchmindtree",
525
"repo": "tidalcycles.nix",
526
-
"rev": "82f3e8e8d02eb9f0c9dfe9ab3773b825c6bc1982",
527
"type": "github"
528
},
529
"original": {
···
532
"type": "github"
533
}
534
},
535
"unstable": {
536
"locked": {
537
-
"lastModified": 1723637854,
538
-
"narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=",
539
"owner": "nixos",
540
"repo": "nixpkgs",
541
-
"rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9",
542
"type": "github"
543
},
544
"original": {
···
550
},
551
"utils": {
552
"inputs": {
553
-
"systems": "systems_2"
554
},
555
"locked": {
556
"lastModified": 1701680307,
···
566
"type": "github"
567
}
568
},
569
"vim-tidal-src": {
570
"flake": false,
571
"locked": {
572
-
"lastModified": 1685703852,
573
-
"narHash": "sha256-8gyk17YLeKpLpz3LRtxiwbpsIbZka9bb63nK5/9IUoA=",
574
"owner": "tidalcycles",
575
"repo": "vim-tidal",
576
-
"rev": "e440fe5bdfe07f805e21e6872099685d38e8b761",
577
"type": "github"
578
},
579
"original": {
580
"owner": "tidalcycles",
581
"repo": "vim-tidal",
582
"type": "github"
583
}
···
615
},
616
"original": {
617
"owner": "supercollider-quarks",
618
"repo": "vowel",
619
"type": "github"
620
}
···
6
"home-manager": "home-manager",
7
"nixpkgs": [
8
"nixpkgs"
9
+
]
10
},
11
"locked": {
12
+
"lastModified": 1690228878,
13
+
"narHash": "sha256-9Xe7JV0krp4RJC9W9W9WutZVlw6BlHTFMiUP/k48LQY=",
14
"owner": "ryantm",
15
"repo": "agenix",
16
+
"rev": "d8c973fd228949736dedf61b7f8cc1ece3236792",
17
"type": "github"
18
},
19
"original": {
···
34
},
35
"locked": {
36
"lastModified": 1682226636,
37
+
"narHash": "sha256-f/XuEoZYh+aubCfjeduvwZjd5X7IgRYnmuuhGsdfP/U=",
38
"ref": "main",
39
"rev": "095d14ff2469c8f3de7cbf45d229c0f46a733aae",
40
"revCount": 77,
···
47
"url": "ssh://gitea@git.sealight.xyz/aynish/basant"
48
}
49
},
50
+
"brew-src": {
51
+
"flake": false,
52
+
"locked": {
53
+
"lastModified": 1705326576,
54
+
"narHash": "sha256-9PvMgHgdbpb5vBO8fHCRufodR731ynzGMF9+68vKWck=",
55
+
"owner": "Homebrew",
56
+
"repo": "brew",
57
+
"rev": "1c612baa096c69f2fcb221c74e6f5b9979efdcee",
58
+
"type": "github"
59
+
},
60
+
"original": {
61
+
"owner": "Homebrew",
62
+
"ref": "4.2.4",
63
+
"repo": "brew",
64
+
"type": "github"
65
+
}
66
+
},
67
+
"crane": {
68
+
"flake": false,
69
+
"locked": {
70
+
"lastModified": 1686108916,
71
+
"narHash": "sha256-looLH5MdY4erLiJw0XwQohGdr0fJL9y6TJY3898RA2U=",
72
+
"owner": "ipetkov",
73
+
"repo": "crane",
74
+
"rev": "8ab1a49432695bd80ff4b7f6c6515da0e926d922",
75
+
"type": "github"
76
+
},
77
+
"original": {
78
+
"owner": "ipetkov",
79
+
"ref": "v0.12.2",
80
+
"repo": "crane",
81
+
"type": "github"
82
+
}
83
+
},
84
"darwin": {
85
"inputs": {
86
"nixpkgs": [
···
89
]
90
},
91
"locked": {
92
+
"lastModified": 1673295039,
93
+
"narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=",
94
"owner": "lnl7",
95
"repo": "nix-darwin",
96
+
"rev": "87b9d090ad39b25b2400029c64825fc2a8868943",
97
"type": "github"
98
},
99
"original": {
···
103
"type": "github"
104
}
105
},
106
+
"darwin_2": {
107
+
"inputs": {
108
+
"nixpkgs": [
109
+
"nixpkgs"
110
+
]
111
+
},
112
+
"locked": {
113
+
"lastModified": 1747752302,
114
+
"narHash": "sha256-XqNAcEFfe5tJZGlx+Su0G67ZwRwZmHNWwiMK0fji0Hw=",
115
+
"owner": "nix-darwin",
116
+
"repo": "nix-darwin",
117
+
"rev": "74ecd01d2c122f8a4a48066ab1d48f3e01671671",
118
+
"type": "github"
119
+
},
120
+
"original": {
121
+
"owner": "nix-darwin",
122
+
"ref": "nix-darwin-25.05",
123
+
"repo": "nix-darwin",
124
+
"type": "github"
125
+
}
126
+
},
127
"deploy-rs": {
128
"inputs": {
129
"flake-compat": "flake-compat",
···
133
"utils": "utils"
134
},
135
"locked": {
136
+
"lastModified": 1704875591,
137
+
"narHash": "sha256-eWRLbqRcrILgztU/m/k7CYLzETKNbv0OsT2GjkaNm8A=",
138
"owner": "serokell",
139
"repo": "deploy-rs",
140
+
"rev": "1776009f1f3fb2b5d236b84d9815f2edee463a9b",
141
"type": "github"
142
},
143
"original": {
···
164
"dirt-samples-src": {
165
"flake": false,
166
"locked": {
167
+
"lastModified": 1588278411,
168
+
"narHash": "sha256-h8vQxRym6QzNLOTZU7A43VCHuG0H77l+BFwXnC0L1CE=",
169
"owner": "tidalcycles",
170
"repo": "dirt-samples",
171
+
"rev": "66d432418c9a7d82cf049d9246adfa62f46df2a6",
172
"type": "github"
173
},
174
"original": {
175
"owner": "tidalcycles",
176
+
"ref": "master",
177
"repo": "dirt-samples",
178
"type": "github"
179
}
···
185
]
186
},
187
"locked": {
188
+
"lastModified": 1690739034,
189
+
"narHash": "sha256-roW02IaiQ3gnEEDMCDWL5YyN+C4nBf/te6vfL7rG0jk=",
190
"owner": "nix-community",
191
"repo": "disko",
192
+
"rev": "4015740375676402a2ee6adebc3c30ea625b9a94",
193
"type": "github"
194
},
195
"original": {
···
198
"type": "github"
199
}
200
},
201
+
"dream2nix": {
202
+
"inputs": {
203
+
"devshell": [
204
+
"sg-nvim",
205
+
"nci"
206
+
],
207
+
"flake-compat": [
208
+
"sg-nvim",
209
+
"nci"
210
+
],
211
+
"flake-parts": [
212
+
"sg-nvim",
213
+
"nci",
214
+
"parts"
215
+
],
216
+
"nix-unit": [
217
+
"sg-nvim",
218
+
"nci"
219
+
],
220
+
"nixpkgs": [
221
+
"sg-nvim",
222
+
"nci",
223
+
"nixpkgs"
224
+
],
225
+
"pre-commit-hooks": [
226
+
"sg-nvim",
227
+
"nci"
228
+
]
229
+
},
230
+
"locked": {
231
+
"lastModified": 1696373678,
232
+
"narHash": "sha256-D5yaEkxi7VnoRsBDeHYB86FikFYDL/vq77ajo3Pa3Og=",
233
+
"owner": "nix-community",
234
+
"repo": "dream2nix",
235
+
"rev": "5e2577caaf87661e29405db7e117bda57b0e749d",
236
+
"type": "github"
237
+
},
238
+
"original": {
239
+
"owner": "nix-community",
240
+
"repo": "dream2nix",
241
+
"type": "github"
242
+
}
243
+
},
244
"flake-compat": {
245
"flake": false,
246
"locked": {
···
273
"type": "github"
274
}
275
},
276
+
"flake-compat_3": {
277
+
"flake": false,
278
+
"locked": {
279
+
"lastModified": 1673956053,
280
+
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
281
+
"owner": "edolstra",
282
+
"repo": "flake-compat",
283
+
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
284
+
"type": "github"
285
+
},
286
+
"original": {
287
+
"owner": "edolstra",
288
+
"repo": "flake-compat",
289
+
"type": "github"
290
+
}
291
+
},
292
+
"flake-parts": {
293
+
"inputs": {
294
+
"nixpkgs-lib": "nixpkgs-lib"
295
+
},
296
+
"locked": {
297
+
"lastModified": 1696343447,
298
+
"narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=",
299
+
"owner": "hercules-ci",
300
+
"repo": "flake-parts",
301
+
"rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4",
302
+
"type": "github"
303
+
},
304
+
"original": {
305
+
"owner": "hercules-ci",
306
+
"repo": "flake-parts",
307
+
"type": "github"
308
+
}
309
+
},
310
"flake-utils": {
311
"locked": {
312
"lastModified": 1638122382,
···
337
"type": "github"
338
}
339
},
340
+
"flake-utils_3": {
341
+
"inputs": {
342
+
"systems": "systems_2"
343
+
},
344
+
"locked": {
345
+
"lastModified": 1687709756,
346
+
"narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
347
+
"owner": "numtide",
348
+
"repo": "flake-utils",
349
+
"rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
350
+
"type": "github"
351
+
},
352
+
"original": {
353
+
"owner": "numtide",
354
+
"repo": "flake-utils",
355
+
"type": "github"
356
+
}
357
+
},
358
+
"flake-utils_4": {
359
+
"inputs": {
360
+
"systems": "systems_3"
361
+
},
362
+
"locked": {
363
+
"lastModified": 1681202837,
364
+
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
365
+
"owner": "numtide",
366
+
"repo": "flake-utils",
367
+
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
368
+
"type": "github"
369
+
},
370
+
"original": {
371
+
"owner": "numtide",
372
+
"repo": "flake-utils",
373
+
"type": "github"
374
+
}
375
+
},
376
+
"flake-utils_5": {
377
+
"inputs": {
378
+
"systems": "systems_4"
379
+
},
380
+
"locked": {
381
+
"lastModified": 1685518550,
382
+
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
383
+
"owner": "numtide",
384
+
"repo": "flake-utils",
385
+
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
386
+
"type": "github"
387
+
},
388
+
"original": {
389
+
"owner": "numtide",
390
+
"repo": "flake-utils",
391
+
"type": "github"
392
+
}
393
+
},
394
+
"flake-utils_6": {
395
+
"inputs": {
396
+
"systems": "systems_5"
397
+
},
398
+
"locked": {
399
+
"lastModified": 1681202837,
400
+
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
401
+
"owner": "numtide",
402
+
"repo": "flake-utils",
403
+
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
404
+
"type": "github"
405
+
},
406
+
"original": {
407
+
"owner": "numtide",
408
+
"repo": "flake-utils",
409
+
"type": "github"
410
+
}
411
+
},
412
+
"gitignore": {
413
+
"inputs": {
414
+
"nixpkgs": [
415
+
"sg-nvim",
416
+
"pre-commit-nix",
417
+
"nixpkgs"
418
+
]
419
+
},
420
+
"locked": {
421
+
"lastModified": 1660459072,
422
+
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
423
+
"owner": "hercules-ci",
424
+
"repo": "gitignore.nix",
425
+
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
426
+
"type": "github"
427
+
},
428
+
"original": {
429
+
"owner": "hercules-ci",
430
+
"repo": "gitignore.nix",
431
+
"type": "github"
432
+
}
433
+
},
434
"grasp": {
435
"inputs": {
436
"flake-utils": "flake-utils_2",
···
455
},
456
"hardware": {
457
"locked": {
458
+
"lastModified": 1691179816,
459
+
"narHash": "sha256-WSMwqzU70ZMRHv1CUAfHEEKJuB0c9c9r0F+lJehXfSI=",
460
"owner": "nixos",
461
"repo": "nixos-hardware",
462
+
"rev": "87e3122b67587492a617764f88c71991893fcf8a",
463
"type": "github"
464
},
465
"original": {
···
476
]
477
},
478
"locked": {
479
+
"lastModified": 1682203081,
480
+
"narHash": "sha256-kRL4ejWDhi0zph/FpebFYhzqlOBrk0Pl3dzGEKSAlEw=",
481
"owner": "nix-community",
482
"repo": "home-manager",
483
+
"rev": "32d3e39c491e2f91152c84f8ad8b003420eab0a1",
484
"type": "github"
485
},
486
"original": {
···
496
]
497
},
498
"locked": {
499
+
"lastModified": 1747556831,
500
+
"narHash": "sha256-Qb84nbYFFk0DzFeqVoHltS2RodAYY5/HZQKE8WnBDsc=",
501
"owner": "nix-community",
502
"repo": "home-manager",
503
+
"rev": "d0bbd221482c2713cccb80220f3c9d16a6e20a33",
504
"type": "github"
505
},
506
"original": {
507
"owner": "nix-community",
508
+
"ref": "release-25.05",
509
"repo": "home-manager",
510
"type": "github"
511
}
512
},
513
+
"homebrew-bundle": {
514
+
"flake": false,
515
+
"locked": {
516
+
"lastModified": 1709834002,
517
+
"narHash": "sha256-KNRwMnyo6ZLphIh2bn02KNOtRf2X3NHqUbS7y4Vmn+M=",
518
+
"owner": "homebrew",
519
+
"repo": "homebrew-bundle",
520
+
"rev": "bb1c80baa7fac67bbffe81a2862c75a5dc7ea4a7",
521
+
"type": "github"
522
+
},
523
+
"original": {
524
+
"owner": "homebrew",
525
+
"repo": "homebrew-bundle",
526
+
"type": "github"
527
+
}
528
+
},
529
+
"homebrew-cask": {
530
+
"flake": false,
531
+
"locked": {
532
+
"lastModified": 1709955474,
533
+
"narHash": "sha256-pE5x579FqCieeeEmrUtNKoBsMG41WSOfGWtXCTI9FP4=",
534
+
"owner": "homebrew",
535
+
"repo": "homebrew-cask",
536
+
"rev": "43b9db57368e350c116398c7da6cb5401cd37ebe",
537
+
"type": "github"
538
+
},
539
+
"original": {
540
+
"owner": "homebrew",
541
+
"repo": "homebrew-cask",
542
+
"type": "github"
543
+
}
544
+
},
545
+
"homebrew-core": {
546
+
"flake": false,
547
+
"locked": {
548
+
"lastModified": 1709956143,
549
+
"narHash": "sha256-5eyfpnVhxVv3+n53vp4j9DNx7O+mqtQqUn90JKS1PMM=",
550
+
"owner": "homebrew",
551
+
"repo": "homebrew-core",
552
+
"rev": "a38d7e99bc103e9564208f2d155701d70001c8cc",
553
+
"type": "github"
554
+
},
555
+
"original": {
556
+
"owner": "homebrew",
557
+
"repo": "homebrew-core",
558
+
"type": "github"
559
+
}
560
+
},
561
+
"mk-naked-shell": {
562
+
"flake": false,
563
+
"locked": {
564
+
"lastModified": 1681286841,
565
+
"narHash": "sha256-3XlJrwlR0nBiREnuogoa5i1b4+w/XPe0z8bbrJASw0g=",
566
+
"owner": "yusdacra",
567
+
"repo": "mk-naked-shell",
568
+
"rev": "7612f828dd6f22b7fb332cc69440e839d7ffe6bd",
569
+
"type": "github"
570
+
},
571
+
"original": {
572
+
"owner": "yusdacra",
573
+
"repo": "mk-naked-shell",
574
+
"type": "github"
575
+
}
576
+
},
577
+
"nci": {
578
+
"inputs": {
579
+
"crane": "crane",
580
+
"dream2nix": "dream2nix",
581
+
"mk-naked-shell": "mk-naked-shell",
582
+
"nixpkgs": "nixpkgs_5",
583
+
"parts": "parts",
584
+
"rust-overlay": "rust-overlay_2",
585
+
"treefmt": "treefmt"
586
+
},
587
+
"locked": {
588
+
"lastModified": 1696572678,
589
+
"narHash": "sha256-rcznf00l41VtjzvEGMWOxaj5J/5twES6n30VwbJMgl0=",
590
+
"owner": "yusdacra",
591
+
"repo": "nix-cargo-integration",
592
+
"rev": "cacb6c94004a35676c193f04afa8821758986bf0",
593
+
"type": "github"
594
+
},
595
+
"original": {
596
+
"owner": "yusdacra",
597
+
"repo": "nix-cargo-integration",
598
+
"type": "github"
599
+
}
600
+
},
601
+
"nix-darwin": {
602
+
"inputs": {
603
+
"nixpkgs": "nixpkgs"
604
+
},
605
+
"locked": {
606
+
"lastModified": 1688307440,
607
+
"narHash": "sha256-7PTjbN+/+b799YN7Tk2SS5Vh8A0L3gBo8hmB7Y0VXug=",
608
+
"owner": "LnL7",
609
+
"repo": "nix-darwin",
610
+
"rev": "b06bab83bdf285ea0ae3c8e145a081eb95959047",
611
+
"type": "github"
612
+
},
613
+
"original": {
614
+
"owner": "LnL7",
615
+
"repo": "nix-darwin",
616
+
"type": "github"
617
+
}
618
+
},
619
+
"nix-homebrew": {
620
+
"inputs": {
621
+
"brew-src": "brew-src",
622
+
"flake-utils": "flake-utils_3",
623
+
"nix-darwin": "nix-darwin",
624
+
"nixpkgs": "nixpkgs_2"
625
+
},
626
+
"locked": {
627
+
"lastModified": 1705952034,
628
+
"narHash": "sha256-H0nk8Gk8kPw4yi2WwOTsSHgPrzSwyNgWEYHk10IJwfc=",
629
+
"owner": "zhaofengli-wip",
630
+
"repo": "nix-homebrew",
631
+
"rev": "40f5ee46b58e7c5f1927e2c5a583dc3d7e571ed9",
632
+
"type": "github"
633
+
},
634
+
"original": {
635
+
"owner": "zhaofengli-wip",
636
+
"repo": "nix-homebrew",
637
+
"type": "github"
638
+
}
639
+
},
640
"nix-matrix-appservices": {
641
"inputs": {
642
"devshell": "devshell",
643
"flake-compat": "flake-compat_2",
644
"nixlib": "nixlib",
645
+
"nixpkgs": "nixpkgs_3"
646
},
647
"locked": {
648
"lastModified": 1683490239,
···
675
},
676
"nixos-hardware": {
677
"locked": {
678
+
"lastModified": 1691179816,
679
+
"narHash": "sha256-WSMwqzU70ZMRHv1CUAfHEEKJuB0c9c9r0F+lJehXfSI=",
680
"owner": "NixOS",
681
"repo": "nixos-hardware",
682
+
"rev": "87e3122b67587492a617764f88c71991893fcf8a",
683
"type": "github"
684
},
685
"original": {
···
691
},
692
"nixpkgs": {
693
"locked": {
694
+
"lastModified": 1687274257,
695
+
"narHash": "sha256-TutzPriQcZ8FghDhEolnHcYU2oHIG5XWF+/SUBNnAOE=",
696
+
"path": "/nix/store/22qgs3skscd9bmrxv9xv4q5d4wwm5ppx-source",
697
+
"rev": "2c9ecd1f0400076a4d6b2193ad468ff0a7e7fdc5",
698
+
"type": "path"
699
+
},
700
+
"original": {
701
+
"id": "nixpkgs",
702
+
"type": "indirect"
703
+
}
704
+
},
705
+
"nixpkgs-lib": {
706
+
"locked": {
707
+
"dir": "lib",
708
+
"lastModified": 1696019113,
709
+
"narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=",
710
+
"owner": "NixOS",
711
+
"repo": "nixpkgs",
712
+
"rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a",
713
+
"type": "github"
714
+
},
715
+
"original": {
716
+
"dir": "lib",
717
+
"owner": "NixOS",
718
+
"ref": "nixos-unstable",
719
+
"repo": "nixpkgs",
720
+
"type": "github"
721
+
}
722
+
},
723
+
"nixpkgs-stable": {
724
+
"locked": {
725
+
"lastModified": 1685801374,
726
+
"narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=",
727
+
"owner": "NixOS",
728
+
"repo": "nixpkgs",
729
+
"rev": "c37ca420157f4abc31e26f436c1145f8951ff373",
730
+
"type": "github"
731
+
},
732
+
"original": {
733
+
"owner": "NixOS",
734
+
"ref": "nixos-23.05",
735
+
"repo": "nixpkgs",
736
+
"type": "github"
737
+
}
738
+
},
739
+
"nixpkgs_2": {
740
+
"locked": {
741
+
"lastModified": 1688049487,
742
+
"narHash": "sha256-100g4iaKC9MalDjUW9iN6Jl/OocTDtXdeAj7pEGIRh4=",
743
+
"owner": "NixOS",
744
+
"repo": "nixpkgs",
745
+
"rev": "4bc72cae107788bf3f24f30db2e2f685c9298dc9",
746
+
"type": "github"
747
+
},
748
+
"original": {
749
+
"owner": "NixOS",
750
+
"ref": "nixos-unstable",
751
+
"repo": "nixpkgs",
752
+
"type": "github"
753
+
}
754
+
},
755
+
"nixpkgs_3": {
756
+
"locked": {
757
"lastModified": 1662099760,
758
"narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=",
759
"owner": "NixOS",
···
768
"type": "github"
769
}
770
},
771
+
"nixpkgs_4": {
772
+
"locked": {
773
+
"lastModified": 1747610100,
774
+
"narHash": "sha256-rpR5ZPMkWzcnCcYYo3lScqfuzEw5Uyfh+R0EKZfroAc=",
775
+
"owner": "nixos",
776
+
"repo": "nixpkgs",
777
+
"rev": "ca49c4304acf0973078db0a9d200fd2bae75676d",
778
+
"type": "github"
779
+
},
780
+
"original": {
781
+
"owner": "nixos",
782
+
"ref": "nixos-25.05",
783
+
"repo": "nixpkgs",
784
+
"type": "github"
785
+
}
786
+
},
787
+
"nixpkgs_5": {
788
+
"locked": {
789
+
"lastModified": 1696193975,
790
+
"narHash": "sha256-mnQjUcYgp9Guu3RNVAB2Srr1TqKcPpRXmJf4LJk6KRY=",
791
+
"owner": "NixOS",
792
+
"repo": "nixpkgs",
793
+
"rev": "fdd898f8f79e8d2f99ed2ab6b3751811ef683242",
794
+
"type": "github"
795
+
},
796
+
"original": {
797
+
"owner": "NixOS",
798
+
"ref": "nixos-unstable",
799
+
"repo": "nixpkgs",
800
+
"type": "github"
801
+
}
802
+
},
803
+
"nixpkgs_6": {
804
"locked": {
805
+
"lastModified": 1696419054,
806
+
"narHash": "sha256-EdR+dIKCfqL3voZUDYwcvgRDOektQB9KbhBVcE0/3Mo=",
807
"owner": "nixos",
808
"repo": "nixpkgs",
809
+
"rev": "7131f3c223a2d799568e4b278380cd9dac2b8579",
810
"type": "github"
811
},
812
"original": {
813
"owner": "nixos",
814
+
"ref": "nixpkgs-unstable",
815
+
"repo": "nixpkgs",
816
+
"type": "github"
817
+
}
818
+
},
819
+
"nixpkgs_7": {
820
+
"locked": {
821
+
"lastModified": 1689261696,
822
+
"narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=",
823
+
"owner": "NixOS",
824
+
"repo": "nixpkgs",
825
+
"rev": "df1eee2aa65052a18121ed4971081576b25d6b5c",
826
+
"type": "github"
827
+
},
828
+
"original": {
829
+
"owner": "NixOS",
830
+
"ref": "nixpkgs-unstable",
831
+
"repo": "nixpkgs",
832
+
"type": "github"
833
+
}
834
+
},
835
+
"nixpkgs_8": {
836
+
"locked": {
837
+
"lastModified": 1681358109,
838
+
"narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=",
839
+
"owner": "NixOS",
840
+
"repo": "nixpkgs",
841
+
"rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9",
842
+
"type": "github"
843
+
},
844
+
"original": {
845
+
"owner": "NixOS",
846
+
"ref": "nixpkgs-unstable",
847
"repo": "nixpkgs",
848
"type": "github"
849
}
850
},
851
"nur": {
852
"locked": {
853
+
"lastModified": 1691214006,
854
+
"narHash": "sha256-kdfBd+Y0DTOOdgSA6h6iIn403xVj4bzLnXqb7+yM6lQ=",
855
"owner": "nix-community",
856
"repo": "NUR",
857
+
"rev": "963ad2d1bb0a8f59b2c23ab521d4dff2148aad16",
858
"type": "github"
859
},
860
"original": {
···
863
"type": "github"
864
}
865
},
866
+
"parts": {
867
+
"inputs": {
868
+
"nixpkgs-lib": [
869
+
"sg-nvim",
870
+
"nci",
871
+
"nixpkgs"
872
+
]
873
+
},
874
+
"locked": {
875
+
"lastModified": 1696343447,
876
+
"narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=",
877
+
"owner": "hercules-ci",
878
+
"repo": "flake-parts",
879
+
"rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4",
880
+
"type": "github"
881
+
},
882
+
"original": {
883
+
"owner": "hercules-ci",
884
+
"repo": "flake-parts",
885
+
"type": "github"
886
+
}
887
+
},
888
"poonam": {
889
"inputs": {
890
"nixpkgs": [
···
892
]
893
},
894
"locked": {
895
+
"lastModified": 1724637654,
896
+
"narHash": "sha256-YXmWxUEG3NDsLn46Ctrgn7YcT/h0fsCAxKcSgIhCSLo=",
897
"ref": "main",
898
+
"rev": "521e360df123a530fc4c99187e3580bd5d086a9d",
899
+
"revCount": 1467,
900
"type": "git",
901
"url": "ssh://gitea@git.sealight.xyz/aynish/kitaab"
902
},
···
906
"url": "ssh://gitea@git.sealight.xyz/aynish/kitaab"
907
}
908
},
909
+
"pre-commit-nix": {
910
+
"inputs": {
911
+
"flake-compat": "flake-compat_3",
912
+
"flake-utils": "flake-utils_5",
913
+
"gitignore": "gitignore",
914
+
"nixpkgs": "nixpkgs_7",
915
+
"nixpkgs-stable": "nixpkgs-stable"
916
+
},
917
+
"locked": {
918
+
"lastModified": 1696516544,
919
+
"narHash": "sha256-8rKE8Je6twTNFRTGF63P9mE3lZIq917RAicdc4XJO80=",
920
+
"owner": "cachix",
921
+
"repo": "pre-commit-hooks.nix",
922
+
"rev": "66c352d33e0907239e4a69416334f64af2c685cc",
923
+
"type": "github"
924
+
},
925
+
"original": {
926
+
"owner": "cachix",
927
+
"repo": "pre-commit-hooks.nix",
928
+
"type": "github"
929
+
}
930
+
},
931
"root": {
932
"inputs": {
933
"agenix": "agenix",
934
"basant": "basant",
935
+
"darwin": "darwin_2",
936
"deploy-rs": "deploy-rs",
937
"disko": "disko",
938
"grasp": "grasp",
939
"hardware": "hardware",
940
"home-manager": "home-manager_2",
941
+
"homebrew-bundle": "homebrew-bundle",
942
+
"homebrew-cask": "homebrew-cask",
943
+
"homebrew-core": "homebrew-core",
944
+
"nix-homebrew": "nix-homebrew",
945
"nix-matrix-appservices": "nix-matrix-appservices",
946
"nixos-hardware": "nixos-hardware",
947
+
"nixpkgs": "nixpkgs_4",
948
"nur": "nur",
949
"poonam": "poonam",
950
"rust-overlay": "rust-overlay",
951
+
"sg-nvim": "sg-nvim",
952
+
"sourcegraph-src-cli-cask": "sourcegraph-src-cli-cask",
953
"tidalcycles": "tidalcycles",
954
"unstable": "unstable",
955
"vimwikicli": "vimwikicli"
···
957
},
958
"rust-overlay": {
959
"inputs": {
960
+
"flake-utils": "flake-utils_4",
961
"nixpkgs": [
962
"nixpkgs"
963
]
964
},
965
"locked": {
966
+
"lastModified": 1691201768,
967
+
"narHash": "sha256-h+QJMpawZoK1+8efF6UjQoY1EHZfHteXVa5OYnlqRWA=",
968
"owner": "oxalica",
969
"repo": "rust-overlay",
970
+
"rev": "18ee2a71de24273e4ad4503b5604532f0b53f382",
971
"type": "github"
972
},
973
"original": {
···
976
"type": "github"
977
}
978
},
979
+
"rust-overlay_2": {
980
+
"flake": false,
981
+
"locked": {
982
+
"lastModified": 1696558324,
983
+
"narHash": "sha256-TnnP4LGwDB8ZGE7h2n4nA9Faee8xPkMdNcyrzJ57cbw=",
984
+
"owner": "oxalica",
985
+
"repo": "rust-overlay",
986
+
"rev": "fdb37574a04df04aaa8cf7708f94a9309caebe2b",
987
+
"type": "github"
988
+
},
989
+
"original": {
990
+
"owner": "oxalica",
991
+
"repo": "rust-overlay",
992
+
"type": "github"
993
+
}
994
+
},
995
+
"rust-overlay_3": {
996
+
"inputs": {
997
+
"flake-utils": "flake-utils_6",
998
+
"nixpkgs": "nixpkgs_8"
999
+
},
1000
+
"locked": {
1001
+
"lastModified": 1696558324,
1002
+
"narHash": "sha256-TnnP4LGwDB8ZGE7h2n4nA9Faee8xPkMdNcyrzJ57cbw=",
1003
+
"owner": "oxalica",
1004
+
"repo": "rust-overlay",
1005
+
"rev": "fdb37574a04df04aaa8cf7708f94a9309caebe2b",
1006
+
"type": "github"
1007
+
},
1008
+
"original": {
1009
+
"owner": "oxalica",
1010
+
"repo": "rust-overlay",
1011
+
"type": "github"
1012
+
}
1013
+
},
1014
+
"sg-nvim": {
1015
+
"inputs": {
1016
+
"flake-parts": "flake-parts",
1017
+
"nci": "nci",
1018
+
"nixpkgs": "nixpkgs_6",
1019
+
"pre-commit-nix": "pre-commit-nix",
1020
+
"rust-overlay": "rust-overlay_3"
1021
+
},
1022
+
"locked": {
1023
+
"lastModified": 1716664639,
1024
+
"narHash": "sha256-5wzTW9kJGYq41kXG9JoVAaA5601K26cDrweT2PtpEw8=",
1025
+
"owner": "sourcegraph",
1026
+
"repo": "sg.nvim",
1027
+
"rev": "8bdd4d19da2268072708d5fe18fda9c23e16509d",
1028
+
"type": "github"
1029
+
},
1030
+
"original": {
1031
+
"owner": "sourcegraph",
1032
+
"repo": "sg.nvim",
1033
+
"type": "github"
1034
+
}
1035
+
},
1036
+
"sourcegraph-src-cli-cask": {
1037
+
"flake": false,
1038
+
"locked": {
1039
+
"lastModified": 1722629753,
1040
+
"narHash": "sha256-3OwvDSoVzklr3ca1qCXR27Kc8hGjshRRdtVQ8OUXQCc=",
1041
+
"owner": "sourcegraph",
1042
+
"repo": "homebrew-src-cli",
1043
+
"rev": "130bd8ab70961e5c1f890811bfb1f7552a2ee5a9",
1044
+
"type": "github"
1045
+
},
1046
+
"original": {
1047
+
"owner": "sourcegraph",
1048
+
"repo": "homebrew-src-cli",
1049
+
"type": "github"
1050
+
}
1051
+
},
1052
"superdirt-src": {
1053
"flake": false,
1054
"locked": {
1055
+
"lastModified": 1611740180,
1056
+
"narHash": "sha256-GtnqZeMFqFkVhgx2Exu0wY687cHa7mNnVCgjQd6fiIA=",
1057
"owner": "musikinformatik",
1058
"repo": "superdirt",
1059
+
"rev": "7abb62e89649daa1232b9cbd6427241868abd30e",
1060
"type": "github"
1061
},
1062
"original": {
1063
"owner": "musikinformatik",
1064
+
"ref": "master",
1065
"repo": "superdirt",
1066
"type": "github"
1067
}
···
1096
"type": "github"
1097
}
1098
},
1099
+
"systems_3": {
1100
+
"locked": {
1101
+
"lastModified": 1681028828,
1102
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
1103
+
"owner": "nix-systems",
1104
+
"repo": "default",
1105
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
1106
+
"type": "github"
1107
+
},
1108
+
"original": {
1109
+
"owner": "nix-systems",
1110
+
"repo": "default",
1111
+
"type": "github"
1112
+
}
1113
+
},
1114
+
"systems_4": {
1115
+
"locked": {
1116
+
"lastModified": 1681028828,
1117
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
1118
+
"owner": "nix-systems",
1119
+
"repo": "default",
1120
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
1121
+
"type": "github"
1122
+
},
1123
+
"original": {
1124
+
"owner": "nix-systems",
1125
+
"repo": "default",
1126
+
"type": "github"
1127
+
}
1128
+
},
1129
+
"systems_5": {
1130
+
"locked": {
1131
+
"lastModified": 1681028828,
1132
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
1133
+
"owner": "nix-systems",
1134
+
"repo": "default",
1135
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
1136
+
"type": "github"
1137
+
},
1138
+
"original": {
1139
+
"owner": "nix-systems",
1140
+
"repo": "default",
1141
+
"type": "github"
1142
+
}
1143
+
},
1144
"tidal-src": {
1145
"flake": false,
1146
"locked": {
1147
+
"lastModified": 1654350756,
1148
+
"narHash": "sha256-tONM5SYYBca0orTLH1EUOilSC1FCluWrFt8AetUx+YQ=",
1149
"owner": "tidalcycles",
1150
"repo": "tidal",
1151
+
"rev": "fda9c1ecb3722698935245e5409ef8ccdfca16c8",
1152
"type": "github"
1153
},
1154
"original": {
1155
"owner": "tidalcycles",
1156
+
"ref": "main",
1157
"repo": "tidal",
1158
"type": "github"
1159
}
···
1166
],
1167
"superdirt-src": "superdirt-src",
1168
"tidal-src": "tidal-src",
1169
+
"utils": "utils_2",
1170
"vim-tidal-src": "vim-tidal-src",
1171
"vowel-src": "vowel-src"
1172
},
1173
"locked": {
1174
+
"lastModified": 1664760044,
1175
+
"narHash": "sha256-e5LGk/tDnphory1mYhADgPnVtShofY2w/3xY09jEE2A=",
1176
"owner": "mitchmindtree",
1177
"repo": "tidalcycles.nix",
1178
+
"rev": "3f3a820cd43709077d15a24fa6062de7d623a6bf",
1179
"type": "github"
1180
},
1181
"original": {
···
1184
"type": "github"
1185
}
1186
},
1187
+
"treefmt": {
1188
+
"inputs": {
1189
+
"nixpkgs": [
1190
+
"sg-nvim",
1191
+
"nci",
1192
+
"nixpkgs"
1193
+
]
1194
+
},
1195
+
"locked": {
1196
+
"lastModified": 1695822946,
1197
+
"narHash": "sha256-IQU3fYo0H+oGlqX5YrgZU3VRhbt2Oqe6KmslQKUO4II=",
1198
+
"owner": "numtide",
1199
+
"repo": "treefmt-nix",
1200
+
"rev": "720bd006d855b08e60664e4683ccddb7a9ff614a",
1201
+
"type": "github"
1202
+
},
1203
+
"original": {
1204
+
"owner": "numtide",
1205
+
"repo": "treefmt-nix",
1206
+
"type": "github"
1207
+
}
1208
+
},
1209
"unstable": {
1210
"locked": {
1211
+
"lastModified": 1747542820,
1212
+
"narHash": "sha256-GaOZntlJ6gPPbbkTLjbd8BMWaDYafhuuYRNrxCGnPJw=",
1213
"owner": "nixos",
1214
"repo": "nixpkgs",
1215
+
"rev": "292fa7d4f6519c074f0a50394dbbe69859bb6043",
1216
"type": "github"
1217
},
1218
"original": {
···
1224
},
1225
"utils": {
1226
"inputs": {
1227
+
"systems": "systems"
1228
},
1229
"locked": {
1230
"lastModified": 1701680307,
···
1240
"type": "github"
1241
}
1242
},
1243
+
"utils_2": {
1244
+
"locked": {
1245
+
"lastModified": 1653893745,
1246
+
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
1247
+
"owner": "numtide",
1248
+
"repo": "flake-utils",
1249
+
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
1250
+
"type": "github"
1251
+
},
1252
+
"original": {
1253
+
"owner": "numtide",
1254
+
"repo": "flake-utils",
1255
+
"type": "github"
1256
+
}
1257
+
},
1258
"vim-tidal-src": {
1259
"flake": false,
1260
"locked": {
1261
+
"lastModified": 1664252474,
1262
+
"narHash": "sha256-hleiK2Q7xYndpB+tIbyyXIM2sk4NunUh9DPgMqmf/Wc=",
1263
"owner": "tidalcycles",
1264
"repo": "vim-tidal",
1265
+
"rev": "b07f5c12986fb837e055d7fcf0acf3b7e248148f",
1266
"type": "github"
1267
},
1268
"original": {
1269
"owner": "tidalcycles",
1270
+
"ref": "master",
1271
"repo": "vim-tidal",
1272
"type": "github"
1273
}
···
1305
},
1306
"original": {
1307
"owner": "supercollider-quarks",
1308
+
"ref": "master",
1309
"repo": "vowel",
1310
"type": "github"
1311
}
+114
-25
flake.nix
+114
-25
flake.nix
···
1
{
2
-
description = "Sealight NixOS Config";
3
4
inputs = {
5
# Nixpkgs
6
-
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
7
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
8
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
9
10
-
# ngipkgs.url = "github:Chickensoupwithrice/ngipkgs?ref=aynish/atomic-server-module";
11
-
# ngipkgs-local.url = "path:/home/anish/usr/ngipkgs";
12
-
13
# Home manager
14
-
home-manager.url = "github:nix-community/home-manager/release-24.05";
15
home-manager.inputs.nixpkgs.follows = "nixpkgs";
16
hardware.url = "github:nixos/nixos-hardware";
17
···
37
# Matrix
38
nix-matrix-appservices.url = "gitlab:coffeetables/nix-matrix-appservices";
39
40
# Others
41
nur.url = "github:nix-community/NUR";
42
rust-overlay = {
···
70
, tidalcycles
71
, rust-overlay
72
, vimwikicli
73
, ...
74
}@inputs:
75
let
···
84
# We already have these in scope
85
unstable = unstable.legacyPackages.${prev.system};
86
deploy = deploy-rs.packages.${prev.system}.deploy-rs;
87
};
88
vimwikiOverlay = final: prev: {
89
vimwiki-cli = vimwikicli.packages.${prev.system}.vimwiki-cli;
···
91
92
nixpkgsFor = forAllSystems (system: import nixpkgs {
93
inherit system;
94
-
config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
95
-
"ripcord"
96
-
"vcv-rack"
97
-
"SunVox"
98
-
"renoise"
99
-
];
100
# config.permittedInsecurePackages = [
101
# "python3.10-django-3.1.14" # Needed for archivebox deployments on curve
102
# # Check when archive box updates it's dependeny
···
108
nur.overlay
109
nix-matrix-appservices.overlay
110
unstableOverlay
111
-
vimwikiOverlay
112
self.overlays.additions
113
self.overlays.modifications
114
];
···
123
# ];
124
overlays = [
125
agenix.overlays.default
126
-
self.overlays.additions
127
-
self.overlays.modifications
128
tidalcycles.overlays.default # needed for nvim which comes pre-installed lol
129
];
130
});
131
in
132
{
133
-
# Your custom packages
134
-
# Acessible through 'nix build', 'nix shell', etc
135
packages = forAllSystems (system:
136
let pkgs = nixpkgsFor.${system};
137
in import ./pkgs { pkgs = pkgs; }
138
);
139
# Devshell for bootstrapping
140
# Acessible through 'nix develop' or 'nix-shell' (legacy)
141
devShells = forAllSystems (system:
···
152
# These are usually stuff you would upstream into home-manager
153
homeManagerModules = import ./modules/home-manager;
154
155
# NixOS configuration entrypoint
156
nixosConfigurations = {
157
curve = nixpkgs.lib.nixosSystem rec {
···
163
agenix.nixosModules.age
164
self.nixosModules.backup
165
self.nixosModules.wireguard
166
-
self.nixosModules.wallabag
167
nixos-hardware.nixosModules.lenovo-thinkpad-x270
168
home-manager.nixosModules.home-manager
169
{
···
185
agenix.nixosModules.age
186
self.nixosModules.backup
187
self.nixosModules.wireguard
188
-
basant.nixosModule
189
# self.nixosModules.microbin
190
disko.nixosModules.disko
191
-
{
192
-
nixpkgs.flake.setNixPath = false;
193
-
nixpkgs.flake.setFlakeRegistry = false;
194
-
}
195
];
196
};
197
···
214
];
215
};
216
217
box = nixpkgs.lib.nixosSystem rec {
218
specialArgs = { inherit inputs self; };
219
system = "x86_64-linux";
···
224
self.nixosModules.backup
225
self.nixosModules.wireguard
226
self.nixosModules.gonic
227
-
self.nixosModules.gpodder2go
228
self.nixosModules.wallabag
229
self.nixosModules.ulogger-server
230
grasp.nixosModule
···
257
hostname = "mossnet.lan";
258
autoRollback = false;
259
magicRollback = false;
260
-
remoteBuild = true;
261
profiles.system = {
262
user = "root";
263
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.box;
···
278
profiles.system = {
279
user = "root";
280
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.helix;
281
};
282
};
283
};
···
1
{
2
+
description = "Your new nix config";
3
4
inputs = {
5
# Nixpkgs
6
+
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
7
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
8
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
9
10
# Home manager
11
+
home-manager.url = "github:nix-community/home-manager/release-25.05";
12
home-manager.inputs.nixpkgs.follows = "nixpkgs";
13
hardware.url = "github:nixos/nixos-hardware";
14
···
34
# Matrix
35
nix-matrix-appservices.url = "gitlab:coffeetables/nix-matrix-appservices";
36
37
+
# OSX
38
+
darwin = {
39
+
url = "github:nix-darwin/nix-darwin/nix-darwin-25.05";
40
+
inputs.nixpkgs.follows = "nixpkgs";
41
+
};
42
+
nix-homebrew = {
43
+
url = "github:zhaofengli-wip/nix-homebrew";
44
+
};
45
+
homebrew-bundle = {
46
+
url = "github:homebrew/homebrew-bundle";
47
+
flake = false;
48
+
};
49
+
homebrew-core = {
50
+
url = "github:homebrew/homebrew-core";
51
+
flake = false;
52
+
};
53
+
homebrew-cask = {
54
+
url = "github:homebrew/homebrew-cask";
55
+
flake = false;
56
+
};
57
+
58
+
# Sourcegraph
59
+
sourcegraph-src-cli-cask = {
60
+
url = "github:sourcegraph/homebrew-src-cli";
61
+
flake = false;
62
+
};
63
+
sg-nvim.url = "github:sourcegraph/sg.nvim";
64
+
65
# Others
66
nur.url = "github:nix-community/NUR";
67
rust-overlay = {
···
95
, tidalcycles
96
, rust-overlay
97
, vimwikicli
98
+
, darwin
99
+
, nix-homebrew
100
+
, homebrew-bundle
101
+
, homebrew-core
102
+
, homebrew-cask
103
+
, sourcegraph-src-cli-cask
104
+
, sg-nvim
105
, ...
106
}@inputs:
107
let
···
116
# We already have these in scope
117
unstable = unstable.legacyPackages.${prev.system};
118
deploy = deploy-rs.packages.${prev.system}.deploy-rs;
119
+
sg-nvim = sg-nvim.packages.${prev.system}.default;
120
};
121
vimwikiOverlay = final: prev: {
122
vimwiki-cli = vimwikicli.packages.${prev.system}.vimwiki-cli;
···
124
125
nixpkgsFor = forAllSystems (system: import nixpkgs {
126
inherit system;
127
+
# This doesn't work...
128
+
# on darwin, I need to export ALLOW_NIXPKGS_UNFREE=1
129
+
# and pass --impure (have to manually copy the `nrd` command, it gets passed to the cd)
130
+
config = {
131
+
allowUnfree = true;
132
+
allowUnfreePredicate = _: true;
133
+
};
134
+
# config.allowUnfree = true;
135
+
#config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
136
+
# "ripcord"
137
+
# "VCV-Rack"
138
+
# "SunVox"
139
+
# "renoise"
140
+
# "graphite-cli"
141
+
# "claude-code"
142
+
#];
143
# config.permittedInsecurePackages = [
144
# "python3.10-django-3.1.14" # Needed for archivebox deployments on curve
145
# # Check when archive box updates it's dependeny
···
151
nur.overlay
152
nix-matrix-appservices.overlay
153
unstableOverlay
154
+
# TODO Not available publically
155
+
# vimwikiOverlay
156
self.overlays.additions
157
self.overlays.modifications
158
];
···
167
# ];
168
overlays = [
169
agenix.overlays.default
170
tidalcycles.overlays.default # needed for nvim which comes pre-installed lol
171
];
172
});
173
+
174
+
darwinSystems = [ "aarch64-darwin" "x86_64-darwin" ];
175
in
176
{
177
packages = forAllSystems (system:
178
let pkgs = nixpkgsFor.${system};
179
in import ./pkgs { pkgs = pkgs; }
180
);
181
+
182
# Devshell for bootstrapping
183
# Acessible through 'nix develop' or 'nix-shell' (legacy)
184
devShells = forAllSystems (system:
···
195
# These are usually stuff you would upstream into home-manager
196
homeManagerModules = import ./modules/home-manager;
197
198
+
darwinConfigurations = {
199
+
"Anishs-MacBook-Pro" = darwin.lib.darwinSystem rec {
200
+
system = "aarch64-darwin";
201
+
pkgs = nixpkgsFor.${system};
202
+
specialArgs = { inherit inputs self; };
203
+
modules = [
204
+
./hosts/darwin
205
+
home-manager.darwinModules.home-manager
206
+
agenix.darwinModules.default
207
+
# nix-homebrew.darwinModules.nix-homebrew
208
+
{
209
+
users.users.anishlakhwara.home = "/Users/anishlakhwara";
210
+
home-manager = {
211
+
users.anishlakhwara = import ./home/darwin;
212
+
useGlobalPkgs = true;
213
+
useUserPackages = true;
214
+
};
215
+
# nix-homebrew = {
216
+
# user = "anishlakhwara";
217
+
# enable = true;
218
+
# # taps = {
219
+
# # "homebrew/homebrew-core" = homebrew-core;
220
+
# # "homebrew/homebrew-cask" = homebrew-cask;
221
+
# # "homebrew/homebrew-bundle" = homebrew-bundle;
222
+
# # "sourcegraph/homebrew-src-cli" = sourcegraph-src-cli-cask;
223
+
# # };
224
+
# mutableTaps = true;
225
+
# autoMigrate = true;
226
+
# };
227
+
}
228
+
];
229
+
};
230
+
};
231
+
232
# NixOS configuration entrypoint
233
nixosConfigurations = {
234
curve = nixpkgs.lib.nixosSystem rec {
···
240
agenix.nixosModules.age
241
self.nixosModules.backup
242
self.nixosModules.wireguard
243
nixos-hardware.nixosModules.lenovo-thinkpad-x270
244
home-manager.nixosModules.home-manager
245
{
···
261
agenix.nixosModules.age
262
self.nixosModules.backup
263
self.nixosModules.wireguard
264
# self.nixosModules.microbin
265
disko.nixosModules.disko
266
];
267
};
268
···
285
];
286
};
287
288
+
cube = nixpkgs.lib.nixosSystem rec {
289
+
specialArgs = { inherit inputs self; };
290
+
system = "x86_64-linux";
291
+
pkgs = litePkgsFor.${system};
292
+
modules = [
293
+
./hosts/cube
294
+
agenix.nixosModules.age
295
+
self.nixosModules.backup
296
+
self.nixosModules.wireguard
297
+
basant.nixosModule
298
+
];
299
+
};
300
+
301
box = nixpkgs.lib.nixosSystem rec {
302
specialArgs = { inherit inputs self; };
303
system = "x86_64-linux";
···
308
self.nixosModules.backup
309
self.nixosModules.wireguard
310
self.nixosModules.gonic
311
self.nixosModules.wallabag
312
self.nixosModules.ulogger-server
313
grasp.nixosModule
···
340
hostname = "mossnet.lan";
341
autoRollback = false;
342
magicRollback = false;
343
profiles.system = {
344
user = "root";
345
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.box;
···
360
profiles.system = {
361
user = "root";
362
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.helix;
363
+
};
364
+
};
365
+
cube = {
366
+
hostname = "lakhwara.com";
367
+
profiles.system = {
368
+
user = "root";
369
+
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cube;
370
};
371
};
372
};
+2
home/core/default.nix
+2
home/core/default.nix
+156
home/darwin/aerospace/config.toml
+156
home/darwin/aerospace/config.toml
···
···
1
+
# You can use it to add commands that run after login to macOS user session.
2
+
# 'start-at-login' needs to be 'true' for 'after-login-command' to work
3
+
# Available commands: https://nikitabobko.github.io/AeroSpace/commands
4
+
after-login-command = []
5
+
6
+
# You can use it to add commands that run after AeroSpace startup.
7
+
# 'after-startup-command' is run after 'after-login-command'
8
+
# Available commands : https://nikitabobko.github.io/AeroSpace/commands
9
+
after-startup-command = []
10
+
11
+
# Start AeroSpace at login
12
+
start-at-login = true
13
+
14
+
# Normalizations. See: https://nikitabobko.github.io/AeroSpace/guide#normalization
15
+
enable-normalization-flatten-containers = true
16
+
enable-normalization-opposite-orientation-for-nested-containers = true
17
+
18
+
# See: https://nikitabobko.github.io/AeroSpace/guide#layouts
19
+
# The 'accordion-padding' specifies the size of accordion padding
20
+
# You can set 0 to disable the padding feature
21
+
accordion-padding = 10
22
+
23
+
# Possible values: tiles|accordion
24
+
default-root-container-layout = 'tiles'
25
+
26
+
# Possible values: horizontal|vertical|auto
27
+
# 'auto' means: wide monitor (anything wider than high) gets horizontal orientation,
28
+
# tall monitor (anything higher than wide) gets vertical orientation
29
+
default-root-container-orientation = 'auto'
30
+
31
+
# Mouse follows focus when focused monitor changes
32
+
# Drop it from your config, if you don't like this behavior
33
+
# See https://nikitabobko.github.io/AeroSpace/guide#on-focus-changed-callbacks
34
+
# See https://nikitabobko.github.io/AeroSpace/commands#move-mouse
35
+
# Fallback value (if you omit the key): on-focused-monitor-changed = []
36
+
on-focused-monitor-changed = ['move-mouse monitor-lazy-center']
37
+
38
+
# You can effectively turn off macOS "Hide application" (cmd-h) feature by toggling this flag
39
+
# Useful if you don't use this macOS feature, but accidentally hit cmd-h or cmd-alt-h key
40
+
# Also see: https://nikitabobko.github.io/AeroSpace/goodies#disable-hide-app
41
+
automatically-unhide-macos-hidden-apps = true
42
+
43
+
# Possible values: (qwerty|dvorak)
44
+
# See https://nikitabobko.github.io/AeroSpace/guide#key-mapping
45
+
[key-mapping]
46
+
preset = 'dvorak'
47
+
48
+
# Gaps between windows (inner-*) and between monitor edges (outer-*).
49
+
# Possible values:
50
+
# - Constant: gaps.outer.top = 8
51
+
# - Per monitor: gaps.outer.top = [{ monitor.main = 16 }, { monitor."some-pattern" = 32 }, 24]
52
+
# In this example, 24 is a default value when there is no match.
53
+
# Monitor pattern is the same as for 'workspace-to-monitor-force-assignment'.
54
+
# See: https://nikitabobko.github.io/AeroSpace/guide#assign-workspaces-to-monitors
55
+
[gaps]
56
+
inner.horizontal = 0
57
+
inner.vertical = 0
58
+
outer.left = 0
59
+
outer.bottom = 0
60
+
outer.top = 0
61
+
outer.right = 0
62
+
63
+
# 'main' binding mode declaration
64
+
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
65
+
# 'main' binding mode must be always presented
66
+
# Fallback value (if you omit the key): mode.main.binding = {}
67
+
[mode.main.binding]
68
+
69
+
# All possible keys:
70
+
# - Letters. a, b, c, ..., z
71
+
# - Numbers. 0, 1, 2, ..., 9
72
+
# - Keypad numbers. keypad0, keypad1, keypad2, ..., keypad9
73
+
# - F-keys. f1, f2, ..., f20
74
+
# - Special keys. minus, equal, period, comma, slash, backslash, quote, semicolon, backtick,
75
+
# leftSquareBracket, rightSquareBracket, space, enter, esc, backspace, tab
76
+
# - Keypad special. keypadClear, keypadDecimalMark, keypadDivide, keypadEnter, keypadEqual,
77
+
# keypadMinus, keypadMultiply, keypadPlus
78
+
# - Arrows. left, down, up, right
79
+
80
+
# All possible modifiers: cmd, alt, ctrl, shift
81
+
82
+
# All possible commands: https://nikitabobko.github.io/AeroSpace/commands
83
+
84
+
# See: https://nikitabobko.github.io/AeroSpace/commands#exec-and-forget
85
+
# You can uncomment the following lines to open up terminal with alt + enter shortcut (like in i3)
86
+
alt-enter = 'exec-and-forget open -n /System/Applications/Utilities/Kitty.app'
87
+
88
+
# See: https://nikitabobko.github.io/AeroSpace/commands#layout
89
+
alt-slash = 'layout tiles horizontal vertical'
90
+
alt-comma = 'layout accordion horizontal vertical'
91
+
92
+
# See: https://nikitabobko.github.io/AeroSpace/commands#focus
93
+
alt-h = 'focus left'
94
+
alt-j = 'focus down'
95
+
alt-k = 'focus up'
96
+
alt-l = 'focus right'
97
+
98
+
# See: https://nikitabobko.github.io/AeroSpace/commands#move
99
+
alt-shift-h = 'move left'
100
+
alt-shift-j = 'move down'
101
+
alt-shift-k = 'move up'
102
+
alt-shift-l = 'move right'
103
+
104
+
# See: https://nikitabobko.github.io/AeroSpace/commands#resize
105
+
alt-shift-minus = 'resize smart -50'
106
+
alt-shift-equal = 'resize smart +50'
107
+
108
+
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace
109
+
alt-1 = 'workspace 1'
110
+
alt-2 = 'workspace 2'
111
+
alt-3 = 'workspace 3'
112
+
alt-4 = 'workspace 4'
113
+
alt-5 = 'workspace 5'
114
+
alt-6 = 'workspace 6'
115
+
alt-7 = 'workspace 7'
116
+
alt-8 = 'workspace 8'
117
+
alt-9 = 'workspace 9'
118
+
119
+
# See: https://nikitabobko.github.io/AeroSpace/commands#move-node-to-workspace
120
+
alt-shift-1 = 'move-node-to-workspace 1'
121
+
alt-shift-2 = 'move-node-to-workspace 2'
122
+
alt-shift-3 = 'move-node-to-workspace 3'
123
+
alt-shift-4 = 'move-node-to-workspace 4'
124
+
alt-shift-5 = 'move-node-to-workspace 5'
125
+
alt-shift-6 = 'move-node-to-workspace 6'
126
+
alt-shift-7 = 'move-node-to-workspace 7'
127
+
alt-shift-8 = 'move-node-to-workspace 8'
128
+
alt-shift-9 = 'move-node-to-workspace 9'
129
+
130
+
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth
131
+
alt-tab = 'workspace-back-and-forth'
132
+
# See: https://nikitabobko.github.io/AeroSpace/commands#move-workspace-to-monitor
133
+
alt-shift-tab = 'move-workspace-to-monitor --wrap-around next'
134
+
135
+
# See: https://nikitabobko.github.io/AeroSpace/commands#mode
136
+
alt-shift-semicolon = 'mode service'
137
+
138
+
# 'service' binding mode declaration.
139
+
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
140
+
[mode.service.binding]
141
+
esc = ['reload-config', 'mode main']
142
+
r = ['flatten-workspace-tree', 'mode main'] # reset layout
143
+
f = ['layout floating tiling', 'mode main'] # Toggle between floating and tiling layout
144
+
backspace = ['close-all-windows-but-current', 'mode main']
145
+
146
+
# sticky is not yet supported https://github.com/nikitabobko/AeroSpace/issues/2
147
+
#s = ['layout sticky tiling', 'mode main']
148
+
149
+
alt-shift-h = ['join-with left', 'mode main']
150
+
alt-shift-j = ['join-with down', 'mode main']
151
+
alt-shift-k = ['join-with up', 'mode main']
152
+
alt-shift-l = ['join-with right', 'mode main']
153
+
154
+
down = 'volume down'
155
+
up = 'volume up'
156
+
shift-down = ['volume set 0', 'mode main']
+34
home/darwin/default.nix
+34
home/darwin/default.nix
···
···
1
+
{ self, pkgs, ... }:
2
+
{
3
+
imports = [
4
+
../profiles/nvim
5
+
../profiles/cli
6
+
../profiles/direnv
7
+
../profiles/git
8
+
../profiles/task
9
+
../profiles/kitty
10
+
# ../profiles/firefox
11
+
];
12
+
13
+
home.username = "anishlakhwara";
14
+
home.homeDirectory = "/Users/anishlakhwara";
15
+
home.stateVersion = "22.05";
16
+
17
+
programs.zsh.initContent = ''
18
+
PATH=/Users/anishlakhwara/.sourcegraph/bin:/Users/anishlakhwara/.sourcegraph/sg.zsh_autocomplete:/Users/anishlakhwara/google-cloud-sdk/bin:/Users/anishlakhwara/google-cloud-sdk/completion.zsh.inc:/Users/anishlakhwara/google-cloud-sdk/path.zsh.inc:/Users/anishlakhwara/.sg:/opt/homebrew/bin:$PATH
19
+
'';
20
+
21
+
# Managing sketchybar plugins from home-manager
22
+
home.file = {
23
+
".config/sketchybar" = {
24
+
source = ./sketchybar;
25
+
recursive = true;
26
+
};
27
+
".config/aerospace" = {
28
+
source = ./aerospace;
29
+
};
30
+
".tmux.conf" = {
31
+
source = ./tmux/tmuxrc;
32
+
};
33
+
};
34
+
}
+20
home/darwin/sketchybar/items/battery.sh
+20
home/darwin/sketchybar/items/battery.sh
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
COLOR="$CYAN"
4
+
5
+
sketchybar --add item battery right \
6
+
--set battery \
7
+
update_freq=60 \
8
+
icon.color="$COLOR" \
9
+
icon.padding_left=10 \
10
+
label.padding_right=10 \
11
+
label.color="$COLOR" \
12
+
background.height=26 \
13
+
background.corner_radius="$CORNER_RADIUS" \
14
+
background.padding_right=5 \
15
+
background.border_width="$BORDER_WIDTH" \
16
+
background.border_color="$COLOR" \
17
+
background.color="$BAR_COLOR" \
18
+
background.drawing=on \
19
+
script="$PLUGIN_DIR/power.sh" \
20
+
--subscribe battery power_source_change
+18
home/darwin/sketchybar/items/calendar.sh
+18
home/darwin/sketchybar/items/calendar.sh
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
COLOR="$BLUE"
4
+
5
+
sketchybar --add item calendar right \
6
+
--set calendar update_freq=15 \
7
+
icon.color="$COLOR" \
8
+
icon.padding_left=10 \
9
+
label.color="$COLOR" \
10
+
label.padding_right=10 \
11
+
background.height=26 \
12
+
background.corner_radius="$CORNER_RADIUS" \
13
+
background.padding_right=5 \
14
+
background.border_width="$BORDER_WIDTH" \
15
+
background.border_color="$COLOR" \
16
+
background.color="$BAR_COLOR" \
17
+
background.drawing=on \
18
+
script="$PLUGIN_DIR/calendar.sh"
+21
home/darwin/sketchybar/items/clock.sh
+21
home/darwin/sketchybar/items/clock.sh
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
COLOR="$MAGENTA"
4
+
5
+
sketchybar --add item clock right \
6
+
--set clock update_freq=60 \
7
+
icon.padding_left=10 \
8
+
icon.color="$COLOR" \
9
+
icon="๏ " \
10
+
label.color="$COLOR" \
11
+
label.padding_right=5 \
12
+
label.width=43 \
13
+
align=center \
14
+
background.height=26 \
15
+
background.corner_radius="$CORNER_RADIUS" \
16
+
background.padding_right=2 \
17
+
background.border_width="$BORDER_WIDTH" \
18
+
background.border_color="$COLOR" \
19
+
background.color="$BAR_COLOR" \
20
+
background.drawing=on \
21
+
script="$PLUGIN_DIR/clock.sh"
+19
home/darwin/sketchybar/items/cpu.sh
+19
home/darwin/sketchybar/items/cpu.sh
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
COLOR="$YELLOW"
4
+
5
+
sketchybar --add item cpu right \
6
+
--set cpu \
7
+
update_freq=3 \
8
+
icon.color="$COLOR" \
9
+
icon.padding_left=10 \
10
+
label.color="$COLOR" \
11
+
label.padding_right=10 \
12
+
background.height=26 \
13
+
background.corner_radius="$CORNER_RADIUS" \
14
+
background.padding_right=5 \
15
+
background.border_width="$BORDER_WIDTH" \
16
+
background.border_color="$COLOR" \
17
+
background.color="$BAR_COLOR" \
18
+
background.drawing=on \
19
+
script="$PLUGIN_DIR/cpu.sh"
+20
home/darwin/sketchybar/items/front_app.sh
+20
home/darwin/sketchybar/items/front_app.sh
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
COLOR="$WHITE"
4
+
5
+
sketchybar \
6
+
--add item front_app left \
7
+
--set front_app script="$PLUGIN_DIR/front_app.sh" \
8
+
icon.drawing=off \
9
+
background.height=26 \
10
+
background.padding_left=0 \
11
+
background.padding_right=10 \
12
+
background.border_width="$BORDER_WIDTH" \
13
+
background.border_color="$COLOR" \
14
+
background.corner_radius="$CORNER_RADIUS" \
15
+
background.color="$BAR_COLOR" \
16
+
label.color="$COLOR" \
17
+
label.padding_left=10 \
18
+
label.padding_right=10 \
19
+
associated_display=active \
20
+
--subscribe front_app front_app_switched
+44
home/darwin/sketchybar/items/spaces.sh
+44
home/darwin/sketchybar/items/spaces.sh
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9" "10")
4
+
5
+
sketchybar --add item spacer.1 left \
6
+
--set spacer.1 background.drawing=off \
7
+
label.drawing=off \
8
+
icon.drawing=off \
9
+
width=10
10
+
11
+
for i in {0..9}; do
12
+
sid=$((i + 1))
13
+
sketchybar --add space space.$sid left \
14
+
--set space.$sid associated_space=$sid \
15
+
label.drawing=off \
16
+
icon.padding_left=10 \
17
+
icon.padding_right=10 \
18
+
background.padding_left=-5 \
19
+
background.padding_right=-5 \
20
+
script="$PLUGIN_DIR/space.sh"
21
+
done
22
+
23
+
sketchybar --add item spacer.2 left \
24
+
--set spacer.2 background.drawing=off \
25
+
label.drawing=off \
26
+
icon.drawing=off \
27
+
width=5
28
+
29
+
sketchybar --add bracket spaces '/space.*/' \
30
+
--set spaces background.border_width="$BORDER_WIDTH" \
31
+
background.border_color="$RED" \
32
+
background.corner_radius="$CORNER_RADIUS" \
33
+
background.color="$BAR_COLOR" \
34
+
background.height=26 \
35
+
background.drawing=on
36
+
37
+
sketchybar --add item separator left \
38
+
--set separator icon=๏ \
39
+
icon.font="$FONT:Regular:16.0" \
40
+
background.padding_left=26 \
41
+
background.padding_right=15 \
42
+
label.drawing=off \
43
+
associated_display=active \
44
+
icon.color="$YELLOW"
+23
home/darwin/sketchybar/items/spotify.sh
+23
home/darwin/sketchybar/items/spotify.sh
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
COLOR="$ORANGE"
4
+
5
+
sketchybar --add item spotify q \
6
+
--set spotify \
7
+
scroll_texts=on \
8
+
icon=๓ฐ \
9
+
icon.color="$COLOR" \
10
+
icon.padding_left=10 \
11
+
background.color="$BAR_COLOR" \
12
+
background.height=26 \
13
+
background.corner_radius="$CORNER_RADIUS" \
14
+
background.border_width="$BORDER_WIDTH" \
15
+
background.border_color="$COLOR" \
16
+
background.padding_right=-5 \
17
+
background.drawing=on \
18
+
label.padding_right=10 \
19
+
label.max_chars=20 \
20
+
associated_display=active \
21
+
updates=on \
22
+
script="$PLUGIN_DIR/spotify.sh" \
23
+
--subscribe spotify media_change
+20
home/darwin/sketchybar/items/volume.sh
+20
home/darwin/sketchybar/items/volume.sh
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
COLOR="$GREEN"
4
+
5
+
sketchybar \
6
+
--add item sound right \
7
+
--set sound \
8
+
icon.color="$COLOR" \
9
+
icon.padding_left=10 \
10
+
label.color="$COLOR" \
11
+
label.padding_right=10 \
12
+
background.height=26 \
13
+
background.corner_radius="$CORNER_RADIUS" \
14
+
background.padding_right=5 \
15
+
background.border_width="$BORDER_WIDTH" \
16
+
background.border_color="$COLOR" \
17
+
background.color="$BAR_COLOR" \
18
+
background.drawing=on \
19
+
script="$PLUGIN_DIR/sound.sh" \
20
+
--subscribe sound volume_change
+4
home/darwin/sketchybar/items/vpn.sh
+4
home/darwin/sketchybar/items/vpn.sh
+3
home/darwin/sketchybar/plugins/calendar.sh
+3
home/darwin/sketchybar/plugins/calendar.sh
+4
home/darwin/sketchybar/plugins/clock.sh
+4
home/darwin/sketchybar/plugins/clock.sh
+3
home/darwin/sketchybar/plugins/cpu.sh
+3
home/darwin/sketchybar/plugins/cpu.sh
+7
home/darwin/sketchybar/plugins/front_app.sh
+7
home/darwin/sketchybar/plugins/front_app.sh
+30
home/darwin/sketchybar/plugins/power.sh
+30
home/darwin/sketchybar/plugins/power.sh
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)
4
+
CHARGING=$(pmset -g batt | grep 'AC Power')
5
+
6
+
if [ "$PERCENTAGE" = "" ]; then
7
+
exit 0
8
+
fi
9
+
10
+
case ${PERCENTAGE} in
11
+
9[0-9] | 100)
12
+
ICON="๏ "
13
+
;;
14
+
[6-8][0-9])
15
+
ICON="๏ "
16
+
;;
17
+
[3-5][0-9])
18
+
ICON="๏ "
19
+
;;
20
+
[1-2][0-9])
21
+
ICON="๏ "
22
+
;;
23
+
*) ICON="๏ " ;;
24
+
esac
25
+
26
+
if [ "$CHARGING" != "" ]; then
27
+
ICON="๏ง"
28
+
fi
29
+
30
+
sketchybar --set "$NAME" icon="$ICON" label="${PERCENTAGE}% "
+20
home/darwin/sketchybar/plugins/sound.sh
+20
home/darwin/sketchybar/plugins/sound.sh
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
VOLUME=$(osascript -e "output volume of (get volume settings)")
4
+
MUTED=$(osascript -e "output muted of (get volume settings)")
5
+
6
+
if [ "$MUTED" != "false" ]; then
7
+
ICON="๓ฐ "
8
+
VOLUME=0
9
+
else
10
+
case ${VOLUME} in
11
+
100) ICON="๏จ " ;;
12
+
[5-9]*) ICON="๏จ " ;;
13
+
[0-9]*) ICON="๏ง " ;;
14
+
*) ICON="๏ง " ;;
15
+
esac
16
+
fi
17
+
18
+
sketchybar -m \
19
+
--set "$NAME" icon=$ICON \
20
+
--set "$NAME" label="$VOLUME%"
+19
home/darwin/sketchybar/plugins/space.sh
+19
home/darwin/sketchybar/plugins/space.sh
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
source "$HOME/.config/sketchybar/variables.sh" # Loads all defined colors
4
+
5
+
SPACE_ICONS=("๏ฉ " "๏ " "๓ฐบป " "๏ " "๎ " "6" "7" "8" "9" "10")
6
+
7
+
SPACE_CLICK_SCRIPT="yabai -m space --focus $SID 2>/dev/null"
8
+
9
+
if [ "$SELECTED" = "true" ]; then
10
+
sketchybar --animate tanh 5 --set "$NAME" \
11
+
icon.color="$RED" \
12
+
icon="${SPACE_ICONS[$SID - 1]}" \
13
+
click_script="$SPACE_CLICK_SCRIPT"
14
+
else
15
+
sketchybar --animate tanh 5 --set "$NAME" \
16
+
icon.color="$COMMENT" \
17
+
icon="${SPACE_ICONS[$SID - 1]}" \
18
+
click_script="$SPACE_CLICK_SCRIPT"
19
+
fi
+11
home/darwin/sketchybar/plugins/spotify.sh
+11
home/darwin/sketchybar/plugins/spotify.sh
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
STATE="$(echo "$INFO" | jq -r '.state')"
4
+
APP="$(echo "$INFO" | jq -r '.app')"
5
+
6
+
if [ "$STATE" = "playing" ] && [ "$APP" == "Spotify" ]; then
7
+
MEDIA="$(echo "$INFO" | jq -r '.title + " - " + .artist')"
8
+
sketchybar --set "$NAME" label="$MEDIA" drawing=on
9
+
else
10
+
sketchybar --set "$NAME" drawing=off
11
+
fi
+16
home/darwin/sketchybar/plugins/vpn.sh
+16
home/darwin/sketchybar/plugins/vpn.sh
···
···
1
+
#!/bin/bash
2
+
3
+
### You need to edit sudoers file to run wg-quick without password
4
+
5
+
# %admin ALL = (ALL) NOPASSWD: /nix/store/s2qw0sxax8pckbzmyw6wrarahmx65bq9-wireguard-tools-1.0.20210914/bin/wg-quick
6
+
7
+
WG_PIDFILE="/var/run/wireguard/wg0.name"
8
+
9
+
if [ -f $WG_PIDFILE ]; then
10
+
sketchybar -m --set vpn icon=๏ \
11
+
label="$VPN" \
12
+
drawing=on \
13
+
click_script="~/.config/sketchybar/plugins/wg_off.sh"
14
+
else
15
+
sketchybar -m --set vpn drawing=off click_script="~/.config/sketchybar/plugins/wg_on.sh"
16
+
fi
+5
home/darwin/sketchybar/plugins/wg_off.sh
+5
home/darwin/sketchybar/plugins/wg_off.sh
+5
home/darwin/sketchybar/plugins/wg_on.sh
+5
home/darwin/sketchybar/plugins/wg_on.sh
+50
home/darwin/sketchybar/variables.sh
+50
home/darwin/sketchybar/variables.sh
···
···
1
+
#!/usr/bin/env sh
2
+
3
+
# Color Palette
4
+
# Tokyonight Night
5
+
BLACK=0xff24283b
6
+
WHITE=0xffa9b1d6
7
+
MAGENTA=0xffbb9af7
8
+
BLUE=0xff7aa2f7
9
+
CYAN=0xff7dcfff
10
+
GREEN=0xff9ece6a
11
+
YELLOW=0xffe0af68
12
+
ORANGE=0xffff9e64
13
+
RED=0xfff7768e
14
+
BAR_COLOR=0xff1a1b26
15
+
COMMENT=0xff565f89
16
+
17
+
# Tokyonight Day
18
+
# BLACK=0xffe9e9ed
19
+
# WHITE=0xff3760bf
20
+
# MAGENTA=0xff9854f1
21
+
# BLUE=0xff2e7de9
22
+
# CYAN=0xff007197
23
+
# GREEN=0xff587539
24
+
# YELLOW=0xff8c6c3e
25
+
# ORANGE=0xffb15c00
26
+
# RED=0xfff52a65
27
+
# BAR_COLOR=0xffe1e2e7
28
+
29
+
TRANSPARENT=0x00000000
30
+
31
+
# General bar colors
32
+
ICON_COLOR=$WHITE # Color of all icons
33
+
LABEL_COLOR=$WHITE # Color of all labels
34
+
35
+
ITEM_DIR="$HOME/.config/sketchybar/items"
36
+
PLUGIN_DIR="$HOME/.config/sketchybar/plugins"
37
+
38
+
FONT="Iosevka Nerd Font"
39
+
40
+
PADDINGS=3
41
+
42
+
POPUP_BORDER_WIDTH=2
43
+
POPUP_CORNER_RADIUS=11
44
+
POPUP_BACKGROUND_COLOR=$BLACK
45
+
POPUP_BORDER_COLOR=$COMMENT
46
+
47
+
CORNER_RADIUS=15
48
+
BORDER_WIDTH=2
49
+
50
+
SHADOW=on
+63
home/darwin/tmux/tmuxrc
+63
home/darwin/tmux/tmuxrc
···
···
1
+
set -g base-index 1
2
+
setw -g pane-base-index 1
3
+
4
+
# https://old.reddit.com/r/tmux/comments/mesrci/tmux_2_doesnt_seem_to_use_256_colors/
5
+
set -g default-terminal "xterm-256color"
6
+
set -ga terminal-overrides ",*256col*:Tc"
7
+
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
8
+
set-environment -g COLORTERM "truecolor"
9
+
10
+
# Mouse works as expected
11
+
set-option -g mouse on
12
+
# easy-to-remember split pane commands
13
+
bind | split-window -h -c "#{pane_current_path}"
14
+
bind - split-window -v -c "#{pane_current_path}"
15
+
16
+
# move between tabs using vim commands
17
+
bind-key -n C-h previous-window
18
+
bind-key -n C-l next-window
19
+
20
+
# hide and restore panes
21
+
bind-key ! break-pane -d -n _hidden_pane
22
+
bind-key @ join-pane -s $.0
23
+
24
+
# don't rename windows automatically
25
+
set-option -g allow-rename off
26
+
27
+
# DESIGN TWEAKS
28
+
29
+
# don't do anything when a 'bell' rings
30
+
set -g visual-activity off
31
+
set -g visual-bell off
32
+
set -g visual-silence off
33
+
setw -g monitor-activity off
34
+
set -g bell-action none
35
+
36
+
# copy mode
37
+
setw -g mode-style 'fg=black bg=blue bold'
38
+
39
+
# panes
40
+
set -g pane-border-style 'fg=blue'
41
+
set -g pane-active-border-style 'fg=black'
42
+
43
+
# statusbar
44
+
set -g status-position bottom
45
+
set -g status-justify left
46
+
set -g status-style 'fg=blue'
47
+
48
+
set -g status-left ''
49
+
set -g status-left-length 10
50
+
51
+
set -g status-right-style 'fg=black bg=blue'
52
+
set -g status-right ''
53
+
54
+
setw -g window-status-current-style 'fg=black bg=blue'
55
+
setw -g window-status-current-format ' #I #W #F '
56
+
57
+
setw -g window-status-style 'fg=blue bg=black'
58
+
setw -g window-status-format ' #I #[fg=white]#W #[fg=yellow]#F '
59
+
60
+
setw -g window-status-bell-style 'fg=black bg=blue bold'
61
+
62
+
# messages
63
+
set -g message-style 'fg=black bg=blue bold'
+1
-2
home/gui/default.nix
+1
-2
home/gui/default.nix
+35
-27
home/profiles/cli/default.nix
+35
-27
home/profiles/cli/default.nix
···
1
{ lib, pkgs, config, ... }:
2
{
3
home.packages = with pkgs; [
4
binutils
5
-
coreutils
6
dnsutils
7
dasht
8
dosfstools
9
-
#git
10
git-machete
11
bottom
12
gptfdisk
13
starship
14
-
iputils
15
-
jq
16
manix
17
moreutils
18
nix-index
19
-
cached-nix-shell
20
nmap
21
ripgrep
22
skim
23
tealdeer
24
-
usbutils
25
-
utillinux
26
-
whois
27
iftop
28
wget
29
curl
30
-
eza
31
bat
32
fd
33
-
ncdu
34
-
du-dust
35
-
# dia-cli
36
duf
37
trash-cli
38
nix-index
39
silver-searcher
40
tcpdump
41
-
mtr
42
file
43
lsof
44
atool
45
-
strace
46
zip
47
unzip
48
rsync
···
51
glow
52
pass
53
less
54
-
gdb
55
xxd
56
taskwarrior
57
gnupg
58
syncthing
59
dijo
60
-
#ssb-patchwork
61
-
fontconfig
62
pandoc
63
taskwarrior-tui
64
-
python3Packages.howdoi
65
-
vimwiki-cli
66
67
(pkgs.writeScriptBin "jq-repl" ''
68
#!/usr/bin/env bash
···
132
enableCompletion = true;
133
autosuggestion.enable = false;
134
135
-
initExtra = ''
136
autopair-init
137
'';
138
sessionVariables = {
···
204
enableZshIntegration = true;
205
};
206
207
-
services.kdeconnect.enable = true;
208
209
home.shellAliases = {
210
# quick cd
···
219
220
# modern cli tools
221
ls = "eza --icons";
222
-
l = "esa -l --icons";
223
la = "eza -la --icons";
224
tree = "ls --tree --icons";
225
cat = "bat";
···
231
make-secret = "< /dev/urandom \\tr -dc _A-Za-z0-9 | head -c \${1:-32};echo;";
232
233
# task warrior
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
239
tt = "taskwarrior-tui -r list";
240
ti = "task +idea";
241
tb = "task +backlog list";
242
ttb = "taskwarrior-tui -r backlog";
243
tr = "task newest limit:page";
244
-
twait = "task +wait";
245
ta = "task add";
246
tai = "task add +idea";
247
tn = "task-note";
···
257
258
# git
259
g = "git";
260
261
# grep
262
grep = "rg";
···
277
srch = "ns nixpkgs";
278
orch = "ns override";
279
nrb = "cd /tmp; sudo nixos-rebuild switch --flake '/home/anish/usr/helm#curve'; cd $OLDPWD";
280
nrt = "cd /tmp; sudo nixos-rebuild test --flake '/home/anish/usr/helm#curve'; cd $OLDPWD";
281
ned = "cd /home/anish/usr/helm; vim; cd $OLDPWD";
282
ncd = "cd /home/anish/usr/helm";
···
1
{ lib, pkgs, config, ... }:
2
{
3
home.packages = with pkgs; [
4
+
#unstable.claude-code
5
binutils
6
+
# coreutils
7
dnsutils
8
dasht
9
dosfstools
10
+
# git
11
git-machete
12
+
asciinema
13
bottom
14
gptfdisk
15
starship
16
+
# TODO Not available on Darwin
17
+
# iputils
18
+
# usbutils
19
+
# cached-nix-shell
20
+
# utillinux
21
+
# strace
22
+
# mtr
23
+
# gdb
24
+
# fontconfig
25
+
# whois
26
+
27
+
# jq
28
manix
29
moreutils
30
nix-index
31
nmap
32
ripgrep
33
skim
34
tealdeer
35
iftop
36
wget
37
curl
38
+
eza
39
bat
40
fd
41
+
# ncdu
42
duf
43
trash-cli
44
nix-index
45
silver-searcher
46
tcpdump
47
file
48
lsof
49
atool
50
zip
51
unzip
52
rsync
···
55
glow
56
pass
57
less
58
xxd
59
taskwarrior
60
gnupg
61
syncthing
62
dijo
63
+
# ssb-patchwork
64
pandoc
65
taskwarrior-tui
66
+
zk
67
+
diffnav
68
+
jujutsu
69
+
git-spice
70
+
71
+
# llms (needs 24.11)
72
+
aider-chat
73
74
(pkgs.writeScriptBin "jq-repl" ''
75
#!/usr/bin/env bash
···
139
enableCompletion = true;
140
autosuggestion.enable = false;
141
142
+
initContent = ''
143
+
bindkey -v
144
autopair-init
145
'';
146
sessionVariables = {
···
212
enableZshIntegration = true;
213
};
214
215
+
# Only available on Linux
216
+
# services.kdeconnect.enable = true;
217
218
home.shellAliases = {
219
# quick cd
···
228
229
# modern cli tools
230
ls = "eza --icons";
231
+
l = "eza -l --icons";
232
la = "eza -la --icons";
233
tree = "ls --tree --icons";
234
cat = "bat";
···
240
make-secret = "< /dev/urandom \\tr -dc _A-Za-z0-9 | head -c \${1:-32};echo;";
241
242
# task warrior
243
+
# TODO: make blocked a context?
244
t = "task -BLOCKED -idea -backlog";
245
tt = "taskwarrior-tui -r list";
246
ti = "task +idea";
247
tb = "task +backlog list";
248
ttb = "taskwarrior-tui -r backlog";
249
tr = "task newest limit:page";
250
+
tw = "task +wait";
251
ta = "task add";
252
tai = "task add +idea";
253
tn = "task-note";
···
263
264
# git
265
g = "git";
266
+
gl = "git log --pretty=oneline --abbrev-commit";
267
268
# grep
269
grep = "rg";
···
284
srch = "ns nixpkgs";
285
orch = "ns override";
286
nrb = "cd /tmp; sudo nixos-rebuild switch --flake '/home/anish/usr/helm#curve'; cd $OLDPWD";
287
+
nrd = "cd /tmp; NIXPKGS_ALLOW_UNFREE=1 sudo darwin-rebuild switch --flake /Users/anishlakhwara/usr/helm#Anishs-MacBook-Pro --impure; cd $OLDPWD";
288
nrt = "cd /tmp; sudo nixos-rebuild test --flake '/home/anish/usr/helm#curve'; cd $OLDPWD";
289
ned = "cd /home/anish/usr/helm; vim; cd $OLDPWD";
290
ncd = "cd /home/anish/usr/helm";
home/profiles/desktop/Xresources
home/profiles/desktop/Xresources
-23
home/profiles/desktop/ayu-dark-kitty.conf
-23
home/profiles/desktop/ayu-dark-kitty.conf
···
1
-
2
-
background #0A0E14
3
-
foreground #B3B1AD
4
-
cursor #E6B450
5
-
selection_background #273747
6
-
color0 #000000
7
-
color8 #4D5566
8
-
color1 #FF3333
9
-
color9 #D96C75
10
-
color2 #C2D94C
11
-
color10 #91B362
12
-
color3 #FF8F40
13
-
color11 #F29668
14
-
color4 #59C2FF
15
-
color12 #6994BF
16
-
color5 #D4BFFF
17
-
color13 #A37ACC
18
-
color6 #95E6CB
19
-
color14 #4CBF99
20
-
color7 #ffffff
21
-
color15 #F0F0F0
22
-
selection_foreground #B3B1AD
23
-
···
-25
home/profiles/desktop/ayu-kitty.conf
-25
home/profiles/desktop/ayu-kitty.conf
···
1
-
#: This is a port of ayu Mirage color scheme
2
-
#: based on :
3
-
#: https://github.com/ayu-theme/ayu-colors
4
-
5
-
background #1F2430
6
-
foreground #CBCCC6
7
-
cursor #FFCC66
8
-
selection_background #33415E
9
-
color0 #000000
10
-
color8 #4D5566
11
-
color1 #FF3333
12
-
color9 #F27983
13
-
color2 #BAE67E
14
-
color10 #A6CC70
15
-
color3 #FFA759
16
-
color11 #F29E74
17
-
color4 #73D0FF
18
-
color12 #77A8D9
19
-
color5 #D4BFFF
20
-
color13 #A37ACC
21
-
color6 #95E6CB
22
-
color14 #4CBF99
23
-
color7 #ffffff
24
-
color15 #F0F0F0
25
-
selection_foreground #CBCCC6
···
+4
-4
home/profiles/desktop/default.nix
+4
-4
home/profiles/desktop/default.nix
···
26
gtk-engine-murrine
27
gtk_engines
28
maim
29
-
kitty
30
libreoffice
31
inotify-tools
32
offpunk
···
66
recursive = true;
67
};
68
".config/dunst/dunstrc".source = ./dunstrc;
69
-
".config/kitty/kitty.conf".source = ./kitty.conf;
70
-
".config/kitty/ayu.conf".source = ./ayu-kitty.conf;
71
".config/zathura/zathurarc".source = ./zathurarc;
72
".background-image".source = ./background.jpg;
73
#gtk4 theme
···
102
".local/bin/mpv-ify".source = ./bin/mpv-ify;
103
".local/bin/bspswallow".source = ./bin/bspswallow;
104
".config/bspwm/terminals".text = "Kitty";
105
# ".local/bin/hotplug-monitor.sh".source = ./bin/hotplug-monitor.sh;
106
};
107
···
123
124
qt = {
125
enable = true;
126
-
platformTheme.name = "gtk";
127
style = { name = "qt5ct-style"; };
128
};
129
···
26
gtk-engine-murrine
27
gtk_engines
28
maim
29
libreoffice
30
inotify-tools
31
offpunk
···
65
recursive = true;
66
};
67
".config/dunst/dunstrc".source = ./dunstrc;
68
".config/zathura/zathurarc".source = ./zathurarc;
69
".background-image".source = ./background.jpg;
70
#gtk4 theme
···
99
".local/bin/mpv-ify".source = ./bin/mpv-ify;
100
".local/bin/bspswallow".source = ./bin/bspswallow;
101
".config/bspwm/terminals".text = "Kitty";
102
+
".config/eww/eww.yuck".source = ./eww/eww.yuck;
103
+
".config/eww/eww.scss".source = ./eww/eww.scss;
104
+
".config/eww/widgets.yuck".source = ./eww/widgets.yuck;
105
# ".local/bin/hotplug-monitor.sh".source = ./bin/hotplug-monitor.sh;
106
};
107
···
123
124
qt = {
125
enable = true;
126
+
platformTheme = "gtk";
127
style = { name = "qt5ct-style"; };
128
};
129
-13
home/profiles/desktop/kitty.conf
-13
home/profiles/desktop/kitty.conf
···
1
-
include ayu.conf
2
-
font_family Hermit
3
-
font_size 13
4
-
bold_font auto
5
-
italic_font auto
6
-
bold_italic_font auto
7
-
open_url_with default
8
-
mouse_map left click ungrabbed mouse_click_url_or_select
9
-
confirm_os_window_close 0
10
-
enable_audio_bell no
11
-
-- Allows zen-mode.nvim to increase font size
12
-
-- allow_remote_control socket-only
13
-
-- listen_on unix:/tmp/kitty
···
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
+1
-1
home/profiles/firefox/default.nix
+1
-1
home/profiles/firefox/default.nix
+7
home/profiles/git/config
+7
home/profiles/git/config
···
15
default = current
16
[pull]
17
rebase = true
18
[alias]
19
unadd = reset HEAD
20
# data analysis
···
23
email-domains = !git log --format="%aE" | awk -F'@' '{print $2}' | sort -u
24
# pretty log
25
ls = !git log --graph --abbrev-commit --decorate --color=always --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) - %C(dim red)%an%C(reset)%C(bold yellow)%d%C(reset)' --all
26
[filter "lfs"]
27
required = true
28
smudge = git-lfs smudge -- %f
29
process = git-lfs filter-process
30
clean = git-lfs clean -- %f
31
[url "https://github.com/"]
32
insteadOf = gh:
33
[url "git@github.com:"]
···
15
default = current
16
[pull]
17
rebase = true
18
+
[merge]
19
+
mergetool = nvim -d
20
+
conflictstyle = diff3
21
[alias]
22
unadd = reset HEAD
23
# data analysis
···
26
email-domains = !git log --format="%aE" | awk -F'@' '{print $2}' | sort -u
27
# pretty log
28
ls = !git log --graph --abbrev-commit --decorate --color=always --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) - %C(dim red)%an%C(reset)%C(bold yellow)%d%C(reset)' --all
29
+
undo = !git reset HEAD~1 --mixed
30
+
blm = blame -w -C -C -C
31
[filter "lfs"]
32
required = true
33
smudge = git-lfs smudge -- %f
34
process = git-lfs filter-process
35
clean = git-lfs clean -- %f
36
+
[url "git@github.com:"]
37
+
insteadOf = https://github.com/
38
[url "https://github.com/"]
39
insteadOf = gh:
40
[url "git@github.com:"]
+7
-1
home/profiles/git/default.nix
+7
-1
home/profiles/git/default.nix
···
12
userName = "Anish Lakhwara";
13
userEmail = "anish+git@lakhwara.com";
14
delta.enable = true;
15
-
# TODO enable signing
16
17
ignores = [
18
"*~"
···
56
pull.rebase = false;
57
push.autoSetupRemote = true;
58
init.defaultBranch = "main";
59
};
60
61
aliases = {
···
94
95
# delete merged branches
96
bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d";
97
};
98
};
99
}
···
12
userName = "Anish Lakhwara";
13
userEmail = "anish+git@lakhwara.com";
14
delta.enable = true;
15
+
signing = {
16
+
signByDefault = true;
17
+
key = "7FC5DF072EF7B716";
18
+
};
19
20
ignores = [
21
"*~"
···
59
pull.rebase = false;
60
push.autoSetupRemote = true;
61
init.defaultBranch = "main";
62
+
"url \"git@github.com:\"" = { insteadOf = "https://github.com/"; };
63
};
64
65
aliases = {
···
98
99
# delete merged branches
100
bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d";
101
+
undo = "!git reset HEAD~1 --mixed";
102
+
blm = "blame -w -C -C -C";
103
};
104
};
105
}
+23
home/profiles/kitty/ayu-dark-kitty.conf
+23
home/profiles/kitty/ayu-dark-kitty.conf
···
···
1
+
2
+
background #0A0E14
3
+
foreground #B3B1AD
4
+
cursor #E6B450
5
+
selection_background #273747
6
+
color0 #000000
7
+
color8 #4D5566
8
+
color1 #FF3333
9
+
color9 #D96C75
10
+
color2 #C2D94C
11
+
color10 #91B362
12
+
color3 #FF8F40
13
+
color11 #F29668
14
+
color4 #59C2FF
15
+
color12 #6994BF
16
+
color5 #D4BFFF
17
+
color13 #A37ACC
18
+
color6 #95E6CB
19
+
color14 #4CBF99
20
+
color7 #ffffff
21
+
color15 #F0F0F0
22
+
selection_foreground #B3B1AD
23
+
+25
home/profiles/kitty/ayu-kitty.conf
+25
home/profiles/kitty/ayu-kitty.conf
···
···
1
+
#: This is a port of ayu Mirage color scheme
2
+
#: based on :
3
+
#: https://github.com/ayu-theme/ayu-colors
4
+
5
+
background #1F2430
6
+
foreground #CBCCC6
7
+
cursor #FFCC66
8
+
selection_background #33415E
9
+
color0 #000000
10
+
color8 #4D5566
11
+
color1 #FF3333
12
+
color9 #F27983
13
+
color2 #BAE67E
14
+
color10 #A6CC70
15
+
color3 #FFA759
16
+
color11 #F29E74
17
+
color4 #73D0FF
18
+
color12 #77A8D9
19
+
color5 #D4BFFF
20
+
color13 #A37ACC
21
+
color6 #95E6CB
22
+
color14 #4CBF99
23
+
color7 #ffffff
24
+
color15 #F0F0F0
25
+
selection_foreground #CBCCC6
+11
home/profiles/kitty/default.nix
+11
home/profiles/kitty/default.nix
+14
home/profiles/kitty/kitty.conf
+14
home/profiles/kitty/kitty.conf
···
···
1
+
include ayu.conf
2
+
font_family Hermit
3
+
font_size 13
4
+
bold_font auto
5
+
italic_font auto
6
+
bold_italic_font auto
7
+
open_url_with default
8
+
mouse_map left click ungrabbed mouse_click_url_or_select
9
+
confirm_os_window_close 0
10
+
enable_audio_bell no
11
+
hide_window_decorations titlebar-only
12
+
-- Allows zen-mode.nvim to increase font size
13
+
-- allow_remote_control socket-only
14
+
-- listen_on unix:/tmp/kitty
-4
home/profiles/nvim/config/after/syntax/vimwiki.vim
-4
home/profiles/nvim/config/after/syntax/vimwiki.vim
-11
home/profiles/nvim/config/fnl/conf/formatting.fnl
-11
home/profiles/nvim/config/fnl/conf/formatting.fnl
···
1
-
(import-macros {: do-req } :lib/macros)
2
-
3
-
(do-req :conform :setup
4
-
{:formatters_by_ft {:lua ["stylua"]
5
-
:nix ["nixfmt"]
6
-
; :go ["goimports" "gofmt"] ; Go handled in special case
7
-
:terraform ["terraform_fmt"]
8
-
:sh ["shfmt"]
9
-
:bazel ["buildifier"]}
10
-
:format_on_save {:lsp_format "fallback"
11
-
:timeout_ms 500}})
···
-47
home/profiles/nvim/config/fnl/conf/init.fnl
-47
home/profiles/nvim/config/fnl/conf/init.fnl
···
1
-
(local nvim (require :lib/nvim))
2
-
3
-
(nvim.g :mapleader " ")
4
-
5
-
; (nvim.opt :runtimepath (.. vim.opt.runtimepath "/home/anish/.config/nvim/,"))
6
-
(nvim.opt :tabstop 2)
7
-
(nvim.opt :showmatch true)
8
-
(nvim.opt :shiftwidth 2)
9
-
(nvim.opt :autoindent true)
10
-
(nvim.opt :undofile true)
11
-
(nvim.opt :signcolumn "auto:4")
12
-
(nvim.opt :title true)
13
-
(nvim.opt :number true)
14
-
; (nvim.opt :nocompatible)
15
-
(nvim.opt :relativenumber true)
16
-
(nvim.opt :showtabline 2)
17
-
(nvim.opt :expandtab true)
18
-
(nvim.opt :autowriteall true)
19
-
(nvim.opt :cmdheight 2)
20
-
(nvim.opt :spelllang "en_gb")
21
-
(nvim.opt :ignorecase true)
22
-
(nvim.opt :smartcase true)
23
-
(nvim.opt :incsearch true)
24
-
(nvim.opt :updatetime 300) ; Diagnostics response time
25
-
(nvim.opt :signcolumn "yes")
26
-
(nvim.opt :cursorline true)
27
-
28
-
(nvim.opt :lisp true) ; include - in word to move better in snake-case)
29
-
(nvim.g :sexp_filetypes "clojure,scheme,lisp,janet,fennel,yuck") ; include the lisps I use
30
-
31
-
(nvim.opt :termguicolors)
32
-
(nvim.colorscheme "ayu-mirage")
33
-
34
-
(require :conf.plugins)
35
-
(require :conf.mappings)
36
-
(require :conf.lsp)
37
-
(require :conf.plugins.cmp)
38
-
(require :conf.formatting)
39
-
; (require :conf.kitaab)
40
-
41
-
; Spelling
42
-
(vim.api.nvim_create_autocmd ["BufRead" "BufNewFile"]
43
-
{:pattern ["*.wiki" "*.txt" "*.md" "*.tex"]
44
-
:command "setlocal spell"})
45
-
(vim.api.nvim_create_autocmd ["FileType"]
46
-
{:pattern ["mail"]
47
-
:command "setlocal spell"})
···
-99
home/profiles/nvim/config/fnl/conf/lsp.fnl
-99
home/profiles/nvim/config/fnl/conf/lsp.fnl
···
1
-
(import-macros {: do-req } :lib/macros)
2
-
(local lspkind (require :lspkind))
3
-
(local lspconfig (require :lspconfig))
4
-
; (local lspsaga (require :lspsaga))
5
-
(local cmp (require :cmp))
6
-
(local nvim (require :lib/nvim))
7
-
; (local lspfuzzy (require :lspfuzzy)) ; Not available on Nix
8
-
; (local sg (require :sg))
9
-
; (local lsputil (require :lspconfig/util))
10
-
11
-
;(lspsaga.setup {:border_style "rounded"
12
-
; :code_action_icon ""
13
-
; :code_action_num_shortcut false
14
-
; :ui {:code_action ""}
15
-
; :show_outline {:enable false}))
16
-
;
17
-
;(nvim.opt :winbar nil)
18
-
19
-
(local signs {:Error "๎ช "
20
-
:Warn "๏ฑ "
21
-
:Hint "๏ "
22
-
:Info "๏ "})
23
-
(each [t icon (pairs signs)]
24
-
(let [hl (.. "DiagnosticSign" t)]
25
-
(vim.fn.sign_define hl {:text icon
26
-
:texthl hl
27
-
:numhl hl})))
28
-
29
-
(tset vim.lsp.handlers
30
-
:textDocument/hover
31
-
(vim.lsp.with vim.lsp.handlers.hover
32
-
{:focusable false :border "rounded"}))
33
-
(tset vim.lsp.handlers
34
-
:textDocument/signatureHelp
35
-
(vim.lsp.with vim.lsp.handlers.signature_help
36
-
{:focusable false :border "rounded"}))
37
-
38
-
(local capabilities (let [cmp_nvim_lsp (require :cmp_nvim_lsp)]
39
-
(cmp_nvim_lsp.default_capabilities)))
40
-
41
-
(local formatting-augroup (nvim.augroup :LspFormatting))
42
-
43
-
(fn goimports [wait-ms]
44
-
(let [params (vim.lsp.util.make_range_params)
45
-
result (do
46
-
(tset params :context {:only [:source.organizeImports]})
47
-
(vim.lsp.buf_request_sync 0 :textDocument/codeAction params wait-ms))]
48
-
(each [_ res (pairs (or result {}))]
49
-
(each [_ r (pairs (or res.result {}))]
50
-
(if r.edit
51
-
(vim.lsp.util.apply_workspace_edit r.edit "utf-16")
52
-
(vim.lsp.buf.execute_command r.command))))
53
-
(vim.lsp.buf.format)))
54
-
55
-
(fn on-attach [client bufnr]
56
-
(let [filetype (vim.api.nvim_buf_get_option 0 "filetype")]
57
-
(if (client.supports_method "textDocument/formatting")
58
-
(do (nvim.autocmd "BufWritePre"
59
-
{:group formatting-augroup
60
-
:buffer bufnr
61
-
:callback (fn [_] (if (= filetype "go")
62
-
(goimports 2000)
63
-
(vim.lsp.buf.format {:bufnr bufnr})))})))))
64
-
65
-
(lspconfig.gopls.setup
66
-
{:capabilities capabilities
67
-
:codelens {:generate true :gc_details true}
68
-
:semanticTokens true
69
-
:flags {:debounce_text_changes 200}
70
-
:analyses {:unusedparams true
71
-
:unusedvariables true
72
-
:unusedwrite true
73
-
:nilness true
74
-
:unusedwrite true
75
-
:useany true}
76
-
:completeUnimported true
77
-
:staticcheck true
78
-
:experimentalPostfixCompletions true
79
-
:hints {:constantValues true
80
-
:functionTypeParameters true
81
-
:assignVariablesTypes true
82
-
:compositeLiteralTypes true
83
-
:compositeLiteralFields true
84
-
:parameterNames true
85
-
:rangeVariableTypes true}
86
-
:on_attach on-attach})
87
-
88
-
(local lsps [:nil_ls :terraform_lsp :fennel_ls :tsserver :starbin])
89
-
(each [index lsp (ipairs lsps)]
90
-
((. (. lspconfig lsp) :setup) {}))
91
-
92
-
; null-ls
93
-
(let [null-ls (require :null-ls)]
94
-
(null-ls.setup {:sources [; TODO fix these
95
-
;null-ls.builtins.diagnostics.shellcheck
96
-
null-ls.builtins.diagnostics.commitlint]}))
97
-
;null-ls.builtins.diagnostics.jsonlint]}))
98
-
;(null-ls.builtins.diagnostics.proselint.with {:filetypes ["vimwiki" "mail"]})]}))
99
-
···
-135
home/profiles/nvim/config/fnl/conf/mappings.fnl
-135
home/profiles/nvim/config/fnl/conf/mappings.fnl
···
1
-
(local nvim (require :lib/nvim))
2
-
(import-macros {: do-req } :lib/macros)
3
-
4
-
(local wk (require :which-key))
5
-
6
-
;; Convenient way to indent stuff in visual mode
7
-
(nvim.keymap [:v] "<" "<gv" {:noremap true})
8
-
(nvim.keymap [:v] ">" ">gv" {:noremap true})
9
-
(nvim.keymap [:n] "<space>" "<NOP>" {:noremap true :silent true})
10
-
;; Convenient way to move stuff in visual mode
11
-
(nvim.keymap [:v] "J" ":m '>+1<CR>gv=gv" {:noremap true})
12
-
(nvim.keymap [:v] "K" ":m '>-2<CR>gv=gv" {:noremap true})
13
-
;; Convientent screen shifting
14
-
(nvim.keymap [:n] "n" "nzzzv" {:noremap true})
15
-
(nvim.keymap [:n] "N" "Nzzzv" {:noremap true})
16
-
(nvim.keymap [:n] "J" "mzJ'z" {:noremap true})
17
-
; Fix Y
18
-
(nvim.keymap [:n] "Y" "y$")
19
-
; Unmap Q
20
-
(nvim.keymap [] "Q" "<Nop>")
21
-
22
-
; FTerm
23
-
(vim.api.nvim_create_user_command "FTermToggle" (fn [_]
24
-
((-> (require :FTerm)
25
-
(. :toggle))))
26
-
{:bang true})
27
-
(nvim.keymap [:t] "<TAB>" "<cmd>:FTermToggle<CR>")
28
-
(nvim.keymap [:n] "<TAB>" "<cmd>:FTermToggle<CR>" {:noremap true})
29
-
30
-
; Buffer Movement
31
-
(nvim.keymap [:n] "gT" ":BufferPrevious<CR>" {:silent true :noremap true})
32
-
(nvim.keymap [:n] "gt" ":BufferNext<CR>" {:silent true :noremap true})
33
-
(nvim.keymap [:n] "gj" ":BufferPick<CR>" {:silent true :noremap true})
34
-
(nvim.keymap [:n] "gb" ":Telescope buffers<CR>" {:silent true :noremap true})
35
-
(nvim.keymap [:n] "gq" ":BufferClose<CR>" {:silent true :noremap true})
36
-
37
-
; Flash
38
-
(vim.api.nvim_create_user_command "Flash" (fn [_] (do-req :flash :jump)) {})
39
-
(vim.api.nvim_create_user_command "FlashTreesitter" (fn [] (do-req :flash :treesitter)) {})
40
-
(nvim.keymap [:n] "f" "<cmd>Flash<CR>")
41
-
(nvim.keymap [:n] "s" "<cmd>FlashTreesitter<CR>")
42
-
43
-
(local
44
-
normal-map-leader
45
-
{"t" [":Neotree toggle<CR>"
46
-
"Toggle neo-tree"]
47
-
"w" ["<cmd>:w<cr>"
48
-
"Write file"]
49
-
"q" ["<cmd>:q<cr>"
50
-
"Quit"]
51
-
"r" [":RainbowParenthesesToggleAll<CR>"
52
-
"Toggle Rainbow Parens"]
53
-
"u" [":UndotreeToggle<CR>"
54
-
"Toggle Undo Tree"]
55
-
; Telescope
56
-
"f" {:name "Files"
57
-
:f ["<cmd>Telescope find_files<cr>"
58
-
"Find Files (in Telescope)"]
59
-
:g ["<cmd>Telescope live_grep<cr>"
60
-
"Find Grep (in Telescope)"]
61
-
:b ["<cmd>Telescope buffers<cr>"
62
-
"Find Buffers"]
63
-
:h ["<cmd>Telescope help_tags<cr>"
64
-
"Find Help"]
65
-
:t ["<cmd>Telescope tags<cr>"
66
-
"Find Tags"]
67
-
:r ["<cmd>Telescope oldfiles<CR>"
68
-
"Recent files"]}
69
-
; Git
70
-
"g" {:name "Git"
71
-
"s" [":G<CR>"
72
-
"Git Status"]
73
-
"f" [":G fetch --all<cr>"
74
-
"Git Fetch"]
75
-
"b" [":GBranches<cr>"
76
-
"Git Branch"]
77
-
"p" [":Git! push<cr>"
78
-
"Git Push"]
79
-
"d" [":GDiff<cr>"
80
-
"Git Diff"]
81
-
"h" [""
82
-
"Commit Hunk under Cursor"]}
83
-
; For handling merges
84
-
; nmap <leader>gl :diffget //3<CR>
85
-
; nmap <leader>gh :diffget //2<CR>
86
-
; nnoremap <leader>gc :G commit -v -q %:p<CR>
87
-
; Buffers
88
-
"b" {:name "Buffer"
89
-
:b ["<cmd>:Telescope buffers<CR>"
90
-
"Buffer List"]
91
-
:q ["<cmd>:BufferClose<CR>"
92
-
"Buffer Quit"]
93
-
:n ["<cmd>:BufferNext<CR>"
94
-
"Buffer Next"]
95
-
:N ["<cmd>:tabp<CR>"
96
-
"Buffer Previous"]
97
-
:p ["<cmd>:tabp<CR>"
98
-
"Buffer Previous"]}
99
-
; Search
100
-
"s" {:name "Search"
101
-
:b ["<cmd>Telescope current_buffer_fuzzy_find<CR>"
102
-
"Search in current buffer"]
103
-
:s ["<cmd>Telescope live_grep<CR>"
104
-
"Search in project"]
105
-
:t ["<cmd>TodoTelescope<CR>"
106
-
"Search TODOs in project"]
107
-
:c ["<cmd>let @/ = \"\"<CR>:echo 'Search highlight cleared'<CR>"
108
-
"Clear search"]}
109
-
; Code
110
-
"c" {:name "Code"
111
-
:d [":lua vim.lsp.buf.definition()<CR>"
112
-
"Go to Definition"]
113
-
:i [":lua require('telescope.builtin').lsp_implementation()<CR>"
114
-
"Implementation"]
115
-
:s [":lua vim.lsp.buf.signature_help()<CR>"
116
-
"Signature Help"]
117
-
:r [":Lspsaga rename<CR>"
118
-
"Rename Symbol"]
119
-
:h [":Lspsaga hover_doc<CR>"
120
-
"Hover doc"]
121
-
:o ["<cmd>AerialToggle!<CR>"
122
-
"Outline"]
123
-
:t [":LspDiagnostics 0"
124
-
"Find Errors in Buffer"]}
125
-
; Kitaab
126
-
"z" {:name "Kitaab"
127
-
:n [":ZettelNew<CR>"
128
-
"Zettel New"]}
129
-
"v" {:name "Tabs"
130
-
:v [":vnew<CR>"
131
-
"Vertical Split"]
132
-
:h [":new<CR>"
133
-
"Horizontal Split"]}})
134
-
135
-
(wk.register normal-map-leader {:prefix "<leader>"})
···
-30
home/profiles/nvim/config/fnl/conf/music.fnl
-30
home/profiles/nvim/config/fnl/conf/music.fnl
···
1
-
(local nvim (require :lib/nvim))
2
-
3
-
(nvim.g :tidal_target "terminal")
4
-
(nvim.g :scnvim_snippet_format "luasnip")
5
-
6
-
; -- supercollider
7
-
; local scnvim = require 'scnvim'
8
-
; local map = scnvim.map
9
-
; local map_expr = scnvim.map_expr
10
-
; scnvim.setup {
11
-
; keymaps = {
12
-
; ['<localleader>e'] = map('editor.send_line', {'i', 'n'}),
13
-
; ['<localleader>s'] = map_expr('CmdPeriod.run', {'i', 'n'}),
14
-
; ['<localleader>t'] = {
15
-
; map('editor.send_block', {'i', 'n'}),
16
-
; map('editor.send_selection', 'x'),
17
-
; },
18
-
; ['<CR>'] = map('postwin.toggle'),
19
-
; ['<M-CR>'] = map('postwin.toggle', 'i'),
20
-
; ['<M-L>'] = map('postwin.clear', {'n', 'i'}),
21
-
; ['<C-k>'] = map('signature.show', {'n', 'i'}),
22
-
; ['<F12>'] = map('sclang.hard_stop', {'n', 'x', 'i'}),
23
-
; ['<leader>st'] = map('sclang.start'),
24
-
; ['<leader>sk'] = map('sclang.recompile'),
25
-
; ['<F1>'] = map_expr('s.boot'),
26
-
; ['<F2>'] = map_expr('s.meter'),
27
-
; }
28
-
; }
29
-
; -- You gotta run :SCNvimGenerateAssets for this first
30
-
; -- require("luasnip").add_snippets("supercollider", require("scnvim/utils").get_snippets())
···
-35
home/profiles/nvim/config/fnl/conf/plugins/cmp.fnl
-35
home/profiles/nvim/config/fnl/conf/plugins/cmp.fnl
···
1
-
(local cmp (require :cmp))
2
-
3
-
(fn has-words-before []
4
-
(let [(line col) (unpack (vim.api.nvim_win_get_cursor 0))
5
-
cur-line (. (vim.api.nvim_buf_get_lines 0
6
-
(- line 1)
7
-
line
8
-
true
9
-
1))]
10
-
(and (not= col 0)
11
-
(= (: (: cur-line :sub col col) :match "%s")
12
-
nil))))
13
-
14
-
(let [lspkind (require :lspkind)]
15
-
(cmp.setup {:formatting {:format (lspkind.cmp_format {:mode "symbol_text"
16
-
:maxwidth 50})
17
-
:show_labelDetails true}
18
-
:snippet {:expand (fn [args] (vim.snippet.expand args.body))}
19
-
:sources [{:name "buffer"} {:name "nvim_lsp"}
20
-
{:name "look"} {:name "path"}
21
-
{:name "calc"} {:name "spell"}
22
-
{:name "tags"}]
23
-
:mapping {"<C-d>" (cmp.mapping.scroll_docs -4)
24
-
"<C-u>" (cmp.mapping.scroll_docs 4)
25
-
"<C-g>" (cmp.mapping.close)
26
-
"<CR>" (cmp.mapping.confirm {:select true})
27
-
"<Tab>" (cmp.mapping (fn [fallback]
28
-
(if (cmp.visible) (cmp.select_next_item)
29
-
(has-words-before) (cmp.complete)
30
-
(fallback)))
31
-
[:i :s])
32
-
"<S-Tab>" (cmp.mapping (fn [fallback]
33
-
(if (cmp.visible) (cmp.select_prev_item)
34
-
(fallback)))
35
-
[:i :s])}}))
···
-35
home/profiles/nvim/config/fnl/conf/plugins/kitaab.fnl
-35
home/profiles/nvim/config/fnl/conf/plugins/kitaab.fnl
···
1
-
; Kitaab is why I'm so tied to vim.
2
-
; If only I could find a nice notes editor...
3
-
4
-
(local nvim (require :lib/nvim))
5
-
6
-
(import-macros {: do-req } :lib/macros)
7
-
8
-
(nvim.g :vimwiki_list [{:path "~/kitaab/vimwiki"
9
-
:auto_tags 1
10
-
:auto_diary_index 1
11
-
:auto_generate_links 0
12
-
:nested_syntaxes {:python "python"
13
-
:c++ "cpp"
14
-
:nix "nix"
15
-
:bash "sh"}}])
16
-
(nvim.g :zettel_format "%y%m%d-%H%M")
17
-
18
-
; Custom functions
19
-
(fn update_date []
20
-
(var written false)
21
-
(let [time (os.date "%Y-%m-%d %H:%M")
22
-
message (.. "%update " time)
23
-
lines (vim.api.nvim_buf_get_lines 0 0 4 false)]
24
-
(each [index line (ipairs lines)]
25
-
(if (and (= (length line) 0) (not written))
26
-
(do
27
-
(vim.api.nvim_buf_set_lines 0 (- index 1) index false [message ""])
28
-
(set written true)))
29
-
(if (and (= index 4) (not written))
30
-
(vim.api.nvim_buf_set_lines 0 3 index false [message])))))
31
-
32
-
(vim.api.nvim_create_autocmd "BufWritePre" {:pattern ["*.wiki"]
33
-
:callback update_date})
34
-
35
-
(do-req :hologram :setup {:auto_display false})
···
-45
home/profiles/nvim/config/fnl/conf/plugins.fnl
-45
home/profiles/nvim/config/fnl/conf/plugins.fnl
···
1
-
(local nvim (require :lib/nvim))
2
-
(local navic (require :nvim-navic))
3
-
4
-
(import-macros {: do-req } :lib/macros)
5
-
6
-
(let [lualine (require :lualine)]
7
-
(lualine.setup {:options {:theme "ayu"}
8
-
:sections {; :lualine_c [:filename (fn []
9
-
; (let [lspsaga (require :lspsaga.symbol.winbar)]
10
-
; (lspsaga.get_bar))
11
-
:lualine_y [(fn []
12
-
(var msg "No Active LSP")
13
-
(let [buf_ft (vim.api.nvim_buf_get_option 0 "filetype")
14
-
clients (vim.lsp.get_active_clients)]
15
-
(each [_ client (ipairs clients)]
16
-
(let [filetypes (. client :config :filetypes)]
17
-
(if (and filetypes (vim.fn.index filetypes buf_ft)) (set msg client.name))))
18
-
msg))]
19
-
:lualine_x [:filetype]}}))
20
-
21
-
(require :neo-tree)
22
-
(do-req :gitsigns :setup)
23
-
(do-req :marks :setup)
24
-
; (do-req :mini.pairs :setup)
25
-
(do-req :mini.diff :setup)
26
-
(do-req :mini.ai :setup)
27
-
(do-req :mini.surround :setup {:mappings {:add "ys"
28
-
:delete "ds"
29
-
:replace "cs"}})
30
-
(do-req :todo-comments :setup)
31
-
(do-req :ibl :setup {:scope {:exclude {:language ["fennel" "clojure" "janet"]}}})
32
-
33
-
(do-req :nvim-treesitter.configs :setup {:highlight {:enable true}
34
-
:textobjects {:enable true}
35
-
:indent {:enable true}})
36
-
(do-req :treesitter-context :setup {:max_lines 5})
37
-
38
-
(do-req :auto-session :setup {:log_level "info"
39
-
:auto_session_suppress_dirs ["~/"]})
40
-
(nvim.opt :sessionoptions "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal")
41
-
42
-
(do-req :aerial :setup {}) ;{:on_attach (fn [bufnr]
43
-
; (do
44
-
; (vim.keymap.set "n" "{" "<cmd>AerialPrev<CR>" { :buffer bufnr})
45
-
; (vim.keymap.set "n" "}" "<cmd>AerialNext<CR>" { :buffer bufnr}))
···
-6
home/profiles/nvim/config/fnl/lib/macros.fnl
-6
home/profiles/nvim/config/fnl/lib/macros.fnl
-37
home/profiles/nvim/config/fnl/lib/nvim.fnl
-37
home/profiles/nvim/config/fnl/lib/nvim.fnl
···
1
-
(fn autocmd [events opts]
2
-
"Create autocommand"
3
-
(vim.api.nvim_create_autocmd events opts))
4
-
5
-
(fn clear-autocmds [opts]
6
-
"Clear autocommands"
7
-
(vim.api.nvim_clear_autocmds opts))
8
-
9
-
(fn augroup [name ?opts]
10
-
"Create autocommand group"
11
-
(vim.api.nvim_create_augroup name (or ?opts {})))
12
-
13
-
(fn keymap [mode lhs rhs ?opts]
14
-
"Sets a global mapping for the given mode.
15
-
Ex: `(keymap [:n :i] ...)`"
16
-
(let [string-mode (table.concat mode)]
17
-
(vim.api.nvim_set_keymap string-mode lhs rhs (or ?opts {}))))
18
-
19
-
(fn opt [key value]
20
-
"Set a vim option"
21
-
(tset vim.opt key value))
22
-
23
-
(fn g [key value]
24
-
"Set a vim global"
25
-
(tset vim.g key value))
26
-
27
-
(fn colorscheme [name]
28
-
"Set the current colorscheme"
29
-
(vim.cmd (.. "colorscheme " name)))
30
-
31
-
{: autocmd
32
-
: clear-autocmds
33
-
: augroup
34
-
: keymap
35
-
: opt
36
-
: g
37
-
: colorscheme}
···
-26
home/profiles/nvim/config/init.lua
-26
home/profiles/nvim/config/init.lua
···
1
-
if pcall(require, "hotpot") then
2
-
-- Setup hotpot.nvim
3
-
require("hotpot").setup({
4
-
provide_require_fennel = true,
5
-
-- show fennel compiler results in when editing fennel files
6
-
enable_hotpot_diagnostics = true,
7
-
compiler = {
8
-
-- options passed to fennel.compile for modules, defaults to {}
9
-
modules = {
10
-
-- not default but recommended, align lua lines with fnl source
11
-
-- for more debuggable errors, but less readable lua.
12
-
correlate = true
13
-
},
14
-
macros = {
15
-
-- allow macros to access vim global, needed for nyoom modules
16
-
env = "_COMPILER",
17
-
compilerEnv = _G,
18
-
allowGlobals = true,
19
-
},
20
-
}
21
-
})
22
-
-- Import neovim configuration
23
-
require("conf")
24
-
else
25
-
print("Unable to require hotpot")
26
-
end
···
+4
-130
home/profiles/nvim/default.nix
+4
-130
home/profiles/nvim/default.nix
···
1
{ pkgs, ... }:
2
-
# TODO Need to find a solution to have my own packages?
3
-
# Or at least update to recent versions of the packages I do use in nixpkgs
4
{
5
home.sessionVariables.EDITOR = "nvim";
6
home.shellAliases = {
7
-
vim = "nvim";
8
k = "cd ~/kitaab/vimwiki; vim -c :VimwikiIndex; cd $OLDPWD";
9
-
# kitaab zettel
10
-
kz = "cd ~/kitaab/vimwiki; vim -c :VimwikiIndex -c :ZettelNew; cd $OLDPWD";
11
-
# kitaab get by tagged
12
-
kt =
13
-
"cd /home/anish/kitaab/vimwiki; eza *_index.wiki | fzf --preview 'bat --style=numbers --color=always --terminal-width -1 ./{}';cd $OLDPWD";
14
};
15
16
-
home.file.".config/nvim".source = ./config;
17
-
18
-
#environment.systemPackages = with customPlugins; [ tidal ];
19
programs.neovim = {
20
enable = true;
21
-
22
extraPackages = with pkgs; [
23
-
# used to compile tree-sitter grammar
24
-
# python-with-my-packages
25
-
# nodejs
26
-
# clojure-lsp
27
-
# clojure
28
-
# clj-kondo
29
-
terraform-lsp
30
-
nil
31
-
gopls
32
-
gcc
33
-
shellcheck
34
-
shfmt
35
-
proselint
36
-
nixfmt
37
-
# statix
38
-
# nodePackages.typescript
39
-
# nodePackages.typescript-language-server
40
-
# luajitPackages.lua-lsp
41
-
fennel-ls
42
-
unstable.starpls-bin
43
];
44
45
-
plugins = with pkgs.unstable.vimPlugins;
46
-
[
47
-
#hotpot
48
-
hotpot-nvim
49
-
nvim-navic
50
-
# ui
51
-
lualine-nvim
52
-
neo-tree-nvim
53
-
fzf-vim
54
-
vim-devicons
55
-
nvim-web-devicons
56
-
telescope-nvim
57
-
plenary-nvim
58
-
FTerm-nvim
59
-
barbar-nvim
60
-
neovim-ayu
61
-
rainbow_parentheses-vim
62
-
auto-session
63
-
which-key-nvim
64
-
aerial-nvim
65
-
todo-comments-nvim
66
-
indent-blankline-nvim
67
-
nvim-parinfer
68
-
69
-
# Tree sitter
70
-
(nvim-treesitter.withPlugins (p: [
71
-
p.nix
72
-
p.clojure
73
-
p.fennel
74
-
p.lua
75
-
p.html
76
-
p.css
77
-
p.regex
78
-
p.supercollider
79
-
p.beancount
80
-
p.markdown_inline
81
-
p.markdown
82
-
p.glsl
83
-
p.yaml
84
-
p.toml
85
-
p.dockerfile
86
-
p.json
87
-
p.go
88
-
p.starlark
89
-
]))
90
-
nvim-treesitter-context
91
-
nvim-treesitter-textobjects
92
-
93
-
# TODO
94
-
undotree
95
-
marks-nvim
96
-
97
-
# language
98
-
vim-nix
99
-
emmet-vim
100
-
csv-vim
101
-
direnv-vim
102
-
# conjure
103
-
104
-
# kitaab stuff
105
-
vimwiki
106
-
vim-zettel
107
-
hologram-nvim
108
-
109
-
# lsp stuff
110
-
nvim-lspconfig
111
-
nvim-cmp
112
-
cmp-nvim-lsp
113
-
cmp-treesitter
114
-
# cmp-conjure
115
-
cmp-buffer
116
-
cmp-path
117
-
cmp-spell
118
-
lspkind-nvim
119
-
conform-nvim
120
-
none-ls-nvim
121
-
mini-nvim
122
-
# nvim-lspfuzzy
123
-
124
-
# git stuff
125
-
vim-fugitive
126
-
gitsigns-nvim
127
-
fzf-checkout-vim
128
-
129
-
# Clojure stuff
130
-
# conjure
131
-
vim-sexp
132
-
vim-sexp-mappings-for-regular-people
133
-
fennel-vim
134
-
135
-
# nvim-luapad
136
-
scnvim
137
-
flash-nvim
138
-
vim-beancount
139
-
] ++ [ pkgs.vimPlugins.vim-tidal ];
140
-
# withPython3 = true;
141
-
# extraPython3Packages = pkgs: with pkgs; [ tasklib six ];
142
-
# vimAlias = true;
143
};
144
}
145
···
1
{ pkgs, ... }:
2
{
3
home.sessionVariables.EDITOR = "nvim";
4
home.shellAliases = {
5
k = "cd ~/kitaab/vimwiki; vim -c :VimwikiIndex; cd $OLDPWD";
6
};
7
8
programs.neovim = {
9
enable = true;
10
+
package = pkgs.unstable.neovim-unwrapped;
11
extraPackages = with pkgs; [
12
+
# used for Cody
13
+
nodejs
14
];
15
16
+
vimAlias = true;
17
};
18
}
19
+8
home/profiles/nvim/lazynvim/.config/nvim/.gitignore
+8
home/profiles/nvim/lazynvim/.config/nvim/.gitignore
+15
home/profiles/nvim/lazynvim/.config/nvim/.neoconf.json
+15
home/profiles/nvim/lazynvim/.config/nvim/.neoconf.json
+201
home/profiles/nvim/lazynvim/.config/nvim/LICENSE
+201
home/profiles/nvim/lazynvim/.config/nvim/LICENSE
···
···
1
+
Apache License
2
+
Version 2.0, January 2004
3
+
http://www.apache.org/licenses/
4
+
5
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+
1. Definitions.
8
+
9
+
"License" shall mean the terms and conditions for use, reproduction,
10
+
and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+
"Licensor" shall mean the copyright owner or entity authorized by
13
+
the copyright owner that is granting the License.
14
+
15
+
"Legal Entity" shall mean the union of the acting entity and all
16
+
other entities that control, are controlled by, or are under common
17
+
control with that entity. For the purposes of this definition,
18
+
"control" means (i) the power, direct or indirect, to cause the
19
+
direction or management of such entity, whether by contract or
20
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+
outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+
"You" (or "Your") shall mean an individual or Legal Entity
24
+
exercising permissions granted by this License.
25
+
26
+
"Source" form shall mean the preferred form for making modifications,
27
+
including but not limited to software source code, documentation
28
+
source, and configuration files.
29
+
30
+
"Object" form shall mean any form resulting from mechanical
31
+
transformation or translation of a Source form, including but
32
+
not limited to compiled object code, generated documentation,
33
+
and conversions to other media types.
34
+
35
+
"Work" shall mean the work of authorship, whether in Source or
36
+
Object form, made available under the License, as indicated by a
37
+
copyright notice that is included in or attached to the work
38
+
(an example is provided in the Appendix below).
39
+
40
+
"Derivative Works" shall mean any work, whether in Source or Object
41
+
form, that is based on (or derived from) the Work and for which the
42
+
editorial revisions, annotations, elaborations, or other modifications
43
+
represent, as a whole, an original work of authorship. For the purposes
44
+
of this License, Derivative Works shall not include works that remain
45
+
separable from, or merely link (or bind by name) to the interfaces of,
46
+
the Work and Derivative Works thereof.
47
+
48
+
"Contribution" shall mean any work of authorship, including
49
+
the original version of the Work and any modifications or additions
50
+
to that Work or Derivative Works thereof, that is intentionally
51
+
submitted to Licensor for inclusion in the Work by the copyright owner
52
+
or by an individual or Legal Entity authorized to submit on behalf of
53
+
the copyright owner. For the purposes of this definition, "submitted"
54
+
means any form of electronic, verbal, or written communication sent
55
+
to the Licensor or its representatives, including but not limited to
56
+
communication on electronic mailing lists, source code control systems,
57
+
and issue tracking systems that are managed by, or on behalf of, the
58
+
Licensor for the purpose of discussing and improving the Work, but
59
+
excluding communication that is conspicuously marked or otherwise
60
+
designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+
"Contributor" shall mean Licensor and any individual or Legal Entity
63
+
on behalf of whom a Contribution has been received by Licensor and
64
+
subsequently incorporated within the Work.
65
+
66
+
2. Grant of Copyright License. Subject to the terms and conditions of
67
+
this License, each Contributor hereby grants to You a perpetual,
68
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+
copyright license to reproduce, prepare Derivative Works of,
70
+
publicly display, publicly perform, sublicense, and distribute the
71
+
Work and such Derivative Works in Source or Object form.
72
+
73
+
3. Grant of Patent License. Subject to the terms and conditions of
74
+
this License, each Contributor hereby grants to You a perpetual,
75
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+
(except as stated in this section) patent license to make, have made,
77
+
use, offer to sell, sell, import, and otherwise transfer the Work,
78
+
where such license applies only to those patent claims licensable
79
+
by such Contributor that are necessarily infringed by their
80
+
Contribution(s) alone or by combination of their Contribution(s)
81
+
with the Work to which such Contribution(s) was submitted. If You
82
+
institute patent litigation against any entity (including a
83
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+
or a Contribution incorporated within the Work constitutes direct
85
+
or contributory patent infringement, then any patent licenses
86
+
granted to You under this License for that Work shall terminate
87
+
as of the date such litigation is filed.
88
+
89
+
4. Redistribution. You may reproduce and distribute copies of the
90
+
Work or Derivative Works thereof in any medium, with or without
91
+
modifications, and in Source or Object form, provided that You
92
+
meet the following conditions:
93
+
94
+
(a) You must give any other recipients of the Work or
95
+
Derivative Works a copy of this License; and
96
+
97
+
(b) You must cause any modified files to carry prominent notices
98
+
stating that You changed the files; and
99
+
100
+
(c) You must retain, in the Source form of any Derivative Works
101
+
that You distribute, all copyright, patent, trademark, and
102
+
attribution notices from the Source form of the Work,
103
+
excluding those notices that do not pertain to any part of
104
+
the Derivative Works; and
105
+
106
+
(d) If the Work includes a "NOTICE" text file as part of its
107
+
distribution, then any Derivative Works that You distribute must
108
+
include a readable copy of the attribution notices contained
109
+
within such NOTICE file, excluding those notices that do not
110
+
pertain to any part of the Derivative Works, in at least one
111
+
of the following places: within a NOTICE text file distributed
112
+
as part of the Derivative Works; within the Source form or
113
+
documentation, if provided along with the Derivative Works; or,
114
+
within a display generated by the Derivative Works, if and
115
+
wherever such third-party notices normally appear. The contents
116
+
of the NOTICE file are for informational purposes only and
117
+
do not modify the License. You may add Your own attribution
118
+
notices within Derivative Works that You distribute, alongside
119
+
or as an addendum to the NOTICE text from the Work, provided
120
+
that such additional attribution notices cannot be construed
121
+
as modifying the License.
122
+
123
+
You may add Your own copyright statement to Your modifications and
124
+
may provide additional or different license terms and conditions
125
+
for use, reproduction, or distribution of Your modifications, or
126
+
for any such Derivative Works as a whole, provided Your use,
127
+
reproduction, and distribution of the Work otherwise complies with
128
+
the conditions stated in this License.
129
+
130
+
5. Submission of Contributions. Unless You explicitly state otherwise,
131
+
any Contribution intentionally submitted for inclusion in the Work
132
+
by You to the Licensor shall be under the terms and conditions of
133
+
this License, without any additional terms or conditions.
134
+
Notwithstanding the above, nothing herein shall supersede or modify
135
+
the terms of any separate license agreement you may have executed
136
+
with Licensor regarding such Contributions.
137
+
138
+
6. Trademarks. This License does not grant permission to use the trade
139
+
names, trademarks, service marks, or product names of the Licensor,
140
+
except as required for reasonable and customary use in describing the
141
+
origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+
7. Disclaimer of Warranty. Unless required by applicable law or
144
+
agreed to in writing, Licensor provides the Work (and each
145
+
Contributor provides its Contributions) on an "AS IS" BASIS,
146
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+
implied, including, without limitation, any warranties or conditions
148
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+
PARTICULAR PURPOSE. You are solely responsible for determining the
150
+
appropriateness of using or redistributing the Work and assume any
151
+
risks associated with Your exercise of permissions under this License.
152
+
153
+
8. Limitation of Liability. In no event and under no legal theory,
154
+
whether in tort (including negligence), contract, or otherwise,
155
+
unless required by applicable law (such as deliberate and grossly
156
+
negligent acts) or agreed to in writing, shall any Contributor be
157
+
liable to You for damages, including any direct, indirect, special,
158
+
incidental, or consequential damages of any character arising as a
159
+
result of this License or out of the use or inability to use the
160
+
Work (including but not limited to damages for loss of goodwill,
161
+
work stoppage, computer failure or malfunction, or any and all
162
+
other commercial damages or losses), even if such Contributor
163
+
has been advised of the possibility of such damages.
164
+
165
+
9. Accepting Warranty or Additional Liability. While redistributing
166
+
the Work or Derivative Works thereof, You may choose to offer,
167
+
and charge a fee for, acceptance of support, warranty, indemnity,
168
+
or other liability obligations and/or rights consistent with this
169
+
License. However, in accepting such obligations, You may act only
170
+
on Your own behalf and on Your sole responsibility, not on behalf
171
+
of any other Contributor, and only if You agree to indemnify,
172
+
defend, and hold each Contributor harmless for any liability
173
+
incurred by, or claims asserted against, such Contributor by reason
174
+
of your accepting any such warranty or additional liability.
175
+
176
+
END OF TERMS AND CONDITIONS
177
+
178
+
APPENDIX: How to apply the Apache License to your work.
179
+
180
+
To apply the Apache License to your work, attach the following
181
+
boilerplate notice, with the fields enclosed by brackets "[]"
182
+
replaced with your own identifying information. (Don't include
183
+
the brackets!) The text should be enclosed in the appropriate
184
+
comment syntax for the file format. We also recommend that a
185
+
file or class name and description of purpose be included on the
186
+
same "printed page" as the copyright notice for easier
187
+
identification within third-party archives.
188
+
189
+
Copyright [yyyy] [name of copyright owner]
190
+
191
+
Licensed under the Apache License, Version 2.0 (the "License");
192
+
you may not use this file except in compliance with the License.
193
+
You may obtain a copy of the License at
194
+
195
+
http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+
Unless required by applicable law or agreed to in writing, software
198
+
distributed under the License is distributed on an "AS IS" BASIS,
199
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+
See the License for the specific language governing permissions and
201
+
limitations under the License.
+4
home/profiles/nvim/lazynvim/.config/nvim/README.md
+4
home/profiles/nvim/lazynvim/.config/nvim/README.md
+2
home/profiles/nvim/lazynvim/.config/nvim/init.lua
+2
home/profiles/nvim/lazynvim/.config/nvim/init.lua
+60
home/profiles/nvim/lazynvim/.config/nvim/lazy-lock.json
+60
home/profiles/nvim/lazynvim/.config/nvim/lazy-lock.json
···
···
1
+
{
2
+
"LazyVim": { "branch": "main", "commit": "12818a6cb499456f4903c5d8e68af43753ebc869" },
3
+
"SchemaStore.nvim": { "branch": "main", "commit": "54a2cf0105166d5a48172e81f12a2bf10cfc8b2c" },
4
+
"aerial.nvim": { "branch": "master", "commit": "e585934fef8d253dbc5655cff3deb3444e064e6c" },
5
+
"bufferline.nvim": { "branch": "main", "commit": "0b2fd861eee7595015b6561dade52fb060be10c4" },
6
+
"catppuccin": { "branch": "main", "commit": "4fd72a9ab64b393c2c22b168508fd244877fec96" },
7
+
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
8
+
"cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" },
9
+
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
10
+
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
11
+
"conform.nvim": { "branch": "master", "commit": "62eba813b7501b39612146cbf29cd07f1d4ac29c" },
12
+
"dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" },
13
+
"dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" },
14
+
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
15
+
"friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
16
+
"gitsigns.nvim": { "branch": "main", "commit": "562dc47189ad3c8696dbf460d38603a74d544849" },
17
+
"grug-far.nvim": { "branch": "main", "commit": "ebab68b2150079732ae8074eefb261a124824139" },
18
+
"indent-blankline.nvim": { "branch": "master", "commit": "db926997af951da38e5004ec7b9fbdc480b48f5d" },
19
+
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
20
+
"lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" },
21
+
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
22
+
"luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" },
23
+
"mason-lspconfig.nvim": { "branch": "main", "commit": "482350b050bd413931c2cdd4857443c3da7d57cb" },
24
+
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
25
+
"mini.ai": { "branch": "main", "commit": "a9b992b13d22a8db8df6beac25afa59a10b5584d" },
26
+
"mini.icons": { "branch": "main", "commit": "12e7b5d47bfc1b4c5ba4278fb49ec9100138df14" },
27
+
"mini.pairs": { "branch": "main", "commit": "927d19cbdd0e752ab1c7eed87072e71d2cd6ff51" },
28
+
"mini.surround": { "branch": "main", "commit": "d8913ed23be0a1a4585ae34414821cc343a46174" },
29
+
"neo-tree.nvim": { "branch": "main", "commit": "206241e451c12f78969ff5ae53af45616ffc9b72" },
30
+
"neovim-ayu": { "branch": "master", "commit": "6993189dd0ee38299879a1a0064718a8392e8713" },
31
+
"noice.nvim": { "branch": "main", "commit": "448bb9c524a7601035449210838e374a30153172" },
32
+
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
33
+
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
34
+
"nvim-lint": { "branch": "master", "commit": "debabca63c0905b59ce596a55a8e33eafdf66342" },
35
+
"nvim-lspconfig": { "branch": "master", "commit": "911167921d49cd5c1c9b2436031d0da3945e787f" },
36
+
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
37
+
"nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" },
38
+
"nvim-treesitter": { "branch": "master", "commit": "04401b5dd17c3419dae5141677bd256f52d54733" },
39
+
"nvim-treesitter-textobjects": { "branch": "master", "commit": "41e3abf6bfd9a9a681eb1f788bdeba91c9004b2b" },
40
+
"nvim-ts-autotag": { "branch": "main", "commit": "0cb76eea80e9c73b88880f0ca78fbd04c5bdcac7" },
41
+
"outline.nvim": { "branch": "main", "commit": "02a18194b3d2adfb537dd1a9f21d1fc29dd31382" },
42
+
"persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
43
+
"plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
44
+
"sg.nvim": { "branch": "master", "commit": "8bdd4d19da2268072708d5fe18fda9c23e16509d" },
45
+
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" },
46
+
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
47
+
"telescope-terraform-doc.nvim": { "branch": "main", "commit": "7ac642765615e6ff164ecfc82eb278aa68d06840" },
48
+
"telescope-terraform.nvim": { "branch": "main", "commit": "072c97023797ca1a874668aaa6ae0b74425335df" },
49
+
"telescope.nvim": { "branch": "master", "commit": "5972437de807c3bc101565175da66a1aa4f8707a" },
50
+
"todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" },
51
+
"tokyonight.nvim": { "branch": "main", "commit": "b0e7c7382a7e8f6456f2a95655983993ffda745e" },
52
+
"trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" },
53
+
"ts-comments.nvim": { "branch": "main", "commit": "98d7d4dec0af1312d38e288f800bbf6ff562b6ab" },
54
+
"vim-dadbod": { "branch": "master", "commit": "7888cb7164d69783d3dce4e0283decd26b82538b" },
55
+
"vim-dadbod-completion": { "branch": "master", "commit": "880f7e9f2959e567c718d52550f9fae1aa07aa81" },
56
+
"vim-dadbod-ui": { "branch": "master", "commit": "0f51d8de368c8c6220973e8acd156d17da746f4c" },
57
+
"vim-fugitive": { "branch": "master", "commit": "0444df68cd1cdabc7453d6bd84099458327e5513" },
58
+
"vim-helm": { "branch": "master", "commit": "ae1ebc160d2b9b90108477ab10df7a4fc501e358" },
59
+
"which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" }
60
+
}
+19
home/profiles/nvim/lazynvim/.config/nvim/lazyvim.json
+19
home/profiles/nvim/lazynvim/.config/nvim/lazyvim.json
···
···
1
+
{
2
+
"extras": [
3
+
"lazyvim.plugins.extras.editor.aerial",
4
+
"lazyvim.plugins.extras.editor.outline",
5
+
"lazyvim.plugins.extras.lang.go",
6
+
"lazyvim.plugins.extras.lang.helm",
7
+
"lazyvim.plugins.extras.lang.json",
8
+
"lazyvim.plugins.extras.lang.nix",
9
+
"lazyvim.plugins.extras.lang.sql",
10
+
"lazyvim.plugins.extras.lang.svelte",
11
+
"lazyvim.plugins.extras.lang.tailwind",
12
+
"lazyvim.plugins.extras.lang.terraform",
13
+
"lazyvim.plugins.extras.lang.typescript"
14
+
],
15
+
"news": {
16
+
"NEWS.md": "6520"
17
+
},
18
+
"version": 6
19
+
}
+3
home/profiles/nvim/lazynvim/.config/nvim/lua/config/autocmds.lua
+3
home/profiles/nvim/lazynvim/.config/nvim/lua/config/autocmds.lua
+21
home/profiles/nvim/lazynvim/.config/nvim/lua/config/keymaps.lua
+21
home/profiles/nvim/lazynvim/.config/nvim/lua/config/keymaps.lua
···
···
1
+
-- Keymaps are automatically loaded on the VeryLazy event
2
+
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
3
+
-- Add any additional keymaps here
4
+
local map = vim.keymap.set
5
+
6
+
-- Navigation
7
+
map("n", "gt", "<cmd>bnext<cr>", { desc = "Next Buffer" })
8
+
map("n", "gT", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
9
+
map("n", "gq", "<cmd>bdelete<cr>", { desc = "Prev Buffer" })
10
+
map("n", "<leader>q", "<cmd>q<cr>", { desc = "Quit" })
11
+
12
+
-- Git
13
+
map("n", "<leader>gs", "<cmd>:G<cr>", { desc = "Git Status" })
14
+
map("n", "<leader>gb", "<cmd>Telescope git_branches<cr>", { desc = "Git Status" })
15
+
map("n", "<leader>gp", "<cmd>:G! push<cr>", { desc = "Git Status" })
16
+
17
+
-- Telescope
18
+
map("n", "<leader>fs", "<cmd>Telescope live_grep<cr>", { desc = "Telescop Live Grep" })
19
+
20
+
-- Cody
21
+
map("n", "<leader>co", "<cmd>CodyChat<cr>", { desc = "Cody Chat" })
+57
home/profiles/nvim/lazynvim/.config/nvim/lua/config/lazy.lua
+57
home/profiles/nvim/lazynvim/.config/nvim/lua/config/lazy.lua
···
···
1
+
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
2
+
if not (vim.uv or vim.loop).fs_stat(lazypath) then
3
+
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
4
+
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
5
+
if vim.v.shell_error ~= 0 then
6
+
vim.api.nvim_echo({
7
+
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
8
+
{ out, "WarningMsg" },
9
+
{ "\nPress any key to exit..." },
10
+
}, true, {})
11
+
vim.fn.getchar()
12
+
os.exit(1)
13
+
end
14
+
end
15
+
vim.opt.rtp:prepend(lazypath)
16
+
17
+
require("lazy").setup({
18
+
spec = {
19
+
-- add LazyVim and import its plugins
20
+
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
21
+
-- import/override with your plugins
22
+
{ import = "plugins" },
23
+
},
24
+
defaults = {
25
+
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
26
+
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
27
+
lazy = false,
28
+
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
29
+
-- have outdated releases, which may break your Neovim install.
30
+
version = false, -- always use the latest git commit
31
+
-- version = "*", -- try installing the latest stable version for plugins that support semver
32
+
},
33
+
install = { colorscheme = { "tokyonight", "habamax" } },
34
+
checker = {
35
+
enabled = true, -- check for plugin updates periodically
36
+
notify = false, -- notify on update
37
+
}, -- automatically check for plugin updates
38
+
performance = {
39
+
rtp = {
40
+
-- disable some rtp plugins
41
+
disabled_plugins = {
42
+
"gzip",
43
+
-- "matchit",
44
+
-- "matchparen",
45
+
-- "netrwPlugin",
46
+
"tarPlugin",
47
+
"tohtml",
48
+
"tutor",
49
+
"zipPlugin",
50
+
},
51
+
},
52
+
},
53
+
})
54
+
55
+
require("sg").setup({})
56
+
-- require("ayu").setup({ mirage = true })
57
+
-- require("ayu").colorscheme()
+3
home/profiles/nvim/lazynvim/.config/nvim/lua/config/options.lua
+3
home/profiles/nvim/lazynvim/.config/nvim/lua/config/options.lua
+13
home/profiles/nvim/lazynvim/.config/nvim/lua/plugins/cody.lua
+13
home/profiles/nvim/lazynvim/.config/nvim/lua/plugins/cody.lua
+50
home/profiles/nvim/lazynvim/.config/nvim/lua/plugins/colorscheme.lua
+50
home/profiles/nvim/lazynvim/.config/nvim/lua/plugins/colorscheme.lua
···
···
1
+
return {
2
+
{
3
+
"catppuccin/nvim",
4
+
lazy = true,
5
+
name = "catppuccin",
6
+
opts = {
7
+
integrations = {
8
+
aerial = true,
9
+
alpha = true,
10
+
cmp = true,
11
+
dashboard = true,
12
+
flash = true,
13
+
gitsigns = true,
14
+
headlines = true,
15
+
illuminate = true,
16
+
indent_blankline = { enabled = true },
17
+
leap = true,
18
+
lsp_trouble = true,
19
+
mason = true,
20
+
markdown = true,
21
+
mini = true,
22
+
native_lsp = {
23
+
enabled = true,
24
+
underlines = {
25
+
errors = { "undercurl" },
26
+
hints = { "undercurl" },
27
+
warnings = { "undercurl" },
28
+
information = { "undercurl" },
29
+
},
30
+
},
31
+
navic = { enabled = true, custom_bg = "lualine" },
32
+
neotest = true,
33
+
neotree = true,
34
+
noice = true,
35
+
semantic_tokens = true,
36
+
telescope = true,
37
+
treesitter = true,
38
+
treesitter_context = true,
39
+
which_key = true,
40
+
},
41
+
},
42
+
},
43
+
{ "Shatur/neovim-ayu", lazy = false },
44
+
{
45
+
"LazyVim/LazyVim",
46
+
opts = {
47
+
colorscheme = "catppuccin-macchiato",
48
+
},
49
+
},
50
+
}
+193
home/profiles/nvim/lazynvim/.config/nvim/lua/plugins/example.lua
+193
home/profiles/nvim/lazynvim/.config/nvim/lua/plugins/example.lua
···
···
1
+
-- since this is just an example spec, don't actually load anything here and return an empty spec
2
+
-- stylua: ignore
3
+
if true then return {} end
4
+
5
+
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
6
+
--
7
+
-- In your plugin files, you can:
8
+
-- * add extra plugins
9
+
-- * disable/enabled LazyVim plugins
10
+
-- * override the configuration of LazyVim plugins
11
+
return {
12
+
-- add gruvbox
13
+
{ "ellisonleao/gruvbox.nvim" },
14
+
15
+
-- Configure LazyVim to load gruvbox
16
+
{
17
+
"LazyVim/LazyVim",
18
+
opts = {
19
+
colorscheme = "gruvbox",
20
+
},
21
+
},
22
+
23
+
-- change trouble config
24
+
{
25
+
"folke/trouble.nvim",
26
+
-- opts will be merged with the parent spec
27
+
opts = { use_diagnostic_signs = true },
28
+
},
29
+
30
+
-- disable trouble
31
+
{ "folke/trouble.nvim", enabled = false },
32
+
33
+
-- override nvim-cmp and add cmp-emoji
34
+
{
35
+
"hrsh7th/nvim-cmp",
36
+
dependencies = { "hrsh7th/cmp-emoji" },
37
+
---@param opts cmp.ConfigSchema
38
+
opts = function(_, opts)
39
+
table.insert(opts.sources, { name = "emoji" })
40
+
end,
41
+
},
42
+
43
+
-- change some telescope options and a keymap to browse plugin files
44
+
{
45
+
"nvim-telescope/telescope.nvim",
46
+
keys = {
47
+
-- add a keymap to browse plugin files
48
+
-- stylua: ignore
49
+
{
50
+
"<leader>fp",
51
+
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
52
+
desc = "Find Plugin File",
53
+
},
54
+
},
55
+
-- change some options
56
+
opts = {
57
+
defaults = {
58
+
layout_strategy = "horizontal",
59
+
layout_config = { prompt_position = "top" },
60
+
sorting_strategy = "ascending",
61
+
winblend = 0,
62
+
},
63
+
},
64
+
},
65
+
66
+
-- add pyright to lspconfig
67
+
{
68
+
"neovim/nvim-lspconfig",
69
+
---@class PluginLspOpts
70
+
opts = {
71
+
---@type lspconfig.options
72
+
servers = {
73
+
-- pyright will be automatically installed with mason and loaded with lspconfig
74
+
pyright = {},
75
+
},
76
+
},
77
+
},
78
+
79
+
-- add tsserver and setup with typescript.nvim instead of lspconfig
80
+
{
81
+
"neovim/nvim-lspconfig",
82
+
dependencies = {
83
+
"jose-elias-alvarez/typescript.nvim",
84
+
init = function()
85
+
require("lazyvim.util").lsp.on_attach(function(_, buffer)
86
+
-- stylua: ignore
87
+
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
88
+
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
89
+
end)
90
+
end,
91
+
},
92
+
---@class PluginLspOpts
93
+
opts = {
94
+
---@type lspconfig.options
95
+
servers = {
96
+
-- tsserver will be automatically installed with mason and loaded with lspconfig
97
+
tsserver = {},
98
+
},
99
+
-- you can do any additional lsp server setup here
100
+
-- return true if you don't want this server to be setup with lspconfig
101
+
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
102
+
setup = {
103
+
-- example to setup with typescript.nvim
104
+
tsserver = function(_, opts)
105
+
require("typescript").setup({ server = opts })
106
+
return true
107
+
end,
108
+
-- Specify * to use this function as a fallback for any server
109
+
-- ["*"] = function(server, opts) end,
110
+
},
111
+
},
112
+
},
113
+
114
+
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
115
+
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
116
+
{ import = "lazyvim.plugins.extras.lang.typescript" },
117
+
118
+
-- add more treesitter parsers
119
+
{
120
+
"nvim-treesitter/nvim-treesitter",
121
+
opts = {
122
+
ensure_installed = {
123
+
"bash",
124
+
"html",
125
+
"javascript",
126
+
"json",
127
+
"lua",
128
+
"markdown",
129
+
"markdown_inline",
130
+
"python",
131
+
"query",
132
+
"regex",
133
+
"tsx",
134
+
"typescript",
135
+
"vim",
136
+
"yaml",
137
+
},
138
+
},
139
+
},
140
+
141
+
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
142
+
-- would overwrite `ensure_installed` with the new value.
143
+
-- If you'd rather extend the default config, use the code below instead:
144
+
{
145
+
"nvim-treesitter/nvim-treesitter",
146
+
opts = function(_, opts)
147
+
-- add tsx and treesitter
148
+
vim.list_extend(opts.ensure_installed, {
149
+
"tsx",
150
+
"typescript",
151
+
})
152
+
end,
153
+
},
154
+
155
+
-- the opts function can also be used to change the default opts:
156
+
{
157
+
"nvim-lualine/lualine.nvim",
158
+
event = "VeryLazy",
159
+
opts = function(_, opts)
160
+
table.insert(opts.sections.lualine_x, "๐")
161
+
end,
162
+
},
163
+
164
+
-- or you can return new options to override all the defaults
165
+
{
166
+
"nvim-lualine/lualine.nvim",
167
+
event = "VeryLazy",
168
+
opts = function()
169
+
return {
170
+
--[[add your custom lualine config here]]
171
+
}
172
+
end,
173
+
},
174
+
175
+
-- use mini.starter instead of alpha
176
+
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
177
+
178
+
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
179
+
{ import = "lazyvim.plugins.extras.lang.json" },
180
+
181
+
-- add any tools you want to have installed below
182
+
{
183
+
"williamboman/mason.nvim",
184
+
opts = {
185
+
ensure_installed = {
186
+
"stylua",
187
+
"shellcheck",
188
+
"shfmt",
189
+
"flake8",
190
+
},
191
+
},
192
+
},
193
+
}
+6
home/profiles/nvim/lazynvim/.config/nvim/lua/plugins/git.lua
+6
home/profiles/nvim/lazynvim/.config/nvim/lua/plugins/git.lua
+15
home/profiles/nvim/lazynvim/.config/nvim/lua/plugins/surround.lua
+15
home/profiles/nvim/lazynvim/.config/nvim/lua/plugins/surround.lua
+3
home/profiles/nvim/lazynvim/.config/nvim/stylua.toml
+3
home/profiles/nvim/lazynvim/.config/nvim/stylua.toml
-9
home/profiles/nvim/package.json
-9
home/profiles/nvim/package.json
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
-5
home/profiles/task/taskrc
-5
home/profiles/task/taskrc
···
82
report.every.labels=ID,Active,Deps,P,Project,Tag,Recur,S,Due,Until,Description
83
report.every.columns=id,start.age,depends,priority,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description
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
-
90
# Urgency
91
urgency.user.project.wait.coefficient=-10.0
92
urgency.user.project.craft.coefficient=1.9
···
82
report.every.labels=ID,Active,Deps,P,Project,Tag,Recur,S,Due,Until,Description
83
report.every.columns=id,start.age,depends,priority,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description
84
85
# Urgency
86
urgency.user.project.wait.coefficient=-10.0
87
urgency.user.project.craft.coefficient=1.9
+1
-1
hosts/box/configuration.nix
+1
-1
hosts/box/configuration.nix
+5
-7
hosts/box/default.nix
+5
-7
hosts/box/default.nix
···
7
../profiles/taskd
8
../profiles/shaarli
9
../profiles/dns
10
-
# ../profiles/monitoring
11
../profiles/nfs
12
../profiles/gonic
13
-
# ../profiles/headphones # TODO broken on 23.11, see: https://github.com/rembo10/headphones/issues/3320
14
../profiles/radicale
15
-
# ../profiles/seafile # waiting for https://github.com/NixOS/nixpkgs/pull/249523 to be merged
16
../profiles/syncthing
17
../profiles/dhyan
18
../profiles/calibre
···
22
../profiles/grasp
23
# ../profiles/archivebox
24
# ../profiles/woodpecker-agent
25
-
# ../profiles/jellyfin
26
../profiles/ulogger-server
27
-
../profiles/photoprism # Replace with immich
28
-
../profiles/gpodder
29
-
#../profiles/postgres_upgrade_script
30
];
31
32
# Backups
···
7
../profiles/taskd
8
../profiles/shaarli
9
../profiles/dns
10
+
../profiles/monitoring
11
../profiles/nfs
12
../profiles/gonic
13
+
../profiles/headphones
14
../profiles/radicale
15
+
../profiles/seafile
16
../profiles/syncthing
17
../profiles/dhyan
18
../profiles/calibre
···
22
../profiles/grasp
23
# ../profiles/archivebox
24
# ../profiles/woodpecker-agent
25
+
../profiles/jellyfin
26
../profiles/ulogger-server
27
+
../profiles/photoprism
28
];
29
30
# Backups
+1
-1
hosts/curve/configuration.nix
+1
-1
hosts/curve/configuration.nix
+2
-8
hosts/curve/default.nix
+2
-8
hosts/curve/default.nix
···
20
# import profiling tools
21
programs.systemtap.enable = true;
22
23
-
virtualisation.docker.enable = true;
24
-
virtualisation.docker.storageDriver = "btrfs";
25
-
environment.systemPackages = with pkgs; [
26
-
docker-compose
27
-
];
28
-
29
# Speed up boot by removing dependency on network
30
systemd = {
31
targets.network-online.wantedBy = pkgs.lib.mkForce [ ]; # Normally ["multi-user.target"]
···
33
};
34
35
programs.gnupg.agent.enable = true;
36
-
programs.gnupg.agent.pinentryPackage = pkgs.pinentry-gnome3;
37
38
fileSystems."/mnt/ftp" = {
39
device = "192.168.1.240:/home/ftp";
···
93
#virtualisation.docker.enable = true;
94
boot.blacklistedKernelModules = [ "qcserial" ];
95
# Used for packer Capsul
96
-
users.users.anish.extraGroups = [ "adbusers" "wheel" "plugdev" "libvertd" "docker" ];
97
virtualisation.libvirtd.enable = true;
98
hardware.keyboard.zsa.enable = true;
99
services.udev.extraRules = ''
···
20
# import profiling tools
21
programs.systemtap.enable = true;
22
23
# Speed up boot by removing dependency on network
24
systemd = {
25
targets.network-online.wantedBy = pkgs.lib.mkForce [ ]; # Normally ["multi-user.target"]
···
27
};
28
29
programs.gnupg.agent.enable = true;
30
+
programs.gnupg.agent.pinentryFlavor = "gnome3";
31
32
fileSystems."/mnt/ftp" = {
33
device = "192.168.1.240:/home/ftp";
···
87
#virtualisation.docker.enable = true;
88
boot.blacklistedKernelModules = [ "qcserial" ];
89
# Used for packer Capsul
90
+
users.users.anish.extraGroups = [ "adbusers" "wheel" "plugdev" "libvertd" ];
91
virtualisation.libvirtd.enable = true;
92
hardware.keyboard.zsa.enable = true;
93
services.udev.extraRules = ''
+16
-12
hosts/curve/hardware-configuration.nix
+16
-12
hosts/curve/hardware-configuration.nix
···
5
6
{
7
imports =
8
-
[ (modulesPath + "/installer/scan/not-detected.nix")
9
];
10
11
-
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
12
boot.initrd.kernelModules = [ "dm-snapshot" ];
13
boot.kernelModules = [ "kvm-intel" ];
14
boot.extraModulePackages = [ ];
15
16
fileSystems."/" =
17
-
{ device = "/dev/disk/by-uuid/e1268753-4f18-4e6f-8edb-d4724ad8eb4a";
18
fsType = "btrfs";
19
options = [ "subvol=root" ];
20
};
21
22
fileSystems."/home" =
23
-
{ device = "/dev/disk/by-uuid/e1268753-4f18-4e6f-8edb-d4724ad8eb4a";
24
fsType = "btrfs";
25
options = [ "subvol=home" ];
26
};
27
28
-
fileSystems."/boot" =
29
-
{ device = "/dev/disk/by-uuid/8244-A184";
30
-
fsType = "vfat";
31
-
};
32
-
33
swapDevices =
34
-
[ { device = "/dev/disk/by-uuid/e220fea6-cf3b-4687-bfe1-9cf6d3ba57f7"; }
35
-
];
36
37
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
38
# (the default) this is the recommended approach. When using systemd-networkd it's
···
43
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
44
45
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
46
-
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
47
}
···
5
6
{
7
imports =
8
+
[
9
+
(modulesPath + "/installer/scan/not-detected.nix")
10
];
11
12
+
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc" ];
13
boot.initrd.kernelModules = [ "dm-snapshot" ];
14
boot.kernelModules = [ "kvm-intel" ];
15
boot.extraModulePackages = [ ];
16
17
+
fileSystems."/boot" =
18
+
{
19
+
device = "/dev/disk/by-uuid/2C41-3DAA";
20
+
fsType = "vfat";
21
+
};
22
+
23
fileSystems."/" =
24
+
{
25
+
device = "/dev/disk/by-uuid/a4ae2855-10b9-49f3-adb0-acd82b74eeb9";
26
fsType = "btrfs";
27
options = [ "subvol=root" ];
28
};
29
30
fileSystems."/home" =
31
+
{
32
+
device = "/dev/disk/by-uuid/a4ae2855-10b9-49f3-adb0-acd82b74eeb9";
33
fsType = "btrfs";
34
options = [ "subvol=home" ];
35
};
36
37
swapDevices =
38
+
[{ device = "/dev/disk/by-uuid/23658926-6ffa-42dc-8915-a6479c385e0b"; }];
39
40
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
41
# (the default) this is the recommended approach. When using systemd-networkd it's
···
46
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
47
48
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
49
+
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
50
+
# hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
51
}
+44
hosts/darwin/casks/default.nix
+44
hosts/darwin/casks/default.nix
···
···
1
+
{ ... }:
2
+
3
+
{
4
+
homebrew.enable = true;
5
+
homebrew.brews = [
6
+
"kind"
7
+
"kubectl"
8
+
"bazelisk"
9
+
"sourcegraph/src-cli/src-cli"
10
+
"gh"
11
+
# "postgresql@15"
12
+
# "redis"
13
+
];
14
+
homebrew.casks = [
15
+
# Development Tools
16
+
"homebrew/cask/docker"
17
+
# "syncthing"
18
+
# "insomnia"
19
+
# "tableplus"
20
+
# "ngrok"
21
+
"postico"
22
+
"wireshark"
23
+
"1password"
24
+
"orbstack"
25
+
# "aerospace"
26
+
27
+
# Communication Tools
28
+
# Already installed manually
29
+
# "loom"
30
+
# "slack"
31
+
# "zoom"
32
+
# "firefox"
33
+
# "1password-cli"
34
+
35
+
# Utility Tools
36
+
# "syncthing"
37
+
38
+
# Productivity Tools
39
+
"raycast"
40
+
41
+
# AI
42
+
# "diffusionbee"
43
+
];
44
+
}
+155
hosts/darwin/default.nix
+155
hosts/darwin/default.nix
···
···
1
+
{ self, pkgs, config, ... }:
2
+
3
+
{
4
+
imports = [
5
+
./sketchybar
6
+
# ./yabai # Now using aerospace
7
+
# ./casks
8
+
# ../../modules/darwin/home-manager.nix
9
+
# ../../modules/shared
10
+
# ../../modules/shared/cachix
11
+
];
12
+
13
+
environment.systemPackages = [
14
+
pkgs.go
15
+
pkgs.python3
16
+
pkgs.cargo
17
+
pkgs.k9s
18
+
pkgs.kubernetes-helm
19
+
pkgs.shellcheck
20
+
];
21
+
22
+
age.identityPaths = [ "/Users/anishlakhwara/.ssh/id_ed25519" ];
23
+
age.secrets.work-wg.file = "${self}/secrets/work-wg.age";
24
+
age.secrets.work-wg.owner = "anishlakhwara";
25
+
networking.wg-quick.interfaces = {
26
+
wg0 = {
27
+
address = [ "10.0.69.7/24" ];
28
+
listenPort = 60990; # to match firewall allowedUDPPorts (without this wg uses random port numbers)
29
+
privateKeyFile = config.age.secrets.work-wg.path;
30
+
dns = [ "10.0.69.4" ];
31
+
postDown = ''
32
+
sudo /usr/sbin/networksetup -setdnsservers Wi-Fi "Empty"
33
+
'';
34
+
peers = [
35
+
# For a client configuration, one peer entry for the server will suffice.
36
+
{
37
+
publicKey = "c1J4p63rD3IlszugMZiki7UBV3YmDdqa3DU4UejXzAI=";
38
+
allowedIPs = [ "10.0.69.0/24" ];
39
+
# Set this to the server IP and port.
40
+
endpoint = "sealight.xyz:60990"; # ToDo: route to endpoint not automatically configured https://wiki.archlinux.org/index.php/WireGuard#Loop_routing https://discourse.nixos.org/t/solved-minimal-firewall-setup-for-wireguard-client/7577
41
+
persistentKeepalive = 25;
42
+
}
43
+
];
44
+
};
45
+
};
46
+
47
+
system.primaryUser = "anishlakhwara";
48
+
# Auto upgrade nix package and the daemon service.
49
+
nixpkgs.hostPlatform = "aarch64-darwin";
50
+
programs.zsh.enable = true;
51
+
52
+
# Setup user, packages, programs
53
+
nix = {
54
+
# package = pkgs.nixUnstable;
55
+
settings.trusted-users = [ "@admin" "anishlakhwara" ];
56
+
57
+
gc = {
58
+
automatic = true;
59
+
interval = { Weekday = 0; Hour = 2; Minute = 0; };
60
+
options = "--delete-older-than 30d";
61
+
};
62
+
63
+
# Turn this on to make command line easier
64
+
extraOptions = ''
65
+
experimental-features = nix-command flakes
66
+
'';
67
+
};
68
+
69
+
# Turn off NIX_PATH warnings now that we're using flakes
70
+
system.checks.verifyNixPath = false;
71
+
72
+
# Load configuration that is shared across systems
73
+
# environment.systemPackages = with pkgs; [
74
+
#
75
+
# ] ++ (import ../../modules/shared/packages.nix { inherit pkgs; });
76
+
77
+
# Enable fonts dir
78
+
# fonts.fontDir.enable = true;
79
+
fonts.packages = with pkgs; [
80
+
fira-code
81
+
fira-code-symbols
82
+
hermit
83
+
#hack
84
+
siji
85
+
font-awesome
86
+
proggyfonts
87
+
nerd-fonts.fira-code
88
+
nerd-fonts.droid-sans-mono
89
+
nerd-fonts.iosevka
90
+
];
91
+
92
+
system = {
93
+
stateVersion = 4;
94
+
95
+
keyboard = {
96
+
enableKeyMapping = true;
97
+
};
98
+
99
+
defaults = {
100
+
LaunchServices = {
101
+
LSQuarantine = false;
102
+
};
103
+
104
+
NSGlobalDomain = {
105
+
AppleShowAllExtensions = true;
106
+
ApplePressAndHoldEnabled = false;
107
+
108
+
# 120, 90, 60, 30, 12, 6, 2
109
+
KeyRepeat = 2;
110
+
111
+
# 120, 94, 68, 35, 25, 15
112
+
InitialKeyRepeat = 15;
113
+
114
+
"com.apple.mouse.tapBehavior" = 1;
115
+
"com.apple.sound.beep.volume" = 0.0;
116
+
"com.apple.sound.beep.feedback" = 0;
117
+
};
118
+
119
+
loginwindow = {
120
+
# disable guest account
121
+
GuestEnabled = false;
122
+
# show name instead of username
123
+
SHOWFULLNAME = false;
124
+
};
125
+
126
+
dock = {
127
+
autohide = true;
128
+
autohide-delay = 0.0;
129
+
autohide-time-modifier = 1.0;
130
+
static-only = false;
131
+
showhidden = false;
132
+
show-recents = false;
133
+
launchanim = true;
134
+
mouse-over-hilite-stack = true;
135
+
orientation = "bottom";
136
+
tilesize = 48;
137
+
mru-spaces = false;
138
+
};
139
+
140
+
finder = {
141
+
_FXShowPosixPathInTitle = false;
142
+
};
143
+
144
+
trackpad = {
145
+
Clicking = false;
146
+
TrackpadThreeFingerDrag = true;
147
+
};
148
+
};
149
+
150
+
# keyboard = {
151
+
# enableKeyMapping = true;
152
+
# remapCapsLockToControl = true;
153
+
# };
154
+
};
155
+
}
+10
hosts/darwin/sketchybar/default.nix
+10
hosts/darwin/sketchybar/default.nix
+59
hosts/darwin/sketchybar/sketchybarrc
+59
hosts/darwin/sketchybar/sketchybarrc
···
···
1
+
#!/usr/bin/env bash
2
+
3
+
source "$HOME/.config/sketchybar/variables.sh" # Loads all defined colors
4
+
5
+
# General bar and defaults
6
+
# parts I didn't want
7
+
# y_offset=5 \
8
+
# margin=5 \
9
+
10
+
sketchybar --bar height=35 \
11
+
color="$BAR_COLOR" \
12
+
shadow="$SHADOW" \
13
+
position=top \
14
+
sticky=on \
15
+
padding_right=0 \
16
+
padding_left=3 \
17
+
corner_radius="$CORNER_RADIUS" \
18
+
blur_radius=20 \
19
+
notch_width=200 \
20
+
--default updates=when_shown \
21
+
icon.font="$FONT:Bold:13.5" \
22
+
icon.color="$ICON_COLOR" \
23
+
icon.padding_left="$PADDINGS" \
24
+
icon.padding_right="$PADDINGS" \
25
+
label.font="$FONT:Bold:13.0" \
26
+
label.color="$LABEL_COLOR" \
27
+
label.padding_left="$PADDINGS" \
28
+
label.padding_right="$PADDINGS" \
29
+
background.padding_right="$PADDINGS" \
30
+
background.padding_left="$PADDINGS" \
31
+
popup.background.border_width=1 \
32
+
popup.background.corner_radius=11 \
33
+
popup.background.border_color="$POPUP_BORDER_COLOR" \
34
+
popup.background.color="$POPUP_BACKGROUND_COLOR" \
35
+
popup.background.shadow.drawing="$SHADOW"
36
+
37
+
# Left
38
+
# source "$ITEM_DIR/apple.sh"
39
+
source "$ITEM_DIR/spaces.sh"
40
+
41
+
# Center (of notch)
42
+
# source "$ITEM_DIR/spotify.sh"
43
+
source "$ITEM_DIR/front_app.sh"
44
+
45
+
# Right
46
+
source "$ITEM_DIR/clock.sh"
47
+
source "$ITEM_DIR/calendar.sh"
48
+
source "$ITEM_DIR/battery.sh"
49
+
source "$ITEM_DIR/volume.sh"
50
+
source "$ITEM_DIR/cpu.sh"
51
+
source "$ITEM_DIR/vpn.sh"
52
+
53
+
#################### Finalizing Setup ####################
54
+
55
+
# sketchybar --hotload true
56
+
57
+
sketchybar --update
58
+
59
+
echo "sketchybar configuration loaded.."
+102
hosts/darwin/yabai/default.nix
+102
hosts/darwin/yabai/default.nix
···
···
1
+
{pkgs, ... }:
2
+
3
+
{
4
+
services.yabai = {
5
+
enable = true;
6
+
config = {
7
+
mouse_follows_focus = "off";
8
+
focus_follows_mouse = "off";
9
+
window_placement = "second_child";
10
+
window_topmost = "off";
11
+
window_opacity = "off";
12
+
window_opacity_duration = 0.0;
13
+
window_shadow = "on";
14
+
window_border = "off";
15
+
window_border_placement = "inset";
16
+
window_border_width = 4;
17
+
window_border_radius = -1.0;
18
+
active_window_border_topmost = "off";
19
+
active_window_border_color = "0xff775759";
20
+
normal_window_border_color = "0xff505050";
21
+
insert_window_border_color = "0xffd75f5f";
22
+
active_window_opacity = 1.0;
23
+
normal_window_opacity = 0.9;
24
+
split_ratio = 0.73;
25
+
auto_balance = "on";
26
+
mouse_modifier = "fn";
27
+
mouse_action1 = "move";
28
+
mouse_action2 = "resize";
29
+
layout = "bsp";
30
+
top_padding = 5;
31
+
bottom_padding = 5;
32
+
left_padding = 5;
33
+
right_padding = 5;
34
+
window_gap = 5;
35
+
};
36
+
extraConfig = ''
37
+
# Do not manage windows with certain titles eg. Copying files or moving to bin
38
+
yabai -m rule --add title="(Copy|Bin|About This Mac|Info)" manage=off
39
+
# Do not manage some apps which are not resizable
40
+
yabai -m rule --add app="^(Calculator|System Preferences|[sS]tats|[Jj]et[Bb]rains [Tt]ool[Bb]ox|kftray)$" manage=off
41
+
'';
42
+
};
43
+
44
+
system.activationScripts.yabai = {
45
+
enable = true;
46
+
text = ''
47
+
yabai --install-service && yabai --start-service
48
+
'';
49
+
};
50
+
51
+
services.skhd = {
52
+
enable = true;
53
+
skhdConfig = ''
54
+
# Open iTerm2
55
+
cmd - enter : kitty --single-instance -d ~
56
+
57
+
##################
58
+
# Window Motions #
59
+
##################
60
+
# Rotate
61
+
lalt - r : yabai -m space --rotate 90
62
+
# Mirror verticaly
63
+
lalt - x : yabai -m space --mirror y-axis
64
+
# Mirror horizontaly
65
+
lalt - y : yabai -m space --mirror x-axis
66
+
# yes, i know i swapped x and y, but I mainly use y-axis and y is further...
67
+
# Fullscreen
68
+
cmd - f : yabai -m window --toggle zoom-fullscreen
69
+
# Swap
70
+
lalt - q : yabai -m window --swap west
71
+
lalt - s : yabai -m window --swap south
72
+
lalt - z : yabai -m window --swap north
73
+
lalt - d : yabai -m window --swap east
74
+
# Warp
75
+
shift + lalt - q : yabai -m window --warp west
76
+
shift + lalt - s : yabai -m window --warp south
77
+
shift + lalt - z : yabai -m window --warp north
78
+
shift + lalt - d : yabai -m window --warp east
79
+
80
+
#########
81
+
# Focus #
82
+
#########
83
+
# Clockwise
84
+
# alt - tab : yabai -m window --focus "$(yabai -m query --windows --space | jq -re "[sort_by(.id, .frame) | .[] | select(.role == \"AXWindow\" and .subrole == \"AXStandardWindow\") | .id] | nth(index($(yabai -m query --windows --window | jq -re ".id")) - 1)")"
85
+
# Counter-clockwise
86
+
# shift - tab : yabai -m window --focus "$(yabai -m query --windows --space | jq -re "[sort_by(.id, .frame) | reverse | .[] | select(.role == \"AXWindow\" and .subrole == \"AXStandardWindow\") | .id] | nth(index($(yabai -m query --windows --window | jq -re ".id")) - 1)")"
87
+
88
+
##########
89
+
# Spaces #
90
+
##########
91
+
ctrl - left : yabai -m space --focus prev
92
+
ctrl - right : yabai -m space --focus next
93
+
ctrl + shift - right : yabai -m window --space next; yabai -m space --focus next
94
+
ctrl + shift - left : yabai -m window --space prev; yabai -m space --focus prev
95
+
cmd - 1 : yabai -m window --space 1; yabai -m space --focus 1
96
+
cmd - 2 : yabai -m window --space 2; yabai -m space --focus 2
97
+
cmd - 3 : yabai -m window --space 3; yabai -m space --focus 3
98
+
cmd - 4 : yabai -m window --space 4; yabai -m space --focus 4
99
+
cmd - 5 : yabai -m window --space 5; yabai -m space --focus 5
100
+
'';
101
+
};
102
+
}
-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
-
}
···
+3
-6
hosts/helix/default.nix
+3
-6
hosts/helix/default.nix
···
11
# ../profiles/mount-mossnet
12
../profiles/freshrss
13
../profiles/microbin
14
-
../profiles/site
15
-
16
-
# ../profiles/postgres_upgrade_script
17
];
18
19
# Capsul specific
···
30
privateKeyFile = "/run/agenix/helix-wg";
31
};
32
33
-
services.postgresql.package = pkgs.postgresql_15;
34
services.postgresqlBackup = {
35
# TODO needs working wireguard to box
36
enable = false;
37
-
databases = [ "gitea" "freshrss" ]; # "woodpecker"
38
location = "/mnt/two/postgres";
39
};
40
···
44
paths = [
45
"/var/lib/gitea"
46
"/var/lib/freshrss"
47
-
# "/var/lib/woodpecker"
48
"/var/lib/microbin"
49
];
50
···
11
# ../profiles/mount-mossnet
12
../profiles/freshrss
13
../profiles/microbin
14
];
15
16
# Capsul specific
···
27
privateKeyFile = "/run/agenix/helix-wg";
28
};
29
30
+
services.postgresql.package = pkgs.postgresql_11;
31
services.postgresqlBackup = {
32
# TODO needs working wireguard to box
33
enable = false;
34
+
databases = [ "gitea" "freshrss" "woodpecker" ];
35
location = "/mnt/two/postgres";
36
};
37
···
41
paths = [
42
"/var/lib/gitea"
43
"/var/lib/freshrss"
44
+
"/var/lib/woodpecker"
45
"/var/lib/microbin"
46
];
47
+5
hosts/lituus/hardware-configuration.nix
+5
hosts/lituus/hardware-configuration.nix
+1
-1
hosts/profiles/core/default.nix
+1
-1
hosts/profiles/core/default.nix
+6
-7
hosts/profiles/desktop/default.nix
+6
-7
hosts/profiles/desktop/default.nix
···
62
};
63
64
environment.systemPackages = with pkgs; [
65
-
#unstable.sublime-music
66
unstable.nheko
67
unstable.signal-desktop
68
unstable.tuba
···
77
feh
78
sxiv
79
xkblayout-state
80
zathura
81
calibre
82
mpv
···
86
rofi
87
rofimoji
88
rofi-calc
89
obs-studio
90
lightdm
91
dunst
···
97
papirus-icon-theme
98
calendar-cli
99
wyrd
100
-
# tic-80
101
ytfzf
102
yt-dlp
103
];
···
119
night = 3700;
120
};
121
};
122
-
displayManager.defaultSession = "none+bspwm";
123
xserver = {
124
enable = true;
125
-
# TODO should be xkb.layout
126
-
xkb.layout = "us";
127
-
# xkb.variant = "dvorak";
128
desktopManager.wallpaper.mode = "fill";
129
displayManager = {
130
-
# startx.enable = true;
131
sessionCommands = ''
132
${pkgs.xorg.xrdb}/bin/xrdb -merge <<EOF
133
#define blk #1F2430
···
62
};
63
64
environment.systemPackages = with pkgs; [
65
+
unstable.sublime-music
66
unstable.nheko
67
unstable.signal-desktop
68
unstable.tuba
···
77
feh
78
sxiv
79
xkblayout-state
80
+
vcv-rack
81
zathura
82
calibre
83
mpv
···
87
rofi
88
rofimoji
89
rofi-calc
90
+
# eww
91
obs-studio
92
lightdm
93
dunst
···
99
papirus-icon-theme
100
calendar-cli
101
wyrd
102
+
tic-80
103
ytfzf
104
yt-dlp
105
];
···
121
night = 3700;
122
};
123
};
124
xserver = {
125
enable = true;
126
+
xkb.layout = "us,dvorak";
127
desktopManager.wallpaper.mode = "fill";
128
displayManager = {
129
+
defaultSession = "none+bspwm";
130
sessionCommands = ''
131
${pkgs.xorg.xrdb}/bin/xrdb -merge <<EOF
132
#define blk #1F2430
-1
hosts/profiles/dns/default.nix
-1
hosts/profiles/dns/default.nix
+1
-1
hosts/profiles/finance/default.nix
+1
-1
hosts/profiles/finance/default.nix
+7
-8
hosts/profiles/freshrss/default.nix
+7
-8
hosts/profiles/freshrss/default.nix
···
17
18
services.postgresql = {
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
-
# freshrss-users postgres freshrss
27
-
# '';
28
ensureDatabases = [ "freshrss" ];
29
ensureUsers = [{
30
name = "freshrss";
···
17
18
services.postgresql = {
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
+
'';
27
ensureDatabases = [ "freshrss" ];
28
ensureUsers = [{
29
name = "freshrss";
+10
-25
hosts/profiles/gitea/default.nix
+10
-25
hosts/profiles/gitea/default.nix
···
4
age.secrets.gitea-dbpass.file = "${self}/secrets/gitea-dbpass.age";
5
age.secrets.gitea-dbpass.owner = "gitea";
6
7
-
services.forgejo = {
8
enable = true;
9
-
user = "gitea";
10
-
group = "gitea";
11
-
stateDir = "/var/lib/gitea";
12
database = {
13
type = "postgres";
14
-
user = "gitea";
15
-
name = "gitea";
16
passwordFile = "/run/agenix/gitea-dbpass";
17
};
18
settings = {
19
-
DEFAULT.APP_NAME = "Sealight Git Forge";
20
server = {
21
DOMAIN = "git.sealight.xyz";
22
ROOT_URL = "https://git.sealight.xyz";
···
28
repository = {
29
DEFAULT_BRANCH = "main";
30
};
31
-
service.DISABLE_REGISTRATION = true;
32
"markup.restructuredtext" = {
33
ENABLED = true;
34
FILE_EXTENSIONS = ".rst";
···
48
};
49
};
50
51
-
users.users.gitea = {
52
-
home = "/var/lib/gitea";
53
-
useDefaultShell = true;
54
-
group = "gitea";
55
-
isSystemUser = true;
56
-
};
57
-
58
-
users.groups.gitea = {};
59
-
60
environment.systemPackages = [ pkgs.pandoc ];
61
services.postgresql = {
62
enable = true; # Ensure postgresql is enabled
63
-
# authentication = ''
64
-
# local gitea all ident map=gitea-users
65
-
# '';
66
-
# identMap = # Map the gitea user to postgresql
67
-
# ''
68
-
# gitea-users gitea gitea
69
-
# gitea-users postgres gitea
70
-
# '';
71
ensureDatabases = [ "gitea" ];
72
ensureUsers = [{
73
name = "gitea";
···
4
age.secrets.gitea-dbpass.file = "${self}/secrets/gitea-dbpass.age";
5
age.secrets.gitea-dbpass.owner = "gitea";
6
7
+
services.gitea = {
8
enable = true;
9
+
package = pkgs.forgejo;
10
+
appName = "Sealight Git Forge";
11
database = {
12
type = "postgres";
13
passwordFile = "/run/agenix/gitea-dbpass";
14
};
15
settings = {
16
server = {
17
DOMAIN = "git.sealight.xyz";
18
ROOT_URL = "https://git.sealight.xyz";
···
24
repository = {
25
DEFAULT_BRANCH = "main";
26
};
27
"markup.restructuredtext" = {
28
ENABLED = true;
29
FILE_EXTENSIONS = ".rst";
···
43
};
44
};
45
46
environment.systemPackages = [ pkgs.pandoc ];
47
services.postgresql = {
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
+
'';
56
ensureDatabases = [ "gitea" ];
57
ensureUsers = [{
58
name = "gitea";
+1
-10
hosts/profiles/gonic/default.nix
+1
-10
hosts/profiles/gonic/default.nix
···
5
music-path /mnt/two/music/
6
podcast-path /data/podcasts
7
cache-path /data/cache
8
-
playlists-path /data/playlists
9
'';
10
-
mossnet.gonic.user = "gonic";
11
mossnet.gonic.group = "audio";
12
networking.firewall.allowedTCPPorts = [ 4747 ];
13
-
14
-
users.users.gonic = {
15
-
# uid = config.ids.uids.headphones;
16
-
# isSystemUser = true;
17
-
group = "audio";
18
-
# home = "/var/lib/headphones";
19
-
createHome = true;
20
-
};
21
}
+4
hosts/profiles/gonic/module-gonic.nix
+4
hosts/profiles/gonic/module-gonic.nix
···
68
Group = cfg.group;
69
DevicePolicy = "closed";
70
NoNewPrivileges = " yes";
71
ProtectControlGroups = "yes";
72
ProtectKernelModules = "yes";
73
ProtectKernelTunables = "yes";
74
RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
75
SystemCallFilter = "~@clock @debug @module @mount @obsolete @privileged @reboot @setuid @swap";
76
ReadWritePaths = dataFolder;
77
StateDirectory = baseNameOf dataFolder;
···
68
Group = cfg.group;
69
DevicePolicy = "closed";
70
NoNewPrivileges = " yes";
71
+
PrivateTmp = "yes";
72
+
PrivateUsers = "yes";
73
ProtectControlGroups = "yes";
74
ProtectKernelModules = "yes";
75
ProtectKernelTunables = "yes";
76
RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
77
+
RestrictNamespaces = "yes";
78
+
RestrictRealtime = "yes";
79
SystemCallFilter = "~@clock @debug @module @mount @obsolete @privileged @reboot @setuid @swap";
80
ReadWritePaths = dataFolder;
81
StateDirectory = baseNameOf dataFolder;
-16
hosts/profiles/gpodder/default.nix
-16
hosts/profiles/gpodder/default.nix
···
1
-
{
2
-
services.gpodder.enable = true;
3
-
networking.firewall.allowedTCPPorts = [ 3005 ];
4
-
services.nginx.virtualHosts."pod.mossnet.lan" = {
5
-
extraConfig = "client_max_body_size 20M;";
6
-
7
-
locations."/" = {
8
-
extraConfig = ''
9
-
proxy_pass http://localhost:3005/;
10
-
proxy_set_header X-Forwarded-Proto $scheme;
11
-
proxy_set_header X-Real-IP $remote_addr;
12
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
13
-
'';
14
-
};
15
-
};
16
-
}
···
-1
hosts/profiles/headphones/default.nix
-1
hosts/profiles/headphones/default.nix
+1
-1
hosts/profiles/matrix/mautrix-services.nix
+1
-1
hosts/profiles/matrix/mautrix-services.nix
+2
-2
hosts/profiles/microbin/default.nix
+2
-2
hosts/profiles/microbin/default.nix
···
1
{ config, lib, pkgs, ... }:
2
{
3
services.microbin.enable = true;
4
-
services.microbin.settings.PUBLIC_PATH = "bin.sealight.xyz";
5
-
services.microbin.settings.MICROBIN_PORT = 4949;
6
networking.firewall.allowedTCPPorts = [ 4949 ];
7
services.nginx.virtualHosts."bin.sealight.xyz" = {
8
enableACME = true;
-1
hosts/profiles/mossnet-hosts/default.nix
-1
hosts/profiles/mossnet-hosts/default.nix
+2
-2
hosts/profiles/music/default.nix
+2
-2
hosts/profiles/music/default.nix
···
16
orca-c
17
supercollider
18
dirt
19
-
# sunvox
20
vcv-rack
21
lmms
22
bespokesynth
···
38
alsa.enable = true;
39
alsa.support32Bit = false;
40
pulse.enable = true;
41
-
jack.enable = true;
42
# Deprecated as of 23.05
43
# config = {
44
# pipewire."context.properties"."default.clock.rate" = "48000";
···
16
orca-c
17
supercollider
18
dirt
19
+
sunvox
20
vcv-rack
21
lmms
22
bespokesynth
···
38
alsa.enable = true;
39
alsa.support32Bit = false;
40
pulse.enable = true;
41
+
jack.enable = true;
42
# Deprecated as of 23.05
43
# config = {
44
# pipewire."context.properties"."default.clock.rate" = "48000";
+4
-3
hosts/profiles/postgres_upgrade_script/default.nix
+4
-3
hosts/profiles/postgres_upgrade_script/default.nix
···
6
# TODO it's perhaps advisable to stop all services that depend on postgresql
7
systemctl stop postgresql
8
9
# The schema can be found by running:
10
-
# nix eval --raw nixpkgs#postgresql_15.psqlSchema
11
-
export NEWDATA="/var/lib/postgresql/15"
12
13
# TODO specify the postgresql package you'd like to upgrade to
14
-
export NEWBIN="${pkgs.postgresql_15}/bin"
15
16
export OLDDATA="${config.services.postgresql.dataDir}"
17
export OLDBIN="${config.services.postgresql.package}/bin"
···
6
# TODO it's perhaps advisable to stop all services that depend on postgresql
7
systemctl stop postgresql
8
9
+
# TODO replace `<new version>` with the psqlSchema here
10
# The schema can be found by running:
11
+
# nix-instantiate '<nixpkgs>' --eval -A postgresql_14.psqlSchema
12
+
export NEWDATA="/var/lib/postgresql/<new version>"
13
14
# TODO specify the postgresql package you'd like to upgrade to
15
+
export NEWBIN="${pkgs.postgresql_14}/bin"
16
17
export OLDDATA="${config.services.postgresql.dataDir}"
18
export OLDBIN="${config.services.postgresql.package}/bin"
+1
-1
hosts/profiles/rss-bridge/default.nix
+1
-1
hosts/profiles/rss-bridge/default.nix
hosts/profiles/sync/music/get-music.sh
hosts/profiles/sync/music/get-music.sh
+2
-2
hosts/profiles/sync/website/default.nix
+2
-2
hosts/profiles/sync/website/default.nix
+1
-1
hosts/profiles/ulogger-server/default.nix
+1
-1
hosts/profiles/ulogger-server/default.nix
+67
-14
hosts/profiles/wallabag/default.nix
+67
-14
hosts/profiles/wallabag/default.nix
···
1
{ self, pkgs, config, lib, ... }:
2
3
{
4
-
age.secrets.wallabag-password.file = "${self}/secrets/wallabag-password.age";
5
-
age.secrets.wallabag-secret.file = "${self}/secrets/wallabag-secret.age";
6
-
age.secrets.wallabag-password.owner = "wallabag";
7
-
age.secrets.wallabag-secret.owner = "wallabag";
8
services.postgresql = {
9
enable = true;
10
package = pkgs.postgresql_15;
···
18
}
19
];
20
authentication = ''
21
-
local wallabag all peer
22
'';
23
};
24
25
services.wallabag = {
26
enable = true;
27
-
domain = "read.mossnet.lan";
28
-
virtualHost.enable = true;
29
-
package = pkgs.my-wallabag;
30
-
# Systemd now defaults to /var/lib?
31
-
# dataDir = "/var/lib/wallabag";
32
-
parameters = {
33
-
"env(SECRET_FILE)" = config.age.secrets.wallabag-secret.path;
34
-
secret = "%env(file:resolve:SECRET_FILE)%";
35
-
};
36
};
37
}
···
1
{ self, pkgs, config, lib, ... }:
2
3
{
4
+
# age.secrets.wallabag-password.file = "${self}/secrets/wallabag-password.age";
5
+
# age.secrets.wallabag-secret.file = "${self}/secrets/wallabag-secret.age";
6
+
# age.secrets.wallabag-password.owner = "wallabag";
7
+
# age.secrets.wallabag-secret.owner = "wallabag";
8
services.postgresql = {
9
enable = true;
10
package = pkgs.postgresql_15;
···
18
}
19
];
20
authentication = ''
21
+
local wallabag all md5
22
'';
23
};
24
25
services.wallabag = {
26
enable = true;
27
+
hostName = "read.mossnet.lan";
28
+
package = pkgs.wallabag;
29
+
conf = ''
30
+
# This file is a "template" of what your parameters.yml file should look like
31
+
parameters:
32
+
database_driver: pdo_pgsql
33
+
database_host: localhost
34
+
database_port: ~
35
+
database_name: wallabag
36
+
database_user: wallabag
37
+
database_password: wallabag
38
+
# For SQLite, database_path should be "%kernel.project_dir%/data/db/wallabag.sqlite"
39
+
database_path: ~
40
+
database_table_prefix: wallabag_
41
+
database_socket: null
42
+
# with PostgreSQL and SQLite, you must set "utf8"
43
+
database_charset: utf8
44
+
45
+
domain_name: http://read.mossnet.lan/
46
+
server_name: "mossnet wallabag instance"
47
+
48
+
mailer_dsn: null://
49
+
locale: en
50
+
51
+
# A secret key that's used to generate certain security-related tokens
52
+
secret: SAFGOECRIlfal89oe6u0(*^dsaaih961
53
+
54
+
# two factor stuff
55
+
twofactor_auth: false
56
+
twofactor_sender: no-reply@wallabag.org
57
+
58
+
# fosuser stuff
59
+
fosuser_registration: false
60
+
fosuser_confirmation: true
61
+
62
+
# how long the access token should live in seconds for the API
63
+
fos_oauth_server_access_token_lifetime: 3600
64
+
# how long the refresh token should life in seconds for the API
65
+
fos_oauth_server_refresh_token_lifetime: 1209600
66
+
67
+
from_email: ops@sealight.xyz
68
+
69
+
rss_limit: 50
70
+
71
+
# RabbitMQ processing
72
+
rabbitmq_host: localhost
73
+
rabbitmq_port: 5672
74
+
rabbitmq_user: guest
75
+
rabbitmq_password: guest
76
+
rabbitmq_prefetch_count: 10
77
+
78
+
# Redis processing
79
+
redis_scheme: tcp
80
+
redis_host: localhost
81
+
redis_port: 6379
82
+
redis_path: null
83
+
redis_password: null
84
+
85
+
# sentry logging
86
+
sentry_dsn: ~
87
+
'';
88
};
89
+
# networking.firewall.allowedTCPPorts = [ 8080 ];
90
}
+5
-10
hosts/profiles/wireguard-server/default.nix
+5
-10
hosts/profiles/wireguard-server/default.nix
···
36
publicKey = "gcdq86hhEUlqF2chqYB/F8pALyAMNFvwLycxBoHuoDs=";
37
allowedIPs = [ "10.0.69.5/32" ];
38
}
39
-
{
40
-
# hyperplane
41
-
publicKey = "v+EUuM60yZLvBmdCG9GxfFAtSjS1VvbUWcyNb8emjDg=";
42
-
allowedIPs = [ "10.0.69.6/32" ];
43
-
}
44
-
{
45
-
# work
46
-
publicKey = "/gv66s8DfppCCjaEN/jlc8z95IhEWPgDumykqKEl0QU=";
47
-
allowedIPs = [ "10.0.69.7/32" ];
48
-
}
49
];
50
};
51
}
+1
-4
hosts/users/anish/default.nix
+1
-4
hosts/users/anish/default.nix
···
4
programs.zsh.enable = true;
5
users.users.anish = {
6
description = "Personal user for Anish";
7
-
hashedPassword =
8
-
"$y$j9T$y3DPt/dWaPE.gRazQqw1w0$1RMH5sl/Nu8kW3ZMywYCPRniHD/jF5qRh0VKrdJ.bV2";
9
shell = pkgs.zsh;
10
isNormalUser = true;
11
extraGroups = [ "wheel" "audio" "networkmanager" "video" ];
···
16
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDtU2GMYjXj6RGO1+mwM4TDGOo0qrKLTL4Di8+QgDX0p5vUEsnE1PS9wnuqCmSu75U8g0XIAMtvtdYyGk1N+Bx01erAZpT8DLYtIXFCyaiN28PVu5T1D0T+TQ7xgIH1qenXZR2DOQdf6kpvKEfm7+7bWhCo0N/KFMpmReubyzHDQcq/1qQasxTL+YALQFOjwKqsOTBXbHwZ103AEAcQX4ftBFEOfVli4/1aKIK4dNSZYB7J9Htq707YnsEqo9RLAMh0aOTTYgTx9AoSUDeqGuh/AGkcB7NcS7EEtI6d5YUGylwZh/gF6hqE0jl8kn2m5jMKXL3CRohZvjifue8x/GIjpu5WRabUuhBEbrfTQQaC7taHnt5rvYCGzKZx09TexUzhuz2CL480DRoxSG+P+lCNm1dIg/EZrnGEzXCSr36PlOqS5t5gm8tPkzCmZf2wU15A3ZIYUPmnYLqsn4WmIV7rKmdqt2ctWELUXow3PPiZXBucP9P3xpsYEfF1SB2SGNc= u0_a139@localhost"
17
# Box
18
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKN8/SH55DBiwVoSnTU8k2Pen+wmovL9QaMyehxGEsJJv/8fzwsswGalD4C/4O51LOvdu4UKkZW5hG02uVSK+58p3UV3pOPyoqsu/aDeIsWsqmTeTzUrBIWOlNzcDKnohLz2oGC5YO+wyTJ9Iteq6aGJDjErsW7sG3h5lXCs551EmJNNGhtBQaaoytMNnWqSdlVjDNCijurH7WUpp40U/RjEp532l4rX6eIIj3jBKEFbhZkFSSjqbj4xM4SyFt+Jmigb1RMjsQjmpfY1vDtM84RcYfpTUte/T5w2dkD5H6kccmWnwKSJpm9wXfx4E7lR9APdUGnau2U1+XxiD3ytGl anish@box"
19
-
# Work
20
-
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/vvh0i6+uAN0GWlK6ZfyTlc/AW54xe2CroUDsDSoGnFKeIUiSsWexobODlVakNhqwCKfsvUh6g+RdA8ZVcamATcYqxysP4X5fRksmAzRm5281O7ZBDHMB2BdcfHSTgiz7JvMRIQYWDlU8Ck6IL4wlN0b2GMUj9t/GeG37us8280rxpRNoIY7M27AJEZ7XNQhctBIVujxctVBgIMYmZiTwziU7ywJv4rNT5OAWvjRXSo1rkxdvx3VESv4y/mp8m7dEupZpIjIFsLs52+UG5LtadulUqtTWg05sCw8LEcmRhflgZSAvjw60RrKFCuWxc8+/Pmaw+zExeBMenqi0NzuTc3S3k2wCKVIZDh/0tlXzIwZ6WRqxDevUtEKfvbEFMXd8akhTfYs0dyszcFRevBxOBPbcKku+FK/HkdPLmEANvxYty3cv+Eipkz3c8JPJPvXNTXrjepXMm0LUKodO3c15hGogCOxUO38kykkyYnn+MxxHparoMfEr2+oHNpQoS5wA1G43ppqjVoRDgnhleu6ixwRkLZzphY3cnOd5jL9Ie5xIGbFWH1qSlQRdHBkHjuf85z7+QK8nFYAhmG1K3Vt3GNtF8LN1tYQkfwBJ/vsroMNzGPoq4PjVbqb80Eq+96cP89XKfU2/xw1g+p2lJDm/zC1WCjXVzf8NRwC7gqPavQ== anishlakhwara@anishs-mbp.lan"
21
];
22
};
23
}
···
4
programs.zsh.enable = true;
5
users.users.anish = {
6
description = "Personal user for Anish";
7
+
hashedPassword = "$y$j9T$y3DPt/dWaPE.gRazQqw1w0$1RMH5sl/Nu8kW3ZMywYCPRniHD/jF5qRh0VKrdJ.bV2";
8
shell = pkgs.zsh;
9
isNormalUser = true;
10
extraGroups = [ "wheel" "audio" "networkmanager" "video" ];
···
15
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDtU2GMYjXj6RGO1+mwM4TDGOo0qrKLTL4Di8+QgDX0p5vUEsnE1PS9wnuqCmSu75U8g0XIAMtvtdYyGk1N+Bx01erAZpT8DLYtIXFCyaiN28PVu5T1D0T+TQ7xgIH1qenXZR2DOQdf6kpvKEfm7+7bWhCo0N/KFMpmReubyzHDQcq/1qQasxTL+YALQFOjwKqsOTBXbHwZ103AEAcQX4ftBFEOfVli4/1aKIK4dNSZYB7J9Htq707YnsEqo9RLAMh0aOTTYgTx9AoSUDeqGuh/AGkcB7NcS7EEtI6d5YUGylwZh/gF6hqE0jl8kn2m5jMKXL3CRohZvjifue8x/GIjpu5WRabUuhBEbrfTQQaC7taHnt5rvYCGzKZx09TexUzhuz2CL480DRoxSG+P+lCNm1dIg/EZrnGEzXCSr36PlOqS5t5gm8tPkzCmZf2wU15A3ZIYUPmnYLqsn4WmIV7rKmdqt2ctWELUXow3PPiZXBucP9P3xpsYEfF1SB2SGNc= u0_a139@localhost"
16
# Box
17
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKN8/SH55DBiwVoSnTU8k2Pen+wmovL9QaMyehxGEsJJv/8fzwsswGalD4C/4O51LOvdu4UKkZW5hG02uVSK+58p3UV3pOPyoqsu/aDeIsWsqmTeTzUrBIWOlNzcDKnohLz2oGC5YO+wyTJ9Iteq6aGJDjErsW7sG3h5lXCs551EmJNNGhtBQaaoytMNnWqSdlVjDNCijurH7WUpp40U/RjEp532l4rX6eIIj3jBKEFbhZkFSSjqbj4xM4SyFt+Jmigb1RMjsQjmpfY1vDtM84RcYfpTUte/T5w2dkD5H6kccmWnwKSJpm9wXfx4E7lR9APdUGnau2U1+XxiD3ytGl anish@box"
18
];
19
};
20
}
install-encrypted.sh
install-encrypted.sh
+2
-2
install-yubikey.sh
+2
-2
install-yubikey.sh
···
19
20
# Yubikey Setup
21
SLOT=2
22
-
# ykpersonalize -"$SLOT" -ochal-resp -ochal-hmac
23
SALT_LENGTH=16
24
salt="$(dd if=/dev/random bs=1 count=$SALT_LENGTH 2>/dev/null | rbtohex)"
25
k_user=PASSWORDCHANGEMEPLAEASES
···
147
sound.enable = true;
148
hardware.pulseaudio.enable = true;
149
150
-
services.libinput.enable = true;
151
152
# Hmmm maybe somewhere else?
153
users.users.anish = {
···
19
20
# Yubikey Setup
21
SLOT=2
22
+
ykpersonalize -"$SLOT" -ochal-resp -ochal-hmac
23
SALT_LENGTH=16
24
salt="$(dd if=/dev/random bs=1 count=$SALT_LENGTH 2>/dev/null | rbtohex)"
25
k_user=PASSWORDCHANGEMEPLAEASES
···
147
sound.enable = true;
148
hardware.pulseaudio.enable = true;
149
150
+
services.xserver.libinput.enable = true;
151
152
# Hmmm maybe somewhere else?
153
users.users.anish = {
+12
modules/darwin/README.md
+12
modules/darwin/README.md
···
···
1
+
2
+
## Layout
3
+
```
4
+
.
5
+
โโโ dock # MacOS dock configuration
6
+
โโโ casks.nix # List of homebrew casks
7
+
โโโ default.nix # Defines module, system-level config
8
+
โโโ files.nix # Non-Nix, static configuration files (now immutable!)
9
+
โโโ home-manager.nix # Defines user programs
10
+
โโโ packages.nix # List of packages to install for MacOS
11
+
โโโ secrets.nix # Age-encrypted secrets with agenix
12
+
```
+67
modules/darwin/dock/default.nix
+67
modules/darwin/dock/default.nix
···
···
1
+
{ config, pkgs, lib, ... }:
2
+
with lib;
3
+
let
4
+
cfg = config.local.dock;
5
+
inherit (pkgs) stdenv dockutil;
6
+
in
7
+
{
8
+
options = {
9
+
local.dock.enable = mkOption {
10
+
description = "Enable dock";
11
+
default = stdenv.isDarwin;
12
+
example = false;
13
+
};
14
+
15
+
local.dock.entries = mkOption
16
+
{
17
+
description = "Entries on the Dock";
18
+
type = with types; listOf (submodule {
19
+
options = {
20
+
path = lib.mkOption { type = str; };
21
+
section = lib.mkOption {
22
+
type = str;
23
+
default = "apps";
24
+
};
25
+
options = lib.mkOption {
26
+
type = str;
27
+
default = "";
28
+
};
29
+
};
30
+
});
31
+
readOnly = true;
32
+
};
33
+
};
34
+
35
+
config =
36
+
mkIf cfg.enable
37
+
(
38
+
let
39
+
normalize = path: if hasSuffix ".app" path then path + "/" else path;
40
+
entryURI = path: "file://" + (builtins.replaceStrings
41
+
[" " "!" "\"" "#" "$" "%" "&" "'" "(" ")"]
42
+
["%20" "%21" "%22" "%23" "%24" "%25" "%26" "%27" "%28" "%29"]
43
+
(normalize path)
44
+
);
45
+
wantURIs = concatMapStrings
46
+
(entry: "${entryURI entry.path}\n")
47
+
cfg.entries;
48
+
createEntries = concatMapStrings
49
+
(entry: "${dockutil}/bin/dockutil --no-restart --add '${entry.path}' --section ${entry.section} ${entry.options}\n")
50
+
cfg.entries;
51
+
in
52
+
{
53
+
system.activationScripts.postUserActivation.text = ''
54
+
echo >&2 "Setting up the Dock..."
55
+
haveURIs="$(${dockutil}/bin/dockutil --list | ${pkgs.coreutils}/bin/cut -f2)"
56
+
if ! diff -wu <(echo -n "$haveURIs") <(echo -n '${wantURIs}') >&2 ; then
57
+
echo >&2 "Resetting Dock."
58
+
${dockutil}/bin/dockutil --no-restart --remove all
59
+
${createEntries}
60
+
killall Dock
61
+
else
62
+
echo >&2 "Dock setup complete."
63
+
fi
64
+
'';
65
+
}
66
+
);
67
+
}
+54
modules/darwin/files.nix
+54
modules/darwin/files.nix
···
···
1
+
{ user, config, pkgs, ... }:
2
+
3
+
let
4
+
xdg_configHome = "${config.users.users.${user}.home}/.config";
5
+
xdg_dataHome = "${config.users.users.${user}.home}/.local/share";
6
+
xdg_stateHome = "${config.users.users.${user}.home}/.local/state"; in
7
+
{
8
+
9
+
# Raycast script so that "Run Emacs" is available and uses Emacs daemon
10
+
"${xdg_dataHome}/bin/emacsclient" = {
11
+
executable = true;
12
+
text = ''
13
+
#!/bin/zsh
14
+
#
15
+
# Required parameters:
16
+
# @raycast.schemaVersion 1
17
+
# @raycast.title Run Emacs
18
+
# @raycast.mode silent
19
+
#
20
+
# Optional parameters:
21
+
# @raycast.packageName Emacs
22
+
# @raycast.icon ${xdg_dataHome}/img/icons/Emacs.icns
23
+
# @raycast.iconDark ${xdg_dataHome}/img/icons/Emacs.icns
24
+
25
+
if [[ $1 = "-t" ]]; then
26
+
# Terminal mode
27
+
${pkgs.emacs}/bin/emacsclient -t $@
28
+
else
29
+
# GUI mode
30
+
${pkgs.emacs}/bin/emacsclient -c -n $@
31
+
fi
32
+
'';
33
+
};
34
+
35
+
# Script to import Drafts into Emacs org-roam
36
+
"${xdg_dataHome}/bin/import-drafts" = {
37
+
executable = true;
38
+
text = ''
39
+
#!/bin/sh
40
+
41
+
for f in ${xdg_stateHome}/drafts/*
42
+
do
43
+
if [[ ! "$f" =~ "done" ]]; then
44
+
echo "Importing $f"
45
+
filename="$(head -c 10 $f)"
46
+
output="${xdg_dataHome}/org-roam/daily/$filename.org"
47
+
echo '\n' >> "$output"
48
+
tail -n +3 $f >> "$output"
49
+
mv $f done
50
+
fi
51
+
done
52
+
'';
53
+
};
54
+
}
+85
modules/darwin/home-manager.nix
+85
modules/darwin/home-manager.nix
···
···
1
+
{ config, pkgs, lib, home-manager, ... }:
2
+
3
+
let
4
+
user = "anishlakhwara";
5
+
# Define the content of your file as a derivation
6
+
myEmacsLauncher = pkgs.writeScript "emacs-launcher.command" ''
7
+
#!/bin/sh
8
+
emacsclient -c -n &
9
+
'';
10
+
sharedFiles = import ../shared/files.nix { inherit config pkgs; };
11
+
additionalFiles = import ./files.nix { inherit user config pkgs; };
12
+
in
13
+
{
14
+
imports = [
15
+
./dock
16
+
];
17
+
18
+
# It me
19
+
users.users.${user} = {
20
+
name = "${user}";
21
+
home = "/Users/${user}";
22
+
isHidden = false;
23
+
shell = pkgs.zsh;
24
+
};
25
+
26
+
# Enable home-manager
27
+
home-manager = {
28
+
useGlobalPkgs = true;
29
+
users.${user} = { pkgs, config, lib, ... }:{
30
+
home = {
31
+
enableNixpkgsReleaseCheck = false;
32
+
packages = pkgs.callPackage ./packages.nix {};
33
+
file = lib.mkMerge [
34
+
sharedFiles
35
+
additionalFiles
36
+
{ "emacs-launcher.command".source = myEmacsLauncher; }
37
+
];
38
+
39
+
stateVersion = "23.11";
40
+
};
41
+
42
+
programs = {} // import ../shared/home-manager.nix { inherit config pkgs lib; };
43
+
44
+
# Marked broken Oct 20, 2022 check later to remove this
45
+
# https://github.com/nix-community/home-manager/issues/3344
46
+
manual.manpages.enable = false;
47
+
};
48
+
};
49
+
50
+
# Fully declarative dock using the latest from Nix Store
51
+
local = {
52
+
dock.enable = true;
53
+
dock.entries = [
54
+
{ path = "/Applications/Slack.app/"; }
55
+
{ path = "/System/Applications/Messages.app/"; }
56
+
{ path = "/System/Applications/Facetime.app/"; }
57
+
{ path = "/Applications/Telegram.app/"; }
58
+
{ path = "${pkgs.alacritty}/Applications/Alacritty.app/"; }
59
+
{ path = "/System/Applications/Music.app/"; }
60
+
{ path = "/System/Applications/News.app/"; }
61
+
{ path = "/System/Applications/Photos.app/"; }
62
+
{ path = "/System/Applications/Photo Booth.app/"; }
63
+
{ path = "/System/Applications/TV.app/"; }
64
+
{ path = "${pkgs.jetbrains.phpstorm}/Applications/PhpStorm.app/"; }
65
+
{ path = "/Applications/TablePlus.app/"; }
66
+
{ path = "/Applications/Asana.app/"; }
67
+
{ path = "/Applications/Drafts.app/"; }
68
+
{ path = "/System/Applications/Home.app/"; }
69
+
{
70
+
path = toString myEmacsLauncher;
71
+
section = "others";
72
+
}
73
+
{
74
+
path = "${config.users.users.${user}.home}/.local/share/";
75
+
section = "others";
76
+
options = "--sort name --view grid --display folder";
77
+
}
78
+
{
79
+
path = "${config.users.users.${user}.home}/.local/share/downloads";
80
+
section = "others";
81
+
options = "--sort name --view grid --display stack";
82
+
}
83
+
];
84
+
};
85
+
}
+7
modules/darwin/packages.nix
+7
modules/darwin/packages.nix
+47
modules/darwin/secrets.nix
+47
modules/darwin/secrets.nix
···
···
1
+
{ config, pkgs, agenix, secrets, ... }:
2
+
3
+
let user = "dustin"; in
4
+
{
5
+
age = {
6
+
identityPaths = [
7
+
"/Users/${user}/.ssh/id_ed25519"
8
+
];
9
+
10
+
secrets = {
11
+
"syncthing-cert" = {
12
+
symlink = true;
13
+
path = "/Users/${user}/Library/Application Support/Syncthing/cert.pem";
14
+
file = "${secrets}/darwin-syncthing-cert.age";
15
+
mode = "644";
16
+
owner = "${user}";
17
+
group = "staff";
18
+
};
19
+
20
+
"syncthing-key" = {
21
+
symlink = true;
22
+
path = "/Users/${user}/Library/Application Support/Syncthing/key.pem";
23
+
file = "${secrets}/darwin-syncthing-key.age";
24
+
mode = "600";
25
+
owner = "${user}";
26
+
group = "staff";
27
+
};
28
+
29
+
"github-ssh-key" = {
30
+
symlink = true;
31
+
path = "/Users/${user}/.ssh/id_github";
32
+
file = "${secrets}/github-ssh-key.age";
33
+
mode = "600";
34
+
owner = "${user}";
35
+
group = "staff";
36
+
};
37
+
38
+
"github-signing-key" = {
39
+
symlink = false;
40
+
path = "/Users/${user}/.ssh/pgp_github.key";
41
+
file = "${secrets}/github-signing-key.age";
42
+
mode = "600";
43
+
owner = "${user}";
44
+
};
45
+
};
46
+
};
47
+
}
+1
-2
modules/nixos/default.nix
+1
-2
modules/nixos/default.nix
-120
modules/nixos/gpodder2go.nix
-120
modules/nixos/gpodder2go.nix
···
1
-
{ self, config, lib, pkgs, ... }:
2
-
3
-
with lib;
4
-
5
-
let
6
-
cfg = config.services.gpodder;
7
-
in
8
-
{
9
-
options = {
10
-
11
-
services.gpodder = {
12
-
enable = mkEnableOption "A gpodder instance";
13
-
14
-
user = mkOption {
15
-
type = types.str;
16
-
default = "gpodder";
17
-
description = "User account under which gpodder runs.";
18
-
};
19
-
20
-
group = mkOption {
21
-
type = types.str;
22
-
default = "gpodder";
23
-
description = "Group account under which gpodder runs.";
24
-
};
25
-
26
-
hostname = mkOption {
27
-
type = types.str;
28
-
description = "Hostname of your gpodder service";
29
-
};
30
-
31
-
dataFolder = mkOption {
32
-
type = types.str;
33
-
default = "/var/lib/gpodder";
34
-
description = "State director";
35
-
};
36
-
37
-
VERIFIER_SECRET_KEY = mkOption {
38
-
type = types.str;
39
-
default = "satnheiycglsrcgaecrlufg";
40
-
description = "Verifer Secret";
41
-
};
42
-
43
-
};
44
-
};
45
-
46
-
config = mkIf cfg.enable {
47
-
systemd.services.gpodder = {
48
-
description = "gpodder2go A gpodder instance";
49
-
after = [ "remote-fs.target" "network.target" ];
50
-
wantedBy = [ "multi-user.target" ];
51
-
serviceConfig = {
52
-
ExecStart = "${pkgs.gpodder2go}/bin/gpodder2go serve";
53
-
Environment = [
54
-
"VERIFIER_SECRET_KEY=${cfg.VERIFIER_SECRET_KEY}"
55
-
];
56
-
WorkingDirectory = cfg.dataFolder;
57
-
TimeoutStopSec = " 20 ";
58
-
KillMode = " process ";
59
-
RestartSec = " 10 ";
60
-
User = cfg.user;
61
-
Group = cfg.group;
62
-
DevicePolicy = " closed ";
63
-
NoNewPrivileges = " yes ";
64
-
PrivateTmp = " yes ";
65
-
PrivateUsers = " yes ";
66
-
ProtectControlGroups = " yes ";
67
-
ProtectKernelModules = " yes ";
68
-
ProtectKernelTunables = " yes ";
69
-
RestrictAddressFamilies = "
70
-
AF_UNIX
71
-
AF_INET
72
-
AF_INET6 ";
73
-
RestrictNamespaces = " yes ";
74
-
RestrictRealtime = " yes ";
75
-
SystemCallFilter = "~@clock @debug @module @mount @obsolete @privileged @reboot @setuid @swap";
76
-
ReadWritePaths = cfg.dataFolder;
77
-
StateDirectory = baseNameOf cfg.dataFolder;
78
-
};
79
-
};
80
-
81
-
users.users = optionalAttrs (cfg.user == "gpodder") ({
82
-
gpodder = {
83
-
description = "gpodder service user";
84
-
name = cfg.user;
85
-
group = cfg.group;
86
-
isSystemUser = true;
87
-
};
88
-
});
89
-
90
-
users.groups = optionalAttrs (cfg.group == "gpodder") ({
91
-
gpodder = { };
92
-
});
93
-
94
-
# systemd.services.gpodder-install = {
95
-
# description = "gpodder install service";
96
-
# wantedBy = [ "multi-user.target" ];
97
-
# before = [ "gpodder.service" ];
98
-
# path = with pkgs; [ gpodder2go ];
99
-
100
-
# serviceConfig = {
101
-
# User = cfg.user;
102
-
# Type = "oneshot";
103
-
# CacheDirectory = "gpodder";
104
-
# # Stores sessions.
105
-
# CacheDirectoryMode = "700";
106
-
# ConfigurationDirectory = "gpodder";
107
-
# LogsDirectory = "gpodder";
108
-
# StateDirectory = "gpodder";
109
-
# };
110
-
111
-
# script = ''
112
-
# if [ ! -f "${cfg.dataFolder}/installed" ]; then
113
-
# ${pkgs.gpodder2go}/bin/gpodder2go init
114
-
# touch "${cfg.dataFolder}/installed"
115
-
# fi
116
-
# '';
117
-
# };
118
-
};
119
-
}
120
-
···
+212
-198
modules/nixos/wallabag.nix
+212
-198
modules/nixos/wallabag.nix
···
1
-
{ config, lib, pkgs, ... }:
2
let
3
-
# Based on https://github.com/wallabag/wallabag/blob/2.6.6/app/config/parameters.yml.dist
4
-
settings = {
5
-
database_driver = "${cfg.database_type}";
6
-
database_host = null;
7
-
database_port = 5432;
8
-
database_name = "wallabag";
9
-
database_user = "wallabag";
10
-
database_password = null;
11
-
database_path = null;
12
-
database_table_prefix = "wallabag_";
13
-
database_socket = "/run/postgresql";
14
-
database_charset = "utf8";
15
16
-
domain_name = "http://${cfg.domain}";
17
-
server_name = "Wallabag";
18
19
-
# Needs an explicit command since Symfony version used by Wallabag does not yet support the `native` transport
20
-
# and the `sendmail` transport does not respect `sendmail_path` configured in `php.ini`.
21
-
mailer_dsn = "sendmail://default?command=/run/wrappers/bin/sendmail%%20-t%%20-i";
22
23
-
locale = "en";
24
25
-
# A secret key that's used to generate certain security-related tokens.
26
-
# "env(SECRET_FILE)" = "/run/secrets/wallabag";
27
-
# secret = "%env(file:resolve:SECRET_FILE)%";
28
29
-
# two factor stuff
30
-
twofactor_auth = false;
31
-
twofactor_sender = "";
32
33
-
# fosuser stuff
34
-
fosuser_registration = false;
35
-
fosuser_confirmation = false;
36
37
-
# how long the access token should live in seconds for the API
38
-
fos_oauth_server_access_token_lifetime = 3600;
39
-
# how long the refresh token should life in seconds for the API
40
-
fos_oauth_server_refresh_token_lifetime = 1209600;
41
42
-
from_email = "wallabag@read.mossnet.lan";
43
44
-
# RabbitMQ processing
45
-
redis_scheme = "unix";
46
-
redis_host = ""; # Ignored for unix scheme
47
-
redis_port = 0; # Ignored for unix scheme
48
-
redis_path = config.services.redis.servers.wallabag.unixSocket;
49
-
redis_password = null;
50
51
-
# Redis processing
52
-
rabbitmq_host = "";
53
-
rabbitmq_port = 0;
54
-
rabbitmq_user = "";
55
-
rabbitmq_password = "";
56
-
rabbitmq_prefetch_count = 0;
57
58
-
# sentry logging
59
-
sentry_dsn = null;
60
-
} // cfg.parameters;
61
62
-
php = cfg.php.package.withExtensions ({ enabled, all }: enabled ++ (with all; [
63
-
imagick
64
-
tidy
65
-
]));
66
-
67
-
commonServiceConfig = {
68
-
CacheDirectory = "wallabag";
69
-
# Stores sessions.
70
-
CacheDirectoryMode = "700";
71
-
ConfigurationDirectory = "wallabag";
72
-
LogsDirectory = "wallabag";
73
-
StateDirectory = "wallabag";
74
-
# Stores site-credentials-secret-key.txt.
75
-
StateDirectoryMode = "700";
76
-
};
77
-
78
-
cfg = config.services.wallabag;
79
-
in {
80
-
options.services.wallabag = with lib; {
81
-
enable = mkEnableOption (mdDoc "Wallabag read-it-later service");
82
-
83
-
package = mkOption {
84
-
type = types.package;
85
-
default = pkgs.wallabag;
86
-
};
87
-
88
-
php.package = mkOption {
89
-
type = types.package;
90
-
default = pkgs.php;
91
-
};
92
-
93
-
parameters = mkOption {
94
-
type = types.attrsOf types.str;
95
-
default = {};
96
-
description = mdDoc "Parameters to override from the default. See <https://doc.wallabag.org/en/admin/parameters.html> for values.";
97
-
};
98
99
-
database_type = mkOption {
100
-
type = types.enum [
101
-
"pdo_sqlite3"
102
-
"pdo_pgsql"
103
-
];
104
-
default = if config.services.postgresql.enable
105
-
then "pdo_pgsql"
106
-
else "pdo_sqlite3";
107
-
defaultText = ''
108
-
if config.services.postgresql.enable
109
-
then "pdo_pgsql"
110
-
else "pdo_sqlite3"
111
-
'';
112
-
description = mdDoc ''
113
-
The database engine name. Can be pdo_sqlite3 or pdo_pgsql.
114
-
'';
115
};
116
117
-
domain = mkOption {
118
-
type = types.str;
119
-
description = "Bare domain name for Wallabag";
120
-
};
121
122
-
virtualHost.enable = mkEnableOption (mdDoc "Define nginx virtualhost for Wallabag");
123
-
};
124
125
-
config = lib.mkIf cfg.enable {
126
-
environment.etc."wallabag/parameters.yml" = {
127
-
source = pkgs.writeTextFile {
128
-
name = "wallabag-config";
129
-
text = builtins.toJSON {
130
-
parameters = settings;
131
-
};
132
};
133
};
134
135
-
services.nginx = lib.mkIf cfg.virtualHost.enable {
136
-
enable = true;
137
138
-
virtualHosts = {
139
-
"${cfg.domain}" = {
140
-
root = "${pkgs.wallabag}/web";
141
142
-
extraConfig = ''
143
-
add_header X-Frame-Options SAMEORIGIN;
144
-
add_header X-Content-Type-Options nosniff;
145
-
add_header X-XSS-Protection "1; mode=block";
146
-
'';
147
148
-
locations."/" = {
149
-
extraConfig = ''
150
-
try_files $uri /app.php$is_args$args;
151
-
'';
152
-
};
153
154
-
locations."/assets".root = "${pkgs.wallabag}/app/web";
155
156
-
locations."~ ^/app\\.php(/|$)" = {
157
-
extraConfig = ''
158
-
fastcgi_pass unix:${config.services.phpfpm.pools.wallabag.socket};
159
-
include ${config.services.nginx.package}/conf/fastcgi.conf;
160
-
fastcgi_param PATH_INFO $fastcgi_path_info;
161
-
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
162
-
fastcgi_param SCRIPT_FILENAME ${pkgs.wallabag}/web/$fastcgi_script_name;
163
-
fastcgi_param DOCUMENT_ROOT ${pkgs.wallabag}/web;
164
-
fastcgi_read_timeout 120;
165
-
internal;
166
-
'';
167
-
};
168
169
-
locations."~ /(?!app)\\.php$" = {
170
-
extraConfig = ''
171
-
return 404;
172
-
'';
173
-
};
174
-
};
175
};
176
-
};
177
178
-
services.phpfpm.pools.wallabag = {
179
-
user = config.users.users.wallabag.name;
180
-
phpPackage = php;
181
-
settings = {
182
-
"catch_workers_output" = true;
183
184
-
"listen.owner" = config.services.nginx.user;
185
-
"listen.group" = "root";
186
-
"pm" = "dynamic";
187
-
"pm.max_children" = 5;
188
-
"pm.start_servers" = 2;
189
-
"pm.min_spare_servers" = 1;
190
-
"pm.max_spare_servers" = 3;
191
-
"php_admin_value[error_log]" = "/var/log/wallabag/error.log";
192
-
"php_admin_value[access_log]" = "/var/log/wallabag/access.log";
193
-
"php_admin_flag[log_errors]" = true;
194
};
195
-
phpOptions = ''
196
-
; Set up $_ENV superglobal.
197
-
; http://php.net/request-order
198
-
variables_order = "EGPCS"
199
-
# Wallabag will crash on start-up.
200
-
# https://github.com/wallabag/wallabag/issues/6042
201
-
# error_reporting = E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED
202
-
'';
203
-
settings = {
204
-
# Accept settings from the systemd service.
205
-
clear_env = false;
206
};
207
};
208
209
-
users.users.wallabag = {
210
-
isSystemUser = true;
211
-
group = "wallabag";
212
-
};
213
-
users.groups.wallabag = {};
214
-
services.redis.servers.wallabag = {
215
-
enable = true;
216
-
user = "wallabag";
217
-
};
218
-
services.rabbitmq.enable = false;
219
-
220
-
systemd.services.phpfpm-wallabag.serviceConfig = commonServiceConfig;
221
-
222
systemd.services.wallabag-install = {
223
description = "Wallabag install service";
224
wantedBy = [ "multi-user.target" ];
225
before = [ "phpfpm-wallabag.service" ];
226
-
after = [ "postgresql.service" ];
227
path = with pkgs; [ coreutils php phpPackages.composer ];
228
229
serviceConfig = {
230
-
User = "wallabag";
231
Type = "oneshot";
232
-
} // commonServiceConfig;
233
234
script = ''
235
-
if [ ! -f "$STATE_DIRECTORY/installed" ]; then
236
-
php ${pkgs.wallabag}/bin/console --env=prod wallabag:install
237
-
touch "$STATE_DIRECTORY/installed"
238
-
else
239
-
php ${pkgs.wallabag}/bin/console --env=prod doctrine:migrations:migrate --no-interaction
240
-
fi
241
-
php ${pkgs.wallabag}/bin/console --env=prod cache:clear
242
-
'';
243
};
244
};
245
}
···
1
+
{ config, options, lib, pkgs, ... }:
2
+
3
+
with lib;
4
let
5
+
cfg = config.services.wallabag;
6
7
+
poolName = "wallabag";
8
9
+
configFile = pkgs.writeTextFile {
10
+
name = "wallabag-config";
11
+
text = cfg.conf;
12
+
destination = "/app/config/parameters.yml";
13
+
};
14
15
+
appDir = pkgs.buildEnv {
16
+
name = "wallabag-app-dir";
17
+
ignoreCollisions = true;
18
+
checkCollisionContents = false;
19
+
paths = [ configFile "${cfg.package}" ];
20
+
pathsToLink = [ "/app" "/src" "/translations" ];
21
+
};
22
23
+
# See there for available commands:
24
+
# https://doc.wallabag.org/en/admin/console_commands.html
25
+
# A user can be made admin with the fos:user:promote --super <user> command
26
+
console = pkgs.writeShellScriptBin "wallabag-console" ''
27
+
export WALLABAG_DATA="${cfg.dataDir}"
28
+
cd "${cfg.dataDir}"
29
+
${pkgs.php}/bin/php ${pkgs.wallabag}/bin/console --env=prod $@
30
+
'';
31
32
+
in
33
+
{
34
35
+
options = {
36
37
+
services.wallabag = {
38
+
enable = mkEnableOption "wallabag";
39
40
+
user = mkOption {
41
+
type = types.str;
42
+
default = "nginx";
43
+
description = ''
44
+
User account under which both the update daemon and the web-application run.
45
+
'';
46
+
};
47
48
+
dataDir = mkOption {
49
+
type = types.path;
50
+
default = "/var/lib/wallabag";
51
+
description = ''
52
+
Data directory.
53
+
'';
54
+
};
55
56
+
package = mkOption {
57
+
type = types.package;
58
+
default = pkgs.wallabag;
59
+
description = ''
60
+
Wallabag package to use.
61
+
'';
62
+
};
63
64
+
hostName = mkOption {
65
+
type = types.str;
66
+
description = ''
67
+
Name of the nginx virtualhost to use and setup.
68
+
'';
69
+
};
70
71
+
poolConfig = mkOption {
72
+
type = types.lines;
73
+
default = ''
74
+
pm = dynamic
75
+
pm.max_children = 75
76
+
pm.start_servers = 1
77
+
pm.min_spare_servers = 1
78
+
pm.max_spare_servers = 20
79
+
pm.max_requests = 500
80
+
catch_workers_output = 1
81
+
'';
82
+
description = ''
83
+
Options for wallabag's PHP pool. See the documentation on <literal>php-fpm.conf</literal> for details on configuration directives.
84
+
'';
85
+
};
86
87
+
conf = mkOption {
88
+
type = types.str;
89
+
description = ''
90
+
Contents of the wallabag configuration file (parameters.yml)
91
+
'';
92
+
};
93
};
94
+
};
95
96
97
+
config = mkIf cfg.enable {
98
99
+
services.phpfpm.pools."${poolName}" = {
100
+
user = "${cfg.user}";
101
+
group = "nginx";
102
+
phpPackage = pkgs.php;
103
+
phpEnv = {
104
+
WALLABAG_DATA = cfg.dataDir;
105
+
PATH = lib.makeBinPath [pkgs.php];
106
+
};
107
+
settings = {
108
+
"listen.owner" = "nginx";
109
+
"listen.group" = "nginx";
110
+
"listen.mode" = "0600";
111
+
"user" = "${cfg.user}";
112
+
"group" = "nginx";
113
+
"pm" = "dynamic";
114
+
"pm.max_children" = "75";
115
+
"pm.min_spare_servers" = "5";
116
+
"pm.max_spare_servers" = "20";
117
+
"pm.max_requests" = "10";
118
+
"catch_workers_output" = "1";
119
+
"php_admin_value[error_log]" = "stderr";
120
+
"php_admin_flag[log_errors]" = true;
121
};
122
};
123
+
services.phpfpm.phpOptions = ''
124
+
max_execution_time = 120
125
+
'';
126
127
+
services.nginx.enable = mkDefault true;
128
+
environment.systemPackages = [ console ];
129
130
+
# services.nginx.virtualHosts."${cfg.hostName}" = {
131
+
# forceSSL = false;
132
+
# enableACME = false;
133
+
# extraConfig = ''
134
+
# error_log /var/log/nginx/wallabag_error.log;
135
+
# access_log /var/log/nginx/wallabag_access.log;
136
+
# '';
137
138
+
# root = "${cfg.package}/web";
139
+
# locations."/" = {
140
+
# priority = 10;
141
+
# tryFiles = "$uri /app.php$is_args$args";
142
+
# };
143
+
# locations."/assets".root = "${cfg.dataDir}/web";
144
+
# locations."~ ^/app\\.php(/|$)" = {
145
+
# priority = 100;
146
+
# fastcgiParams = {
147
+
# SCRIPT_FILENAME = "$realpath_root$fastcgi_script_name";
148
+
# DOCUMENT_ROOT = "$realpath_root";
149
+
# };
150
+
# extraConfig = ''
151
+
# fastcgi_pass unix:${config.services.phpfpm.pools."${poolName}".socket};
152
+
# include ${config.services.nginx.package}/conf/fastcgi_params;
153
+
# include ${config.services.nginx.package}/conf/fastcgi.conf;
154
+
# internal;
155
+
# '';
156
+
# };
157
+
# locations."~ \\.php$" = {
158
+
# priority = 1000;
159
+
# return = "404";
160
+
# };
161
+
# };
162
163
164
+
services.nginx.virtualHosts."${cfg.hostName}" = {
165
+
enableACME = false;
166
+
forceSSL = false;
167
+
root = "${cfg.package}/web";
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
+
'';
174
175
+
locations."/" = {
176
+
tryFiles = "$uri /app.php$is_args$args";
177
};
178
179
+
locations."/assets".root = "${cfg.dataDir}/web";
180
181
+
locations."~ ^/app\\.php(/|$)" = {
182
+
fastcgiParams = {
183
+
SCRIPT_FILENAME = "$realpath_root$fastcgi_script_name";
184
+
DOCUMENT_ROOT = "$realpath_root";
185
+
};
186
+
extraConfig = ''
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;
190
+
internal;
191
+
'';
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
};
202
+
203
+
locations."~ /(?!app)\\.php$" = {
204
+
extraConfig = ''
205
+
return 404;
206
+
'';
207
};
208
};
209
210
systemd.services.wallabag-install = {
211
description = "Wallabag install service";
212
wantedBy = [ "multi-user.target" ];
213
before = [ "phpfpm-wallabag.service" ];
214
+
after = [ "mysql.service" "postgresql.service" ];
215
path = with pkgs; [ coreutils php phpPackages.composer ];
216
217
serviceConfig = {
218
+
User = cfg.user;
219
Type = "oneshot";
220
+
RemainAfterExit = "yes";
221
+
PermissionsStartOnly = true;
222
+
};
223
+
224
+
preStart = ''
225
+
mkdir -p "${cfg.dataDir}"
226
+
chown ${cfg.user}:nginx "${cfg.dataDir}"
227
+
'';
228
229
script = ''
230
+
echo "Setting up wallabag files in ${cfg.dataDir} ..."
231
+
cd "${cfg.dataDir}"
232
+
233
+
rm -rf var/cache/*
234
+
rm -f app src translations
235
+
ln -sf ${appDir}/app app
236
+
ln -sf ${appDir}/src src
237
+
ln -sf ${appDir}/translations translations
238
+
ln -sf ${cfg.package}/composer.{json,lock} .
239
+
240
+
export WALLABAG_DATA="${cfg.dataDir}"
241
+
if [ ! -f installed ]; then
242
+
echo "Install file not found, installing ..."
243
+
php ${cfg.package}/bin/console --env=prod doctrine:database:create --if-not-exists --no-interaction
244
+
php ${cfg.package}/bin/console --env=prod doctrine:migrations:migrate --no-interaction
245
+
# Until https://github.com/wallabag/wallabag/issues/3662 is fixed
246
+
# yes no | php ${cfg.package}/bin/console --env=prod wallabag:install
247
+
touch installed
248
+
else
249
+
php ${cfg.package}/bin/console --env=prod doctrine:migrations:migrate --no-interaction
250
+
fi
251
+
php ${cfg.package}/bin/console --env=prod cache:clear
252
+
'';
253
};
254
+
};
255
+
256
+
meta = with stdenv.lib; {
257
+
maintainers = with maintainers; [ nadrieril ];
258
};
259
}
+3
-15
mount-crypted.sh
+3
-15
mount-crypted.sh
···
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
-
13
key_length=512
14
-
iterations=1000000
15
-
salt="$(head -n 1 /mnt/crypt-storage/default)"
16
chal="$(echo -n $salt | openssl dgst -binary -sha512 | rbtohex)"
17
resp="$(ykchalresp -2 -x $chal 2>/dev/null)"
18
-
user_key=
19
-
read -r user_key
20
luks_key="$(echo -n $user_key | pbkdf2-sha512 $(($key_length / 8)) $iterations $resp | rbtohex)"
21
echo -n $luks_key | hextorb | sudo cryptsetup luksOpen /dev/sda2 crypted --key-file=-
···
1
#!/usr/bin/env bash
2
key_length=512
3
+
iterations="$(head -n 2 /boot/crypted-storage/default)"
4
+
salt="$(head -n 1 /boot/crypted-storage/default)"
5
chal="$(echo -n $salt | openssl dgst -binary -sha512 | rbtohex)"
6
resp="$(ykchalresp -2 -x $chal 2>/dev/null)"
7
+
user_key="$(read -s)"
8
luks_key="$(echo -n $user_key | pbkdf2-sha512 $(($key_length / 8)) $iterations $resp | rbtohex)"
9
echo -n $luks_key | hextorb | sudo cryptsetup luksOpen /dev/sda2 crypted --key-file=-
-9
overlays/default.nix
-9
overlays/default.nix
···
14
buildInputs = prevAttrs.propagatedBuildInputs ++ [ final.python3.pkgs.aiosqlite ]; # We're using sqlite and upstream doesn't package this dependency
15
});
16
17
-
wallabag = prev.wallabag.overrideAttrs (attrs: {
18
-
patches = builtins.filter (patch: builtins.baseNameOf patch != "wallabag-data.patch") attrs.patches ++ [
19
-
# Out of the box, Wallabag wants to write to various subdirectories of the project directory.
20
-
# Letโs replace references to such paths with designated systemd locations
21
-
# so that the project source can remain immutable.
22
-
../pkgs/wallabag-data.patch
23
-
];
24
-
});
25
-
26
# Need to do server and agent too, maybe
27
# woodpecker-cli-next =
28
# let
+1
-6
pkgs/default.nix
+1
-6
pkgs/default.nix
···
5
plymouth-themes = pkgs.callPackage ./plymouth.nix { };
6
tic-80 = pkgs.callPackage ./tic-80.nix { };
7
fennel-ls = pkgs.callPackage ./fennel-ls.nix { };
8
-
# kobopatch = pkgs.callPackage ./kobopatch.nix { };
9
my-mautrix-discord = pkgs.callPackage ./mautrix-discord.nix { }; # Handled by matrix-appservices input
10
ulogger-server = pkgs.callPackage ./ulogger.nix { };
11
-
# Wallabag is now an overlay
12
-
# TODO: we still use the patch from this folder though
13
-
my-wallabag = pkgs.callPackage ./wallabag.nix { };
14
-
mautrix-slack = pkgs.callPackage ./mautrix-slack.nix { };
15
-
gpodder2go = pkgs.callPackage ./gpodder2go.nix { };
16
}
···
5
plymouth-themes = pkgs.callPackage ./plymouth.nix { };
6
tic-80 = pkgs.callPackage ./tic-80.nix { };
7
fennel-ls = pkgs.callPackage ./fennel-ls.nix { };
8
+
kobopatch = pkgs.callPackage ./kobopatch.nix { };
9
my-mautrix-discord = pkgs.callPackage ./mautrix-discord.nix { }; # Handled by matrix-appservices input
10
ulogger-server = pkgs.callPackage ./ulogger.nix { };
11
}
-14
pkgs/gpodder2go.nix
-14
pkgs/gpodder2go.nix
···
1
-
{ pkgs, ... }:
2
-
3
-
pkgs.buildGoModule rec {
4
-
name = "gpodder2go";
5
-
src = pkgs.fetchFromGitHub {
6
-
owner = "oxtyped";
7
-
repo = "gpodder2go";
8
-
rev = "v0.1.2";
9
-
hash = "sha256-RAt0rd4DZwI7b7IEFd1o4s4ivADzgzBzBaeGVL8OmYo";
10
-
};
11
-
12
-
vendorHash = "sha256-mbSgY5WjIAesT27uRgaiRF3N06yuUntjTp6kjUMh6Bw";
13
-
doCheck = false;
14
-
}
···
+3
-3
pkgs/kobopatch.nix
+3
-3
pkgs/kobopatch.nix
···
1
{ lib, buildGoModule, fetchFromGitHub }:
2
3
-
buildGoModule {
4
name = "kobopatch";
5
version = "0.15.0";
6
7
-
vendorHash = "sha256-1i6srhyig4x8mywyc2l8wzzm1afvb7wxmjsr84c447sb1xss6p7x";
8
9
src = fetchFromGitHub {
10
owner = "geek1011";
11
repo = "kobopatch";
12
rev = "653070c67c83ec61884854efc4f8a3132d82a2e5";
13
-
hash = "sha256-09hr3zh0w0f78cx40d2yydqv0mmjdh4iwdgia7sikraphvha85nn";
14
};
15
16
meta = with lib; {
···
1
{ lib, buildGoModule, fetchFromGitHub }:
2
3
+
buildGoModule rec {
4
name = "kobopatch";
5
version = "0.15.0";
6
7
+
vendorSha256 = "1i6srhyig4x8mywyc2l8wzzm1afvb7wxmjsr84c447sb1xss6p7x";
8
9
src = fetchFromGitHub {
10
owner = "geek1011";
11
repo = "kobopatch";
12
rev = "653070c67c83ec61884854efc4f8a3132d82a2e5";
13
+
sha256 = "09hr3zh0w0f78cx40d2yydqv0mmjdh4iwdgia7sikraphvha85nn";
14
};
15
16
meta = with lib; {
+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
-55
pkgs/wallabag-data.patch
-55
pkgs/wallabag-data.patch
···
1
-
diff --git a/app/AppKernel.php b/app/AppKernel.php
2
-
index 61b734e06..0902c20fc 100644
3
-
--- a/app/AppKernel.php
4
-
+++ b/app/AppKernel.php
5
-
@@ -64,12 +64,12 @@ class AppKernel extends Kernel
6
-
7
-
public function getCacheDir()
8
-
{
9
-
- return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
10
-
+ return getenv('CACHE_DIRECTORY') . '/' . $this->getEnvironment();
11
-
}
12
-
13
-
public function getLogDir()
14
-
{
15
-
- return dirname(__DIR__) . '/var/logs';
16
-
+ return getenv('LOGS_DIRECTORY');
17
-
}
18
-
19
-
public function registerContainerConfiguration(LoaderInterface $loader)
20
-
diff --git a/app/config/config.yml b/app/config/config.yml
21
-
index 7f0a4ca6c..77b5175c8 100644
22
-
--- a/app/config/config.yml
23
-
+++ b/app/config/config.yml
24
-
@@ -1,5 +1,7 @@
25
-
imports:
26
-
- - { resource: parameters.yml }
27
-
+ # Unfortunately, we cannot use %env(string:CONFIGURATION_DIRECTORY)%. Hardcoding the path for simplicity.
28
-
+ # https://symfony.com/doc/current/service_container/import.html#importing-configuration-with-imports
29
-
+ - { resource: '/etc/wallabag/parameters.yml' }
30
-
- { resource: security.yml }
31
-
- { resource: services.yml }
32
-
- { resource: wallabag.yml }
33
-
@@ -28,7 +30,7 @@ framework:
34
-
session:
35
-
# handler_id set to null will use default session handler from php.ini
36
-
handler_id: session.handler.native_file
37
-
- save_path: "%kernel.project_dir%/var/sessions/%kernel.environment%"
38
-
+ save_path: "%env(string:CACHE_DIRECTORY)%/sessions/%kernel.environment%"
39
-
cookie_secure: auto
40
-
fragments: ~
41
-
http_method_override: true
42
-
diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml
43
-
index bd57d6377..8e1cd0970 100644
44
-
--- a/app/config/wallabag.yml
45
-
+++ b/app/config/wallabag.yml
46
-
@@ -35,7 +35,7 @@ wallabag_core:
47
-
fetching_error_message: |
48
-
wallabag can't retrieve contents for this article. Please <a href="https://doc.wallabag.org/en/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>.
49
-
api_limit_mass_actions: 10
50
-
- encryption_key_path: "%kernel.project_dir%/data/site-credentials-secret-key.txt"
51
-
+ encryption_key_path: "%env(string:STATE_DIRECTORY)%/site-credentials-secret-key.txt"
52
-
default_internal_settings:
53
-
-
54
-
name: share_public
55
-
···
-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.9";
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-V4s5/y9fFAmZ+WnUxU03UyRivEihD1ZUKQOOq4TLEKw=";
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
-
}
···
+3
secrets/secrets.nix
+3
secrets/secrets.nix
···
6
lituus = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2lAb33LH3JNuOfBXt971u0tHe+NURFecQdfjwEj+C+ root@lituus";
7
helix = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAKrL6IDHNnHmxi0q9nzu87NOyidPm3HpE7klU368lEf root@helix";
8
helix2 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK2G81z1E51ioJQGLHnTJEjgSdBqLM6mb72Z+0atE6Bf root@helix";
9
curve = [ system user ];
10
allUserKeys = [ system user mossnet ];
11
systemOnly = [ system mossnet lituus helix ];
···
34
"box-wg.age".publicKeys = [ mossnet ];
35
"wallabag-password.age".publicKeys = [ mossnet ];
36
"wallabag-secret.age".publicKeys = [ mossnet ];
37
}
···
6
lituus = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2lAb33LH3JNuOfBXt971u0tHe+NURFecQdfjwEj+C+ root@lituus";
7
helix = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAKrL6IDHNnHmxi0q9nzu87NOyidPm3HpE7klU368lEf root@helix";
8
helix2 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK2G81z1E51ioJQGLHnTJEjgSdBqLM6mb72Z+0atE6Bf root@helix";
9
+
work = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHOnfDvR2D2nGnC+DZYDUXiokzz+eLfZwkp+O8WjWutp anishlakhwara@Anishs-MacBook-Pro.local";
10
curve = [ system user ];
11
allUserKeys = [ system user mossnet ];
12
systemOnly = [ system mossnet lituus helix ];
···
35
"box-wg.age".publicKeys = [ mossnet ];
36
"wallabag-password.age".publicKeys = [ mossnet ];
37
"wallabag-secret.age".publicKeys = [ mossnet ];
38
+
39
+
"work-wg.age".publicKeys = [ work user system ];
40
}
secrets/work-wg.age
secrets/work-wg.age
This is a binary file and will not be displayed.