This repository has been archived by the owner on Jan 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJustfile
145 lines (120 loc) · 5.38 KB
/
Justfile
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
wasmtimeversion := "13.0.0"
neovimversion := "0.9.5"
goversion := "1.21.6"
_default:
@just --list
[private]
build-wasmtime: (container "wasmtime")
@echo "Building wasmtime sysext"
@podman run --rm -e OS=_any -v `pwd`/result:/bakery/result ${USER}/wasmtime:latest /bakery/create_wasmtime_sysext.sh {{wasmtimeversion}} wasmtime >/dev/null
# install wasmtime
wasmtime: build-wasmtime systemd-sysext
#!/usr/bin/env bash
echo "Installing wasmtime extension, requires elevated permissions"
sudo cp result/wasmtime.raw /var/lib/extensions/wasmtime.raw
echo "Reloading system extensions, requires elevated permissions"
sudo systemd-sysext refresh
systemd-sysext
# install neovim
neovim: build-neovim systemd-sysext
#!/usr/bin/env bash
echo "Installing neovim extension, requires elevated permissions"
sudo cp result/neovim.raw /var/lib/extensions/neovim.raw
echo "Reloading system extensions, requires elevated permissions"
sudo systemd-sysext refresh
systemd-sysext
# install vscode
vscode: build-vscode systemd-sysext
#!/usr/bin/env bash
echo "Installing vscode extension, requires elevated permissions"
sudo cp result/vscode.raw /var/lib/extensions/vscode.raw
echo "Reloading system extensions, requires elevated permissions"
sudo systemd-sysext refresh
systemd-sysext
# install go
go: build-go systemd-sysext
#!/usr/bin/env bash
echo "Installing go extension, requires elevated permissions"
sudo cp result/go.raw /var/lib/extensions/go.raw
echo "Reloading system extensions, requires elevated permissions"
echo "Add /usr/local/go/bin to your PATH to use go"
sudo systemd-sysext refresh
systemd-sysext
# install caddy
caddy: build-caddy systemd-sysext
#!/usr/bin/env bash
echo "Installing caddy extension, requires elevated permissions"
sudo cp result/caddy.raw /var/lib/extensions/caddy.raw
echo "Reloading system extensions, requires elevated permissions"
sudo systemd-sysext refresh
systemd-sysext
# install albafetch from flakehub reference
albafetch: (container "nix") (build-nix "https://flakehub.com/f/alba4k/albafetch/0.1.570.tar.gz" "albafetch") systemd-sysext
#!/usr/bin/env bash
echo "Installing albafetch extension, requires elevated permissions"
sudo cp result/albafetch.raw /var/lib/extensions/albafetch.raw
echo "Reloading system extensions, requires elevated permissions"
sudo systemd-sysext refresh
systemd-sysext
[private]
build-neovim: (container "neovim")
@echo "Building neovim sysext"
@podman run --rm -e OS=_any -v `pwd`/result:/bakery/result ${USER}/neovim:latest /bakery/create_neovim_sysext.sh {{neovimversion}} neovim >/dev/null
[private]
build-caddy: (container "caddy")
@echo "Building caddy sysext"
podman run --rm -e OS=_any -v `pwd`/result:/bakery/result ${USER}/caddy:latest /bakery/create_caddy_sysext.sh 0.4.0 incus
[private]
build-incus: (container "incus")
@echo "Building incus sysext"
podman run --rm -e OS=_any -v `pwd`/result:/bakery/result ${USER}/incus:latest /bakery/create_incus_sysext.sh 0.4.0 incus
[private]
build-docker: (container "docker")
@echo "Building docker sysext"
podman run --rm -e OS=_any -v `pwd`/result:/bakery/result ${USER}/docker:latest /bakery/create_docker_sysext.sh 24.0.6 docker
[private]
build-go: (container "go")
@echo "Building go sysext"
@podman run --rm -e OS=_any -v `pwd`/result:/bakery/result ${USER}/go:latest /bakery/create_go_sysext.sh {{goversion}} go >/dev/null
[private]
build-meta: (container "meta")
@echo "Building meta sysext"
@podman run --rm -e OS=_any -v `pwd`/result:/bakery/result ${USER}/meta:latest /bakery/create_meta_sysext.sh latest meta
[private]
build-vscode: (container "vscode")
@echo "Building vscode sysext"
@podman run --rm -e OS=_any -v `pwd`/result:/bakery/result ${USER}/vscode:latest /bakery/create_vscode_sysext.sh latest vscode >/dev/null
# remove an installed extension by name `just remove vscode`
remove NAME:
@echo "Removing {{NAME}} extension, requires elevated permissions"
sudo rm -f /var/lib/extensions/{{NAME}}.raw
sudo systemd-sysext refresh
systemd-sysext
[private]
build-nix FLAKEREF PACKAGE: (container "nix")
podman run --rm -e OS=_any -v `pwd`/result:/bakery/result ${USER}/nix:latest /bakery/nix_bundle_sysext.sh {{FLAKEREF}} {{PACKAGE}}
[private]
container NAME:
@echo "Building {{NAME}} container"
@podman build -t ${USER}/{{NAME}}:latest -f builders/{{NAME}}/Containerfile.{{NAME}} . >/dev/null
[private]
local NAME VERSION:
@echo "Building {{NAME}} locally"
export OS=_any; ./create_{{NAME}}_sysext.sh {{VERSION}} {{NAME}}
[private]
clean:
@rm -rf result/*.raw
[private]
build-wasmtime-local:
export OS=_any; ./create_wasmtime_sysext.sh 13.0.0 wasmtime
[private]
systemd-sysext:
#!/usr/bin/env bash
systemctl --quiet is-enabled systemd-sysext || { echo "enabling systemd-sysext"; sudo systemctl enable --now systemd-sysext.service; }
test -d /var/lib/extensions || { echo "creating /var/lib/extensions"; sudo mkdir -p /var/lib/extensions; }
systemctl --quiet is-enabled systemd-confext || { echo "enabling systemd-confext"; sudo systemctl enable --now systemd-confext.service; }
test -d /var/lib/confexts || { echo "creating /var/lib/confexts"; sudo mkdir -p /var/lib/confexts; }
[private]
sync:
@echo "Syncing to remote"
rsync -av result/ [email protected]:~/extensions