generated from Vanilla-OS/custom-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
recipe.yml
186 lines (168 loc) · 5.68 KB
/
recipe.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: Vanilla Desktop with Sway
id: desktop-sway
stages:
- id: build
base: ghcr.io/vanilla-os/desktop:main
singlelayer: false
labels:
maintainer: Angelos Drossos
args:
DEBIAN_FRONTEND: noninteractive # Set the image environment as non-interactive
# Commands to run first before building the modules
runs:
commands:
- echo 'APT::Install-Recommends "1";' > /etc/apt/apt.conf.d/01norecommends
modules:
- name: init-setup
type: shell
commands:
- lpkg --unlock
- apt-get update
# Put your custom actions behind this comment
- name: common-packages
type: apt
source:
packages:
- tree
- vim
- name: sway-packages
type: apt
source:
packages:
- sway
- swaybg
- swayimg
- swayidle
- swaylock
- fuzzel
- pulseaudio-utils # pactl
- wlogout
- waybar # installs and enables waybar.service
- sway-notification-center # installs and enables swaync.service
- xdg-desktop-portal-wlr
- grim
- slurp
- swappy
- wl-clipboard
- wf-recorder
- xdg-utils
- fontconfig
# NOTE: Waybar default config needs Font Awesome and Meslo LG.
- name: nerd-fonts
type: shell
commands:
- set -ux
- mkdir -p /usr/share/fonts
- wget --quiet --output-document=- https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.tar.xz | tar xvJ -C /usr/share/fonts
- wget --quiet --output-document=- https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Noto.tar.xz | tar xvJ -C /usr/share/fonts
- fc-cache -fv
- name: more-fonts
type: apt
source:
packages:
- fonts-font-awesome
- fonts-material-design-icons-iconfont
- fonts-noto-color-emoji
- name: sway-config-overwrite
type: shell
commands:
- set -ux
- cp -av /etc/sway/config /etc/sway/config.orig
- cp -av /etc/sway/config.vanillaos /etc/sway/config
- echo Sway configuration updated for Vanilla-OS
- name: sway-session-overwrite
type: shell
commands:
- set -ux
- cp -av /wayland-sessions/sway.desktop /usr/share/wayland-sessions/sway.desktop
- rm -rv /wayland-sessions
- echo Sway session updated for Vanilla-OS
# swaylock starts /sbin/unix_chkpwd as user via pam.
# unix_chkpwd tries to read /etc/shadow but only root is allowed to.
# The quick solution is to set the s-bit for the root of /sbin/unix_chkpwd.
# The more secure solution would be that swaylock uses saslauthd.
# Note: Changing the group of /etc/shadow does not help.
- name: swaylock-fix
type: shell
commands:
- set -ux
- ls -l /sbin/unix_chkpwd /etc/shadow
# ```console
# -rwxr-sr-x 1 root shadow /sbin/unix_chkpwd
# -rw-r----- 1 root root /etc/shadow
# ```
- chmod u+s /sbin/unix_chkpwd
- ls -l /sbin/unix_chkpwd /etc/shadow
# ```console
# -rwsr-sr-x 1 root shadow /sbin/unix_chkpwd
# -rw-r----- 1 root root /etc/shadow
# ```
- name: blight-setup
type: shell
commands:
- set -ux
- /usr/bin/blight setup
- ls -l /usr/bin/blight
- chgrp --changes video /usr/bin/blight
- chmod --changes g+s /usr/bin/blight
- ls -l /usr/bin/blight
- name: sway-interactive-screenshot
type: shell
commands:
- set -ux
- 'VERSION=$(curl -s https://api.github.com/repos/moverest/sway-interactive-screenshot/releases/latest | grep "tag_name" | cut -d : -f 2,3 | tr -d \ \",)'
- mkdir -p /tmp/sway-interactive-screenshot
- wget --quiet --output-document=- https://github.com/moverest/sway-interactive-screenshot/archive/refs/tags/${VERSION}.tar.gz | tar xvz --strip-components=1 -C /tmp/sway-interactive-screenshot
- cp -av /tmp/sway-interactive-screenshot/sway-interactive-screenshot /usr/bin
- chmod 0755 /usr/bin/sway-interactive-screenshot
- mkdir -p /usr/share/doc/sway-interactive-screenshot-${VERSION}
- cp -av -t /usr/share/doc/sway-interactive-screenshot-${VERSION} /tmp/sway-interactive-screenshot/README.md
- cp -av -t /usr/share/doc/sway-interactive-screenshot-${VERSION} /tmp/sway-interactive-screenshot/LICENSE
- rm -r /tmp/sway-interactive-screenshot
- name: dragon-drop-compile
type: shell
commands:
- set -ux
- apt-get install -y --mark-auto make gcc libgtk-3-dev # will be removed in cleanup
- gcc --version
- 'VERSION=$(curl -s https://api.github.com/repos/mwh/dragon/releases/latest | grep "tag_name" | cut -d : -f 2,3 | tr -d \ \",v)'
- mkdir -p /tmp/dragon-drop
- cd /tmp/dragon-drop
- wget --quiet --output-document=- https://github.com/mwh/dragon/archive/refs/tags/v${VERSION}.tar.gz | tar xvz --strip-components=1
- make all
- make PREFIX=/usr NAME=dragon-drop install
- ln -s dragon-drop /usr/bin/dragon
- mkdir -p /usr/share/doc/dragon-drop-${VERSION}
- cp -av -t /usr/share/doc/dragon-drop-${VERSION} README
- cp -av -t /usr/share/doc/dragon-drop-${VERSION} LICENCE
- cd && rm -r /tmp/dragon-drop
# Put your custom actions before this comment
- name: set-image-name-abroot
type: includes
includes:
- modules/80-set-image-abroot-config.yml
- name: cleanup
type: shell
commands:
- apt-get autoremove -y
- apt-get clean
- lpkg --lock
- name: fsguard
type: fsguard
CustomFsGuard: false
FsGuardLocation: "/usr/sbin/FsGuard"
GenerateKey: true
FilelistPaths: ["/usr/bin"]
modules:
- name: remove-prev-fsguard
type: shell
commands:
- rm -rf /FsGuard
- rm -f ./minisign.pub ./minisign.key
- chmod +x /usr/sbin/init
- name: cleanup2
type: shell
commands:
- rm -rf /tmp/*
- rm -rf /var/tmp/*
- rm -rf /sources