Skip to content

Commit

Permalink
misc: update readme and CI
Browse files Browse the repository at this point in the history
CI just builds the artifacts
  • Loading branch information
ships committed Mar 21, 2024
1 parent de101ae commit ee1a306
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: nix-build
on:
pull_request:
push:
branches:
- main

jobs:
build-and-push-oci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: |
nix build \
-L \
-o ./imgTarball \
'.#ociImgBase'
- run: |
nix build \
-L \
-o ./imgTarball \
'.#ociImgIqlQuery'
- if: github.ref == 'refs/heads/main'
run: |
docker load -i ./imgTarball
docker push --all-tags probcomp/inferenceql.query
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# nix
Nix flakes, modules, and reused utility code across the InferenceQL ecosystem
# InferenceQL/nix

This repo holds Nix flake, modules, packages, and reusable utility Nix language code for use across the InferenceQL ecosystem.

## Usage

### Build an artifact

Currently, you can build a package directly like so:

```bash
nix build github.com:InferenceQL/nix#ociImgBase
```

### Import utility code

To access the `lib` code exported by this flake, declare this repo as a flake input:

```nix
{
inputs = {
nixpkgs.url = ...
iqlnix.url = "github"
};
outputs = inputs@{ nixpkgs, iqlnix , ... }: let
# call some function
toolbox = iqlnix.lib.basicTools "aarch64-darwin";
in {
...
};
};
```

0 comments on commit ee1a306

Please sign in to comment.