action-checkout: init

This commit is contained in:
DavHau 2023-07-26 19:47:59 +02:00
parent 7f2982bb66
commit 119423deb5
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,24 @@
{
perSystem =
{ config
, pkgs
, ...
}:
let
name = builtins.baseNameOf ./.;
script = config.writers.writePureShellScriptBin
name
[
pkgs.bash
pkgs.coreutils
pkgs.git
pkgs.openssh
]
''
bash ${./script.sh}
'';
in
{
packages.${name} = script;
};
}

View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
# load BRANCH variable with default
BRANCH=${BRANCH:-main}
# load REPO_DIR variable with default
export REPO_DIR=${REPO_DIR:-.}
git clone --depth 1 --branch $BRANCH $REPO $REPO_DIR

View File

@ -42,6 +42,7 @@
imports = [
inputs.treefmt-nix.flakeModule
inputs.clan-core.modules.flake-parts.writers
./flake-parts/action-checkout
./flake-parts/action-flake-update
./flake-parts/action-create-pr
./targets/flake-module.nix