Home

nixpecker @main - refs - log -
-
https://git.jolheiser.com/nixpecker.git
Woodpecker config service for nix
tree log patch
example Signed-off-by: jolheiser <git@jolheiser.com>
Signature
-----BEGIN SSH SIGNATURE----- U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgBTEvCQk6VqUAdN2RuH6bj1dNkY oOpbPWj+jw4ua1B1cAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5 AAAAQDSbY4VnjVTa+/44HWOunKyE6oxKgu7tVG5WisOsiHFbBi2kTHUo3Wnfr418ua/sYx GTYVunTQTjAJQEhPcuZgk= -----END SSH SIGNATURE-----
jolheiser <git@jolheiser.com>
1 hour ago
3 changed files, 16 additions(+), 13 deletions(-)
.woodpecker.example.nixREADME.mdflake.nix
I .woodpecker.example.nix
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
diff --git a/.woodpecker.example.nix b/.woodpecker.example.nix
new file mode 100644
index 0000000000000000000000000000000000000000..bbf67ff49896fe7b369e7f38d9aad00d00fa5dc9
--- /dev/null
+++ b/.woodpecker.example.nix
@@ -0,0 +1,13 @@
+let
+  step = name: {
+    inherit name;
+    image = "bash";
+    commands = [ ''echo "${name}"'' ];
+  };
+in
+{
+  steps = [
+    (step "honk")
+    (step "bonk")
+  ];
+}
M README.md -> README.md
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
diff --git a/README.md b/README.md
index 6e6ca61b7c43f739e55c781274bbe225284513a8..370afb008ec5ac31f06c31d456e707c1fbdb9137 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,8 @@ 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`).
M flake.nix -> flake.nix
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff --git a/flake.nix b/flake.nix
index a83ffbf5ccc48f2128c5b36173f63ef93a5b2bd9..e52376f05f7fa4e4608e87231b23bdb9273e53f5 100644
--- a/flake.nix
+++ b/flake.nix
@@ -196,19 +196,7 @@                   User = "root";
                   Group = "root";
                   ExecStart =
                     let
-                      pipeline = pkgs.writeText "pipeline.nix" ''
-                        {
-                          steps =
-                            let
-                              step = name: {
-                                inherit name;
-                                image = "bash";
-                                commands = [ "echo \"''${name}\"" ];
-                              };
-                            in
-                            [ (step "honk") (step "bonk") ];
-                        }
-                      '';
+                      pipeline = pkgs.writeText "pipeline.nix" (pkgs.lib.fileContents ./.woodpecker.example.nix);
                     in
                     pkgs.writeShellScript "setup-vm-script" ''
                       git config --global user.name "NixUser"