Compare commits

...

1 Commits

Author SHA1 Message Date
21822a0c0e Nix CI tryouts
Some checks failed
Build image / build-image (push) Failing after 5s
2025-10-06 01:38:10 +02:00
2 changed files with 22 additions and 13 deletions

View File

@ -6,25 +6,34 @@ on:
jobs: jobs:
build-image: build-image:
container: container:
image: catthehacker/ubuntu:act-latest image: node:24-bookworm
env:
USER: node
NIX_CONFIG: experimental-features = nix-command flakes
volumes:
- /home/paul/nix-ci/nix-runner-nix:/nix
- /home/paul/nix-ci/nix-runner-etc-nix:/etc/nix
- /home/paul/nix-ci/nix-runner-home-node:/home/node
options: --user 1000:1000
steps: steps:
- run: |
cat /var/run/act/workflow/0.sh
if [ ! -f ~/.nix-profile/etc/profile.d/nix.sh ]; then
bash <(curl -L https://nixos.org/nix/install) --no-daemon
fi
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v4 uses: actions/checkout@v4
# Required for installing nix
- name: Install sudo
run: apt-get update && apt-get install -y sudo
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
enable_kvm: false
- name: Get image meta - name: Get image meta
run: nix build .#image-meta -o image-meta run: |
. ~/.nix-profile/etc/profile.d/nix.sh
nix build .#image-meta -o image-meta
- name: Version check - name: Version check
run: | run: |
VERSION=$(cat image-meta/version) VERSION=$(cat image-meta/version)
[ "$GITHUB_REF_NAME" = v"$VERSION" ] [ "$GITHUB_REF_NAME" = v"$VERSION" ]
- name: Build image - run: |
run: nix build .#image -o image.tar.gz . ~/.nix-profile/etc/profile.d/nix.sh
nix build --log-format raw --print-build-logs .#image -o image.tar.gz
- run: docker login -u paul -p "$PASSWORD" git.pbrinkmeier.de - run: docker login -u paul -p "$PASSWORD" git.pbrinkmeier.de
env: env:
PASSWORD: "${{ secrets.REGISTRY_PASSWORD }}" PASSWORD: "${{ secrets.REGISTRY_PASSWORD }}"

View File

@ -20,11 +20,11 @@
vendorHash = null; vendorHash = null;
# For building the package, we use only the files not ignored by Git as inputs. # For building the package, we use only the files not ignored by Git as inputs.
# Also, flake.nix and flake.lock are not included to avoid annoying rebuilds when # Also, flake.nix, flake.lock and .gitea are not included to avoid annoying rebuilds when
# working on them. # working on them.
src = pkgs.lib.cleanSourceWith { src = pkgs.lib.cleanSourceWith {
src = gitignore.lib.gitignoreSource ./.; src = gitignore.lib.gitignoreSource ./.;
filter = path: type: builtins.baseNameOf path != "flake.nix" && builtins.baseNameOf path != "flake.lock"; filter = path: type: builtins.baseNameOf path != "flake.nix" && builtins.baseNameOf path != "flake.lock" && builtins.match "^\\.gitea.*" path != null;
}; };
# Avoid linking against libc # Avoid linking against libc