From ee1a306e92589000e268392025ec99d29e5cd1d2 Mon Sep 17 00:00:00 2001 From: "eve n.u" Date: Thu, 21 Mar 2024 14:12:30 -0700 Subject: [PATCH] misc: update readme and CI CI just builds the artifacts --- .github/workflows/nix.yaml | 35 +++++++++++++++++++++++++++++++++++ README.md | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/nix.yaml diff --git a/.github/workflows/nix.yaml b/.github/workflows/nix.yaml new file mode 100644 index 0000000..3b3094e --- /dev/null +++ b/.github/workflows/nix.yaml @@ -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 diff --git a/README.md b/README.md index ab83a0d..28b0a7d 100644 --- a/README.md +++ b/README.md @@ -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 { + ... + }; +}; +```