-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-docker-rootfs.sh
executable file
·58 lines (44 loc) · 1.03 KB
/
build-docker-rootfs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
set -e
if [ -e out ]; then
rm -rf out
fi
if [ -e out-* ]; then
rm -rf out-*
fi
if [ -e docker-rootfs ]; then
rm -rf docker-rootfs
fi
nix-env -i cyanide -f . -r -p out
nix-env -i vim -p out
mkdir -p docker-rootfs
for i in $(nix-store -qR out/); do
mkdir -p $(dirname docker-rootfs/$i)
cp -r $i docker-rootfs/$i
done
chmod -R +w docker-rootfs
mkdir -p docker-rootfs/root/.config/cyanide/
mkdir -p docker-rootfs/etc
mkdir -p docker-rootfs/bin
cat > docker-rootfs/root/.config/cyanide/cyanide.conf <<EOF
[DATABASE]
host = localhost
port = 5432
user = cyanide
password = cyanide
database = cyanide
[EDITOR]
editor =
EOF
cat > docker-rootfs/root/.vimrc <<EOF
" Be iMproved
set nocompatible
" Enable spellchecking
set spell
" unicode
set encoding=utf-8 " best default encoding
setglobal fileencoding=utf-8 " ...
set nobomb " do not write utf-8 BOM!
EOF
ln -s ../$(realpath out)/bin/cyanide docker-rootfs/bin/cyanide
ln -s ../$(realpath out)/bin/vim docker-rootfs/bin/vim