diff --git a/.woodpecker.example.nix b/.woodpecker.example.nix deleted file mode 100644 index bbf67ff49896fe7b369e7f38d9aad00d00fa5dc9..0000000000000000000000000000000000000000 --- a/.woodpecker.example.nix +++ /dev/null @@ -1,13 +0,0 @@ -let - step = name: { - inherit name; - image = "bash"; - commands = [ ''echo "${name}"'' ]; - }; -in -{ - steps = [ - (step "honk") - (step "bonk") - ]; -} diff --git a/README.md b/README.md index 370afb008ec5ac31f06c31d456e707c1fbdb9137..6e6ca61b7c43f739e55c781274bbe225284513a8 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ A [Woodpecker Config Extension](https://woodpecker-ci.org/docs/usage/extensions/configuration-extension) to parse [nix](https://nixos.org/) configs. **NOTE:** This extension will evaluate nix expressions, which can do much more than simple configuration. Only run this extension if you expect trusted nix expressions only. -An example workflow can be found in [.woodpecker.example.nix](.woodpecker.example.nix). - ## Configuration Configuration can be provided via flags, environment variables (prefixed with `NIXPECKER_`), or a [nix](https://nixos.org/) config file (default: `.config.nix`, override with `--config`). diff --git a/flake.nix b/flake.nix index e52376f05f7fa4e4608e87231b23bdb9273e53f5..a83ffbf5ccc48f2128c5b36173f63ef93a5b2bd9 100644 --- a/flake.nix +++ b/flake.nix @@ -196,7 +196,19 @@ User = "root"; Group = "root"; ExecStart = let - pipeline = pkgs.writeText "pipeline.nix" (pkgs.lib.fileContents ./.woodpecker.example.nix); + pipeline = pkgs.writeText "pipeline.nix" '' + { + steps = + let + step = name: { + inherit name; + image = "bash"; + commands = [ "echo \"''${name}\"" ]; + }; + in + [ (step "honk") (step "bonk") ]; + } + ''; in pkgs.writeShellScript "setup-vm-script" '' git config --global user.name "NixUser"