Skip to content

Commit 35ed7c8

Browse files
committed
README: Add Usage notes
1 parent 520a588 commit 35ed7c8

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

README.md

+64
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,70 @@ Supported use-cases:
1111
- Running Nix and Nix-like builds
1212

1313

14+
* * *
15+
16+
Usage
17+
-----
18+
19+
The following shows an involved example for pairing the LVM span trick with a Nix-based build.
20+
21+
```yaml
22+
name: Build
23+
24+
on:
25+
pull_request:
26+
push:
27+
branches:
28+
- "latest"
29+
30+
jobs:
31+
build:
32+
name: Build requiring more space
33+
runs-on: ubuntu-24.04
34+
steps:
35+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
37+
- name: Scrounge-up some more space
38+
uses: samueldr/more-space-action@latest
39+
with:
40+
enable-lvm-span: true
41+
lvm-span-mountpoint: /nix
42+
43+
- name: Install Lix
44+
uses: samueldr/lix-gha-installer-action@v1
45+
46+
- name: Override nix-daemon build directory
47+
run: |
48+
(
49+
PS4=" $ "
50+
set -eux -o pipefail
51+
sudo mkdir -p /nix/tmp
52+
sudo chmod ug=rwx,o=rwxt /nix/tmp
53+
sudo mkdir -p /etc/systemd/system/nix-daemon.service.d
54+
sudo tee /etc/systemd/system/nix-daemon.service.d/override.conf >/dev/null <<EOF
55+
[Service]
56+
Environment=TMPDIR=/nix/tmp
57+
EOF
58+
sudo systemctl daemon-reload
59+
sudo systemctl restart nix-daemon
60+
)
61+
62+
- run: nix-build
63+
```
64+
65+
> [!NOTE]
66+
> Prefer pinning to a released version, rather than following the latest branch.
67+
>
68+
> This applies to all actions.
69+
70+
The use of Nix or Lix is not a requirement with this action.
71+
It is mainly useful as a less-than-simple example.
72+
73+
Be mindful about the access rights of the mount point, which may not be correct for other use-cases.
74+
By default, it will be owned, by the default, by the `root:root` user/group pair.
75+
If you intend to "just" run commands as the runner user in the mounted span, chowning to the runner user will be necessary.
76+
77+
1478
* * *
1579

1680
Configuring the action

0 commit comments

Comments
 (0)