Skip to content

Commit

Permalink
Update the Nix setup to rely on the Coq Nix Toolbox.
Browse files Browse the repository at this point in the history
Use the dynamic workflow generation.
  • Loading branch information
Zimmi48 committed Jul 1, 2021
1 parent 16d30ab commit 0f9aac0
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 62 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/nix-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This file was generated from `meta.yml`, please do not edit manually.
# Follow the instructions on https://github.com/coq-community/templates to regenerate.
name: Nix CI

on:
push:
branches:
- master
pull_request:
branches:
- '**'

jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Do nothing
run: echo "No setup, using meta.yml bundles"
"aac-tactics":
name: Main build
runs-on: ubuntu-latest
strategy:
matrix:
bundle:
- default
steps:
- name: Cachix install
uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup coq
uses: cachix/cachix-action@v8
with:
# Name of a cachix cache to pull/substitute
name: coq
- name: Cachix setup coq-community
uses: cachix/cachix-action@v8
with:
# Name of a cachix cache to pull/substitute
name: coq-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Git checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Building/fetching dependencies
run: nix-build --no-out-link --argstr bundle "${{ matrix.bundle }}" --argstr job "_deps"
- name: Building/fetching current project
run: nix-build --no-out-link --argstr bundle "${{ matrix.bundle }}" --argstr job "aac-tactics"
30 changes: 0 additions & 30 deletions .github/workflows/nix-ci.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .nix/coq-nix-toolbox.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file was generated from meta.yml, please do not edit manually.
# Follow the instructions on https://github.com/coq-community/templates to regenerate.
"a0c0f3d7deddacbe4575ac3c3c63f43dd103c175"
47 changes: 47 additions & 0 deletions .nix/fallback-config.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This file was generated from `meta.yml`, please do not edit manually.
# Follow the instructions on https://github.com/coq-community/templates to regenerate.

# *However*, you may copy paste it to `config.nix`
# in the same subdirectory .nix and extend it as needed.
# Note that this would completely deactivate this file.

{
## DO NOT CHANGE THE format
format = "1.0.0";
## unless you made an automated or manual update
## to another supported format.

## The attribute to build, either from nixpkgs
## of from the overlays located in `.nix/coq-overlays`
attribute = "aac-tactics";

## If you want to select a different attribute
## to serve as a basis for nix-shell edit this
# shell-attribute = "aac-tactics";

## Maybe the shortname of the library is different from
## the name of the nixpkgs attribute, if so, set it here:
pname = "aac-tactics";

## Lists the dependencies, phrased in terms of nix attributes.
## No need to list Coq, it is already included.
## These dependencies will systematically be added to the currently
## known dependencies, if any more than Coq.
## /!\ Remove this field as soon as the package is available on nixpkgs.
## /!\ Manual overlays in `.nix/coq-overlays` should be preferred then.
#buildInputs = [ ];

## Indicate the relative location of your _CoqProject
## If not specified, it defaults to "_CoqProject"
coqproject = "_CoqProject";

## Select a bundle to build by default in the following `bundles` set
## It will be used when typing nix-shell or nix-build without argument
## defaults to "default"
default-bundle = "default";
bundles."default" = {};

bundles."default" = {
coqPackages."coq".override.version = "master";
};
}
40 changes: 11 additions & 29 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
# This file was generated from `meta.yml`, please do not edit manually.
# Follow the instructions on https://github.com/coq-community/templates to regenerate.

{ pkgs ? (import <nixpkgs> {}), coq-version-or-url, shell ? false }:

let
coq-version-parts = builtins.match "([0-9]+).([0-9]+)" coq-version-or-url;
coqPackages =
if coq-version-parts == null then
pkgs.mkCoqPackages (import (fetchTarball coq-version-or-url) {})
else
pkgs."coqPackages_${builtins.concatStringsSep "_" coq-version-parts}";
in

with coqPackages;

pkgs.stdenv.mkDerivation {

name = "aac-tactics";

buildInputs = with coq.ocamlPackages; [ ocaml findlib ]
++ pkgs.lib.optionals shell [ merlin ocp-indent ocp-index ];

propagatedBuildInputs = [
coq
];

src = if shell then null else ./.;

installFlags = "COQMF_COQLIB=$(out)/lib/coq/${coq.coq-version}/";
}
{ config ? {}, withEmacs ? false, print-env ? false, do-nothing ? false,
update-nixpkgs ? false, ci-matrix ? false,
override ? {}, ocaml-override ? {}, global-override ? {},
bundle ? null, job ? null, inNixShell ? null, src ? ./.,
}@args:
let auto = fetchGit {
url = "https://github.com/coq-community/coq-nix-toolbox.git";
ref = "master";
rev = import ./.nix/coq-nix-toolbox.nix;
}; in
(import auto ({inherit src;} // args))
14 changes: 11 additions & 3 deletions meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,20 @@ supported_ocaml_versions:
text: 4.05.0 or later
opam: '{>= "4.05.0"}'

tested_coq_nix_versions:
- version_or_url: https://github.com/coq/coq-on-cachix/tarball/master

tested_coq_opam_versions:
- version: dev

cachix:
- name: coq
- name: coq-community
token: CACHIX_AUTH_TOKEN

nix-bundles:
- bundle: default
packages:
- name: coq
version: master

namespace: AAC_tactics

keywords:
Expand Down

0 comments on commit 0f9aac0

Please sign in to comment.