forked from clan/clan-infra
action-checkout: init
This commit is contained in:
parent
7f2982bb66
commit
119423deb5
24
flake-parts/action-checkout/default.nix
Normal file
24
flake-parts/action-checkout/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
10
flake-parts/action-checkout/script.sh
Normal file
10
flake-parts/action-checkout/script.sh
Normal 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
|
@ -42,6 +42,7 @@
|
|||||||
imports = [
|
imports = [
|
||||||
inputs.treefmt-nix.flakeModule
|
inputs.treefmt-nix.flakeModule
|
||||||
inputs.clan-core.modules.flake-parts.writers
|
inputs.clan-core.modules.flake-parts.writers
|
||||||
|
./flake-parts/action-checkout
|
||||||
./flake-parts/action-flake-update
|
./flake-parts/action-flake-update
|
||||||
./flake-parts/action-create-pr
|
./flake-parts/action-create-pr
|
||||||
./targets/flake-module.nix
|
./targets/flake-module.nix
|
||||||
|
Loading…
Reference in New Issue
Block a user