Skip to content

Commit b219b40

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

File tree

205 files changed

+6097
-8476
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

+6097
-8476
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

+15-87
Original file line numberDiff line numberDiff line change
@@ -22,76 +22,22 @@ 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
30+
- nix-command: build .#nixOnDroidConfigurations.sams9.activationPackage --impure --print-build-logs --log-lines 9999 --accept-flake-config
5331
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
32+
deploy-agent: sams9
6433
deploy-args: --async
65-
- nix-command: build .#nixosConfigurations.xenon.config.system.build.toplevel
66-
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
7534

7635
steps:
7736
- name: Checkout repository
7837
uses: actions/checkout@v3
7938
with:
8039
ref: ${{ inputs.branch }}
8140

82-
- name: Install nix
83-
uses: cachix/install-nix-action@v20
84-
with:
85-
extra_nix_config: |
86-
keep-going = true
87-
show-trace = true
88-
89-
- name: Setup cachix
90-
uses: cachix/cachix-action@v12
91-
with:
92-
name: gerschtli
93-
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
94-
9541
- name: Build command (aarch64)
9642
if: matrix.system == 'aarch64'
9743
# FIXME: use upstream once --tty is removed
@@ -100,7 +46,6 @@ jobs:
10046
with:
10147
arch: aarch64
10248
distro: alpine_latest
103-
githubToken: ${{ github.token }}
10449
dockerRunArgs: --volume /nix:/nix
10550
install: |
10651
apk --no-cache add curl git xz
@@ -109,17 +54,17 @@ jobs:
10954
_system: ${{ matrix.system }}-linux
11055
CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN || 'no-value' }}
11156
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
112-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11357
run: |
11458
set -euo pipefail
11559
11660
mkdir -p /home/ci/.config/nix
11761
11862
cat <<EOF > /home/ci/.config/nix/nix.conf
11963
experimental-features = nix-command flakes
64+
extra-experimental-features = flakes
65+
accept-flake-config = true
12066
keep-going = true
12167
show-trace = true
122-
access-tokens = github.com=$GITHUB_TOKEN
12368
EOF
12469
12570
chown --recursive ci:ci /nix /home/ci
@@ -137,6 +82,7 @@ jobs:
13782
--fail \
13883
--location \
13984
"https://nixos.org/nix/install"
85+
# "https://releases.nixos.org/nix/nix-2.14.1/install"
14086
14187
su ci -c "sh /tmp/install --no-channel-add --no-daemon"
14288
rm /tmp/install
@@ -145,7 +91,7 @@ jobs:
14591
su ci -c ". /home/ci/.nix-profile/etc/profile.d/nix.sh; $*"
14692
}
14793
148-
# FIXME: setting build-hook is needed because default hook `nix __build-remote` is not available
94+
# FIXME: setting build-hook is needed because default hook `nix __build-remote` is not available - NixOS/nix#7217
14995
function build_hook() {
15096
local nix_path="$(run which nix)"
15197
echo "${nix_path/bin\/nix/libexec/nix/build-remote}"
@@ -158,50 +104,32 @@ jobs:
158104
run cachix --version
159105
run cachix use gerschtli
160106
run cachix use nix-on-droid
107+
run cachix use 573-bc
108+
run cachix use nix-community
109+
run cachix use tweag-jupyter
110+
run cachix use coq
111+
run cachix use nixpkgs-ruby
161112
162113
163114
echo "::group::Build command"
164115
run git config --global --add safe.directory "$(pwd)"
165116
166117
run nix ${{ matrix.nix-command }}
167118
168-
169-
${{ github.ref == 'refs/heads/master' && inputs.branch == '' && matrix.deploy-agent &&
119+
# FIXME I left the inputs.branch == '' clause off on purpose to test what's its' semantics
120+
${{ github.ref == 'refs/heads/wsl2' && matrix.deploy-agent &&
170121
format(
171122
'
172123
echo "::group::Build spec"
173-
spec="$(run nix build --print-out-paths ".#cachix-deploy-spec-{0}")"
124+
spec="$(run nix build --print-out-paths ".#cachix-deploy-spec-{0}" --impure)"
174125
175126
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"
127+
run cachix push 573-bc "$spec"
180128
',
181129
matrix.deploy-agent,
182130
matrix.deploy-args
183131
)
184132
|| 'echo "::group::Skip spec deploy"'
185133
}}
186134
187-
- name: Build command (x86_64)
188-
if: matrix.system == 'x86_64'
189-
env:
190-
_system: ${{ matrix.system }}-linux
191-
run: nix ${{ matrix.nix-command }}
192-
193-
- name: Deploy cachix-agent spec (x86_64)
194-
if: matrix.system == 'x86_64' && github.ref == 'refs/heads/master' && inputs.branch == '' && matrix.deploy-agent
195-
env:
196-
CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN }}
197-
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"
203-
204-
echo "::group::Activate deployment"
205-
cachix deploy activate --agent "${{ matrix.deploy-agent }}" ${{ matrix.deploy-args }} "$spec"
206-
207135
# vim: set sw=2:

.github/workflows/update.yml

+22-86
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,31 @@
1-
name: Update inputs
1+
name: update-flake-lock
22
on:
3-
workflow_dispatch:
3+
workflow_dispatch: # allows manual triggering
4+
pull_request: # triggers on every Pull Request
45
schedule:
5-
- cron: 0 0 * * 1
6+
- cron: '0 0 * * 1'
67

78
jobs:
8-
update:
9+
lockfile:
910
runs-on: ubuntu-latest
10-
11-
outputs:
12-
branch: ${{ steps.branch.outputs.branch }}
13-
update_available: ${{ steps.changes.outputs.update_available }}
14-
1511
steps:
1612
- name: Checkout repository
17-
uses: actions/checkout@v3
18-
with:
19-
fetch-depth: 0
20-
13+
uses: actions/checkout@v2
2114
- name: Install nix
22-
uses: cachix/install-nix-action@v20
23-
24-
- name: Set branch name output
25-
id: branch
26-
run: echo "branch=ci/automatic-update-$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
27-
28-
- name: Create branch locally
29-
run: git switch -c ${{ steps.branch.outputs.branch }}
30-
31-
- name: Setup git
32-
run: |
33-
git config --global user.email "[email protected]"
34-
git config --global user.name "Tobias Happ"
35-
36-
- name: Update inputs
37-
run: |
38-
nix \
39-
--option commit-lockfile-summary 'flake.inputs: automatic update' \
40-
flake update \
41-
--commit-lock-file
42-
43-
- name: Check for changes
44-
id: changes
45-
run: |
46-
if git diff --exit-code origin/master...; then
47-
echo "update_available=false" >> $GITHUB_OUTPUT
48-
else
49-
echo "update_available=true" >> $GITHUB_OUTPUT
50-
fi
51-
52-
- name: Push changes
53-
if: steps.changes.outputs.update_available == 'true'
54-
run: git push --force origin ${{ steps.branch.outputs.branch }}
55-
56-
build:
57-
uses: ./.github/workflows/ci.yml
58-
needs: update
59-
if: needs.update.outputs.update_available == 'true'
60-
with:
61-
branch: ${{ needs.update.outputs.branch }}
62-
secrets:
63-
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
64-
65-
merge:
66-
runs-on: ubuntu-latest
67-
needs:
68-
- update
69-
- build
70-
71-
steps:
72-
- name: Checkout repository
73-
uses: actions/checkout@v3
15+
uses: cachix/install-nix-action@v22
7416
with:
75-
fetch-depth: 0
76-
77-
- name: Check if update branch is behind master
78-
run: git diff origin/${{ needs.update.outputs.branch }}...origin/master --exit-code
79-
80-
- name: Merge update into master
81-
run: git merge origin/${{ needs.update.outputs.branch }}
82-
83-
- name: Push master
84-
run: git push origin master
85-
86-
- name: Delete update branch
87-
run: git push --delete origin ${{ needs.update.outputs.branch }}
88-
89-
# needed for cachix agent deployments
90-
final-build:
91-
uses: ./.github/workflows/ci.yml
92-
needs: merge
93-
secrets:
94-
CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN }}
95-
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
17+
extra_nix_config: |
18+
show-trace = true
19+
experimental-features = nix-command flakes
20+
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
21+
- name: Update flake.lock
22+
id: update
23+
if: ${{ github.event_name != 'pull_request' }}
24+
uses: DeterminateSystems/update-flake-lock@v19
25+
with:
26+
pr-title: "Update flake.lock" # Title of PR to be created
27+
pr-labels: | # Labels to be set on the PR
28+
dependencies
29+
automated
30+
- name: Print PR number
31+
run: echo Pull request number is ${{ steps.update.outputs.pull-request-number }}.

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.*/
12
nixos.qcow2
23
result
34
result-*

0 commit comments

Comments
 (0)