Skip to content

Commit a43a928

Browse files
committed
Samsung/WSL2
1 parent 8278a92 commit a43a928

File tree

205 files changed

+6108
-8540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+6108
-8540
lines changed

.agenix.toml

-60
This file was deleted.

.editorconfig

-14
This file was deleted.

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
*.age binary diff=age
2+
# Convert to LF line endings on checkout.
3+
*.sh text eol=lf
4+
*.nix text eol=lf

.github/workflows/ci.yml

+26-151
Original file line numberDiff line numberDiff line change
@@ -22,186 +22,61 @@ jobs:
2222
matrix:
2323
system:
2424
- aarch64
25-
- x86_64
2625
nix-command:
27-
- fmt -- --check
2826
- eval .#apps.$_system.nixos-shell.program
2927
- eval .#apps.$_system.setup.program
3028

3129
include:
32-
- nix-command: develop .#jdk8 --profile profile
33-
system: x86_64
34-
- nix-command: develop .#jdk11 --profile profile
35-
system: x86_64
36-
- nix-command: develop .#jdk17 --profile profile
37-
system: x86_64
38-
- nix-command: develop .#php74 --profile profile
39-
system: x86_64
40-
- nix-command: develop .#php80 --profile profile
41-
system: x86_64
42-
- nix-command: develop .#php81 --profile profile
43-
system: x86_64
44-
45-
- nix-command: build .#homeConfigurations."tobias@gamer".activationPackage
46-
system: x86_64
47-
- nix-command: build .#homeConfigurations."tobhap@M386".activationPackage
48-
system: x86_64
49-
deploy-agent: M386
50-
deploy-args: --async
51-
52-
- nix-command: build .#nixOnDroidConfigurations.oneplus5.activationPackage --impure
53-
system: aarch64
54-
55-
- nix-command: build .#nixosConfigurations.argon.config.system.build.toplevel
56-
system: aarch64
57-
deploy-agent: argon
58-
- nix-command: build .#nixosConfigurations.krypton.config.system.build.toplevel
59-
system: x86_64
60-
deploy-agent: krypton
61-
- nix-command: build .#nixosConfigurations.neon.config.system.build.toplevel
62-
system: x86_64
63-
deploy-agent: neon
64-
deploy-args: --async
65-
- nix-command: build .#nixosConfigurations.xenon.config.system.build.toplevel
30+
- nix-command: build .#nixOnDroidConfigurations.sams9.activationPackage --impure --print-build-logs --log-lines 9999 --accept-flake-config
6631
system: aarch64
67-
deploy-agent: xenon
68-
69-
- nix-command: build .#packages.$_system.rpi-firmware
70-
system: aarch64
71-
- nix-command: build .#packages.$_system.rpi-image
72-
system: aarch64
73-
- nix-command: build .#packages.$_system.installer-image
74-
system: x86_64
32+
deploy-agent: sams9
7533

7634
steps:
7735
- name: Checkout repository
7836
uses: actions/checkout@v3
7937
with:
8038
ref: ${{ inputs.branch }}
81-
39+
- name: Install qemu-user-static
40+
run: sudo apt-get install -y qemu-user-static
8241
- name: Install nix
83-
uses: cachix/install-nix-action@v20
42+
uses: cachix/install-nix-action@v22
8443
with:
8544
extra_nix_config: |
8645
keep-going = true
8746
show-trace = true
88-
47+
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
48+
system = aarch64-linux # enables binfmt on that machine, see https://nixos.wiki/wiki/NixOS_on_ARM#Compiling_through_binfmt_QEMU
8949
- name: Setup cachix
9050
uses: cachix/cachix-action@v12
9151
with:
92-
name: gerschtli
52+
name: 573-bc
9353
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
94-
9554
- name: Build command (aarch64)
9655
if: matrix.system == 'aarch64'
97-
# FIXME: use upstream once --tty is removed
98-
#uses: uraimo/run-on-arch-action@v2
99-
uses: Gerschtli/run-on-arch-action@tty
100-
with:
101-
arch: aarch64
102-
distro: alpine_latest
103-
githubToken: ${{ github.token }}
104-
dockerRunArgs: --volume /nix:/nix
105-
install: |
106-
apk --no-cache add curl git xz
107-
adduser --disabled-password ci
108-
env: |
109-
_system: ${{ matrix.system }}-linux
110-
CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN || 'no-value' }}
111-
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
112-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113-
run: |
114-
set -euo pipefail
115-
116-
mkdir -p /home/ci/.config/nix
117-
118-
cat <<EOF > /home/ci/.config/nix/nix.conf
119-
experimental-features = nix-command flakes
120-
keep-going = true
121-
show-trace = true
122-
access-tokens = github.com=$GITHUB_TOKEN
123-
EOF
124-
125-
chown --recursive ci:ci /nix /home/ci
126-
chgrp --recursive ci "$(pwd)"
127-
chmod -R g+w "$(pwd)"
128-
129-
echo "::group::Install nix"
130-
131-
curl \
132-
--silent \
133-
--show-error \
134-
--output /tmp/install \
135-
--retry 5 \
136-
--retry-all-errors \
137-
--fail \
138-
--location \
139-
"https://nixos.org/nix/install"
140-
141-
su ci -c "sh /tmp/install --no-channel-add --no-daemon"
142-
rm /tmp/install
143-
144-
function run() {
145-
su ci -c ". /home/ci/.nix-profile/etc/profile.d/nix.sh; $*"
146-
}
147-
148-
# FIXME: setting build-hook is needed because default hook `nix __build-remote` is not available
149-
function build_hook() {
150-
local nix_path="$(run which nix)"
151-
echo "${nix_path/bin\/nix/libexec/nix/build-remote}"
152-
}
153-
run echo "build-hook = $(build_hook)" >> /home/ci/.config/nix/nix.conf
154-
155-
156-
echo "::group::Setup cachix"
157-
run nix-env --quiet -j8 -iA cachix -f https://cachix.org/api/v1/install
158-
run cachix --version
159-
run cachix use gerschtli
160-
run cachix use nix-on-droid
161-
162-
163-
echo "::group::Build command"
164-
run git config --global --add safe.directory "$(pwd)"
165-
166-
run nix ${{ matrix.nix-command }}
167-
168-
169-
${{ github.ref == 'refs/heads/master' && inputs.branch == '' && matrix.deploy-agent &&
170-
format(
171-
'
172-
echo "::group::Build spec"
173-
spec="$(run nix build --print-out-paths ".#cachix-deploy-spec-{0}")"
174-
175-
echo "::group::Upload spec"
176-
run cachix push gerschtli "$spec"
177-
178-
echo "::group::Activate deployment"
179-
run cachix deploy activate --agent "{0}" {1} "$spec"
180-
',
181-
matrix.deploy-agent,
182-
matrix.deploy-args
183-
)
184-
|| 'echo "::group::Skip spec deploy"'
185-
}}
186-
187-
- name: Build command (x86_64)
188-
if: matrix.system == 'x86_64'
18956
env:
19057
_system: ${{ matrix.system }}-linux
191-
run: nix ${{ matrix.nix-command }}
58+
run: |
59+
cachix use gerschtli
60+
cachix use nix-on-droid
61+
cachix use 573-bc
62+
cachix use nix-community
63+
cachix use tweag-jupyter
64+
cachix use coq
65+
cachix use nixpkgs-ruby
66+
cachix use arm
67+
68+
echo "::group::Build command"
69+
nix ${{ matrix.nix-command }}
19270
193-
- name: Deploy cachix-agent spec (x86_64)
194-
if: matrix.system == 'x86_64' && github.ref == 'refs/heads/master' && inputs.branch == '' && matrix.deploy-agent
71+
- name: Deploy cachix-agent spec (aarch64)
72+
if: github.ref == 'refs/heads/wsl2' && matrix.deploy-agent
19573
env:
19674
CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN }}
19775
run: |
198-
echo "::group::Build spec"
199-
spec="$(nix build --print-out-paths ".#cachix-deploy-spec-${{ matrix.deploy-agent }}")"
200-
201-
echo "::group::Upload spec"
202-
cachix push gerschtli "$spec"
76+
echo "::group::Build spec"
77+
spec="$(nix build --print-out-paths ".#cachix-deploy-spec-${{ matrix.deploy-agent }}" --impure)"
20378
204-
echo "::group::Activate deployment"
205-
cachix deploy activate --agent "${{ matrix.deploy-agent }}" ${{ matrix.deploy-args }} "$spec"
79+
echo "::group::Upload spec"
80+
cachix push 573-bc "$spec"
20681
20782
# vim: set sw=2:

0 commit comments

Comments
 (0)