2020-08-27 19:27:12 +02:00
|
|
|
{ briefcase, pkgs, ... }:
|
2020-08-21 12:12:57 +02:00
|
|
|
|
|
|
|
let
|
2020-08-31 02:16:31 +02:00
|
|
|
inherit (builtins) fetchGit path toJSON;
|
|
|
|
inherit (briefcase.emacs) initEl runScript;
|
|
|
|
|
|
|
|
elispLintSrc = fetchGit {
|
2020-08-27 19:27:12 +02:00
|
|
|
url = "https://github.com/gonewest818/elisp-lint";
|
|
|
|
rev = "2b645266be8010a6a49c6d0ebf6a3ad5bd290ff4";
|
|
|
|
};
|
|
|
|
|
2020-08-21 12:12:57 +02:00
|
|
|
pipeline.steps = [
|
2020-08-22 10:09:15 +02:00
|
|
|
{
|
|
|
|
key = "lint-secrets";
|
|
|
|
command = "${pkgs.git-secrets}/bin/git-secrets --scan-history";
|
|
|
|
label = ":broom: lint secrets";
|
|
|
|
}
|
2020-08-21 12:12:57 +02:00
|
|
|
{
|
2020-08-21 19:40:30 +02:00
|
|
|
key = "build-briefcase";
|
2020-08-31 01:48:30 +02:00
|
|
|
command = ''
|
|
|
|
nix-build . -I briefcase="$(pwd)" --no-out-link --show-trace
|
|
|
|
'';
|
2020-08-21 19:40:30 +02:00
|
|
|
label = ":nix: build briefcase";
|
2020-08-22 10:09:15 +02:00
|
|
|
depends_on = "lint-secrets";
|
2020-08-21 19:40:30 +02:00
|
|
|
}
|
2020-08-27 19:27:12 +02:00
|
|
|
{
|
|
|
|
key = "init-emacs";
|
2020-08-31 02:16:31 +02:00
|
|
|
command = let
|
|
|
|
scriptEl = path {
|
|
|
|
path = ./script.el;
|
|
|
|
name = "script.el";
|
|
|
|
};
|
|
|
|
runScriptEl = runScript {
|
|
|
|
script = scriptEl;
|
|
|
|
briefcasePath = "$(pwd)";
|
|
|
|
};
|
|
|
|
in "${runScriptEl} ${initEl}";
|
2020-08-27 19:27:12 +02:00
|
|
|
label = ":gnu: initialize Emacs";
|
|
|
|
depends_on = "build-briefcase";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = "lint-emacs";
|
2020-08-31 02:16:31 +02:00
|
|
|
command = let
|
|
|
|
nixosEmacs = briefcase.emacs.nixos {
|
|
|
|
briefcasePath = "$(pwd)";
|
|
|
|
};
|
|
|
|
in ''
|
|
|
|
${nixosEmacs}/bin/wpcarros-emacs \
|
2020-08-27 19:27:12 +02:00
|
|
|
--quick \
|
|
|
|
--batch \
|
|
|
|
--load ${elispLintSrc}/elisp-lint.el \
|
|
|
|
--funcall elisp-lint-files-batch \
|
2020-08-31 13:37:31 +02:00
|
|
|
./emacs/.emacs.d/wpc/*.el
|
2020-08-27 19:27:12 +02:00
|
|
|
'';
|
|
|
|
label = ":gnu: lint Emacs";
|
|
|
|
depends_on = "init-emacs";
|
|
|
|
}
|
2020-08-21 19:40:30 +02:00
|
|
|
{
|
|
|
|
key = "build-socrates";
|
2020-08-21 12:12:57 +02:00
|
|
|
command = ''
|
|
|
|
nix-build '<nixpkgs/nixos>' \
|
|
|
|
-I briefcase="$(pwd)" \
|
|
|
|
-I nixpkgs=/var/lib/buildkite-agent-socrates/nixpkgs-channels \
|
|
|
|
-I nixos-config=nixos/socrates/default.nix \
|
|
|
|
-A system \
|
|
|
|
--no-out-link \
|
|
|
|
--show-trace
|
|
|
|
'';
|
2020-08-21 19:40:30 +02:00
|
|
|
label = ":nix: build socrates";
|
|
|
|
depends_on = "build-briefcase";
|
2020-08-21 12:12:57 +02:00
|
|
|
}
|
|
|
|
];
|
2020-08-31 02:16:31 +02:00
|
|
|
in pkgs.writeText "pipeline.yaml" (toJSON pipeline)
|