16 lines
425 B
Nix
16 lines
425 B
Nix
|
{ pkgs, ... }:
|
||
|
|
||
|
let
|
||
|
hostname = "woodpecker.monotremata.xyz";
|
||
|
shell = "${pkgs.dash}/bin/dash";
|
||
|
pass = "${pkgs.pass}/bin/pass";
|
||
|
woodpecker-cli = "${pkgs.woodpecker-cli}/bin/woodpecker-cli";
|
||
|
in pkgs.writeScriptBin "woodpecker-cli" ''
|
||
|
#!${shell}
|
||
|
WOODPECKER_SERVER="https://${hostname}"
|
||
|
WOODPECKER_TOKEN=$(${pass} "${hostname}/token")
|
||
|
export WOODPECKER_SERVER
|
||
|
export WOODPECKER_TOKEN
|
||
|
${woodpecker-cli} "$@"
|
||
|
''
|