-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from emacs-twist/update-api
Update the configuration on API changes, add a template
- Loading branch information
Showing
9 changed files
with
250 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Check template | ||
on: | ||
push: | ||
paths: | ||
- template/** | ||
workflow_dispatch: | ||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@V27 | ||
- name: Install just | ||
run: nix profile install nixpkgs#just | ||
- name: Lint justfile | ||
working-directory: template | ||
run: just -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
inputs = { | ||
flake-parts.url = "github:hercules-ci/flake-parts"; | ||
elisp-rice.url = "github:emacs-twist/elisp-rice"; | ||
|
||
systems.url = "github:nix-systems/default"; | ||
|
||
emacs-ci.url = "github:purcell/nix-emacs-ci"; | ||
twist.url = "github:emacs-twist/twist.nix"; | ||
|
||
# Inputs that should be overridden for each project. | ||
rice-src.url = "github:emacs-twist/rice-config?dir=example"; | ||
# If your project depends only on built-in packages, you don't have to | ||
# override this. Also see https://github.com/NixOS/nix/issues/9339 | ||
rice-lock.url = "github:emacs-twist/rice-config?dir=lock"; | ||
|
||
emacs-builtins.url = "github:emacs-twist/emacs-builtins"; | ||
|
||
registries.url = "github:emacs-twist/registries"; | ||
registries.inputs.melpa.follows = "melpa"; | ||
|
||
melpa.url = "github:melpa/melpa"; | ||
melpa.flake = false; | ||
}; | ||
|
||
# Use the binary cache of emacs-ci executables. | ||
nixConfig = { | ||
extra-substituters = "https://emacs-ci.cachix.org"; | ||
extra-trusted-public-keys = "emacs-ci.cachix.org-1:B5FVOrxhXXrOL0S+tQ7USrhjMT5iOPH+QN9q0NItom4="; | ||
}; | ||
|
||
outputs = { | ||
nixpkgs, | ||
flake-parts, | ||
... | ||
} @ inputs: | ||
flake-parts.lib.mkFlake {inherit inputs;} ({flake-parts-lib, ...}: let | ||
systems = import inputs.systems; | ||
in { | ||
inherit systems; | ||
imports = [ | ||
inputs.elisp-rice.flakeModules.default | ||
]; | ||
elisp-rice = inputs.elisp-rice.lib.configFromInputs { | ||
inherit (inputs) rice-src rice-lock registries systems; | ||
}; | ||
perSystem = { | ||
system, | ||
config, | ||
pkgs, | ||
... | ||
}: { | ||
# Configure the perSystem environment. | ||
_module.args.pkgs = import nixpkgs { | ||
inherit system; | ||
overlays = [ | ||
# This overlay is required to make `emacsTwist` function available | ||
# in the flake-parts module. | ||
inputs.twist.overlays.default | ||
]; | ||
}; | ||
|
||
# Configure the per-system Emacs package set. | ||
elisp-rice = { | ||
# Disable the packages until the lock directory is available. | ||
enableElispPackages = false; | ||
emacsPackageSet = inputs.emacs-ci.packages.${system}; | ||
}; | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Copied from the template | ||
justfile linguist-vendored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Check Emacs Lisp | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'README.*' | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- 'README.*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
byte-compile: | ||
uses: emacs-twist/elisp-workflows/.github/workflows/byte-compile.yml@master | ||
# with: | ||
# rice-config: github:emacs-twist/rice-config | ||
# melpa: github:akirak/melpa/akirak | ||
# systems: github:nix-systems/x86_64-linux | ||
# lock-dir: .rice-lock/default | ||
|
||
melpazoid: | ||
uses: emacs-twist/elisp-workflows/.github/workflows/melpazoid.yml@master | ||
# with: | ||
# rice-config: github:emacs-twist/rice-config | ||
# melpa: github:akirak/melpa/akirak | ||
# lock-dir: .rice-lock/default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Emacs Lisp | ||
*.elc | ||
|
||
# Optionally generated by Nix git-hooks | ||
.pre-commit-config.yaml | ||
|
||
# Nix | ||
result | ||
result-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
outputs = {...}: { | ||
elisp-rice = { | ||
packages = | ||
builtins.trace | ||
"[1;31mwarning: To use rice-config, please set the package name(s) in flake.nix[0m" | ||
[ | ||
(abort "Please set the package name (without .el)") | ||
]; | ||
# Configure tests | ||
tests = { | ||
# buttercup.enable = true; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Update this if you have forked rice-config | ||
rice-config := "github:emacs-twist/rice-config" | ||
|
||
# Specify a flake reference to a repository and branch where the package recipe | ||
# is defined. | ||
melpa := "github:melpa/melpa/master" | ||
# Before it is available on melpa, you need to specify a non-default branch. | ||
# melpa := "github:akirak/melpa/akirak" | ||
|
||
# Relative path to the lock directory | ||
lock-dir := ".rice-lock/default" | ||
|
||
# This is only to avoid repetition, and you usually don't edit this. | ||
common-options-without-lock := "--override-input rice-src \"path:$PWD\" --override-input melpa " + quote(melpa) | ||
|
||
common-options-with-lock := common-options-without-lock + " --override-input rice-lock \"path:$PWD/" + lock-dir + "\"" | ||
|
||
# The name of an Emacs package from nix-emacs-ci | ||
emacs := "emacs-release-snapshot" | ||
|
||
# Name of the package under test | ||
package := error("Please set the package name in justfile") | ||
|
||
# Don't edit this | ||
arch := shell('nix eval --expr builtins.currentSystem --impure --raw') | ||
|
||
# Show the flake | ||
show *OPTIONS: | ||
nix flake show {{ rice-config }} {{ OPTIONS }} {{ common-options-with-lock }} --override-input systems github:nix-systems/{{ arch }} --allow-import-from-derivation | ||
|
||
# Evaluate an attribute on the flake, e.g. just eval melpaRecipes. | ||
eval ATTR *OPTIONS: | ||
nix eval {{rice-config}}\#{{ATTR}} {{OPTIONS}} {{ common-options-with-lock }} --override-input systems github:nix-systems/{{ arch }} --allow-import-from-derivation | ||
|
||
# Generate a lock directory. | ||
lock *OPTIONS: | ||
mkdir -p "$(dirname {{ lock-dir }})" | ||
nix run "{{ rice-config }}?dir=make-lock#lock-with-{{ emacs }}" {{ common-options-without-lock }} --impure -- {{ OPTIONS }} {{ lock-dir }} | ||
|
||
# Enter a shell for byte-compiling individual source files | ||
shell-compile: | ||
nix develop {{ rice-config }}\#{{ emacs }}-for-{{ package }} {{ common-options-with-lock }} | ||
|
||
# Re-run byte-compile every time a file is modified | ||
watch-compile: | ||
nix develop {{ rice-config }}\#{{ emacs }}-for-{{ package }} {{ common-options-with-lock }} -c bash -c 'echo >&2 Watching *.el; ls *.el | entr -p elisp-byte-compile /_' | ||
|
||
# Byte-compile the package | ||
check-compile: | ||
nix build {{ rice-config }}\#checks.{{ arch }}.{{ package }}-compile-{{ emacs }} {{ common-options-with-lock }} --print-build-logs | ||
|
||
# Enter a shell for running tests | ||
shell-emacs *OPTIONS: | ||
nix shell {{ rice-config }}\#{{ emacs }}-with-packages {{ common-options-with-lock }} {{ OPTIONS }} | ||
|
||
test-buttercup *OPTIONS: | ||
nix run {{ rice-config }}\#test-buttercup-with-{{ emacs }} {{ common-options-with-lock }} {{ OPTIONS }} |