feat: nih forgejo alias
This commit is contained in:
@@ -262,6 +262,8 @@ case "$1" in
|
||||
"exec" | "x" ) shift 1; nih-execute "$@" ;;
|
||||
"sync") nih-sync "$flake_dir" "$host" ;;
|
||||
"format") nih-format "$flake_dir" ;;
|
||||
"forgejo") shift 1; nih-forgejo "$@" ;;
|
||||
"forgejo-act") shift 1; nih-forgejo-act "$@" ;;
|
||||
*) gum log --structured --prefix 'nih' --level error "Command $1 does not exist" ;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -23,6 +23,35 @@
|
||||
flake_dir="${toString cfg.flakeDir}";
|
||||
host="${toString cfg.host}";
|
||||
|
||||
function nih-forgejo() {
|
||||
${
|
||||
if config.services.forgejo.actions.enable
|
||||
then ''
|
||||
sudo --user=${config.services.forgejo.user} \
|
||||
${config.services.forgejo.package}/bin/gitea \
|
||||
--work-path ${config.services.forgejo.stateDir} \
|
||||
"$@"
|
||||
''
|
||||
else ''
|
||||
gum log --structured --prefix 'nih' --level error "Forgejo action runnser service is not enabled"
|
||||
''
|
||||
}
|
||||
}
|
||||
|
||||
function nih-forgejo-act() {
|
||||
${
|
||||
if config.services.forgejo.enable
|
||||
then ''
|
||||
sudo --user=${config.services.forgejo.user} \
|
||||
${config.services.gitea-actions-runner.package}/bin/act_runner \
|
||||
--config /var/lib/gitea-runner/forgejo${toString config.services.forgejo.settings.server.HTTP_PORT} \
|
||||
"$@"
|
||||
''
|
||||
else ''
|
||||
gum log --structured --prefix 'nih' --level error "Forgejo service is not enabled"
|
||||
''
|
||||
}
|
||||
}
|
||||
|
||||
${builtins.readFile ./cli.sh}
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user