diff --git a/.forgejo/workflows/update.yml b/.forgejo/workflows/update.yml index fb490a1..ba9fa06 100644 --- a/.forgejo/workflows/update.yml +++ b/.forgejo/workflows/update.yml @@ -33,7 +33,7 @@ jobs: - name: Update group ${{ inputs.group }} if: inputs.group != '' run: | - ./update.nu ${{ inputs.group }} + nix run .#update -- ${{ inputs.group }} - id: check_changed name: Check any file has changed diff --git a/flake.nix b/flake.nix index 10662e1..b50239f 100644 --- a/flake.nix +++ b/flake.nix @@ -113,6 +113,20 @@ sourcemod-includes sourcemod-addon-socket ]); + update = pkgs: + pkgs.writeShellApplication { + name = "update"; + runtimeInputs = with pkgs; lib.optionals (stdenv.system == "x86_64-linux") [nushell depotdownloader]; + checkPhase = ""; + text = + if (pkgs.stdenv.system == "x86_64-linux") + then '' + nu ${./update.nu} "$@" + '' + else '' + echo "Update script only supports x86_64-linux" + ''; + }; }; checks = { diff --git a/update.nu b/update.nu index 3f3daa9..c5dd887 100755 --- a/update.nu +++ b/update.nu @@ -16,6 +16,9 @@ def main [what: string = "all"] { "addons" => update_addons, "includes" => update_includes, "plugins" => update_plugins, + _ => { + print $"Unknown argument ($what)" + } } nix fmt