unset shellHook PATH=${PATH:-} nix_saved_PATH="$PATH" XDG_DATA_DIRS=${XDG_DATA_DIRS:-} nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" BASH='/noshell' HOSTTYPE='x86_64' IFS=' ' IN_NIX_SHELL='impure' export IN_NIX_SHELL LINENO='76' MACHTYPE='x86_64-pc-linux-gnu' NIX_BUILD_CORES='0' export NIX_BUILD_CORES NIX_STORE='/nix/store' export NIX_STORE OLDPWD='' export OLDPWD OPTERR='1' OSTYPE='linux-gnu' PATH='/path-not-set' export PATH PS4='+ ' builder='/nix/store/m6xrxfbgvm8791x09f7ims712hwy3aqh-bash-interactive-5.2-p15/bin/bash' export builder dontAddDisableDepTrack='1' export dontAddDisableDepTrack name='devenv-shell' export name out='/home/vs/workspaces/oss/go-libs/xflags/outputs/out' export out outputs='out' shellHook=' # Remove all the unnecessary noise that is set by the build env unset NIX_BUILD_TOP NIX_BUILD_CORES NIX_STORE unset TEMP TEMPDIR TMP TMPDIR # $name variable is preserved to keep it compatible with pure shell https://github.com/sindresorhus/pure/blob/47c0c881f0e7cfdb5eaccd335f52ad17b897c060/pure.zsh#L235 unset builder out shellHook stdenv system # Flakes stuff unset dontAddDisableDepTrack outputs # For `nix develop`. We get /noshell on Linux and /sbin/nologin on macOS. if [[ "$SHELL" == "/noshell" || "$SHELL" == "/sbin/nologin" ]]; then export SHELL=/nix/store/m6xrxfbgvm8791x09f7ims712hwy3aqh-bash-interactive-5.2-p15/bin/bash fi # https://github.com/numtide/devshell/issues/158 PATH=${PATH#/path-not-set:} export DEVENV_PROFILE=/nix/store/47hf8fqwz31g3mj3kf6dn0bqpj3vjkgh-devenv-profile # add installed packages to PATH export PATH="$DEVENV_PROFILE/bin:$PATH" # prepend common compilation lookup paths export PKG_CONFIG_PATH="$DEVENV_PROFILE/lib/pkgconfig:${PKG_CONFIG_PATH-}" export LD_LIBRARY_PATH="$DEVENV_PROFILE/lib:${LD_LIBRARY_PATH-}" export LIBRARY_PATH="$DEVENV_PROFILE/lib:${LIBRARY_PATH-}" export C_INCLUDE_PATH="$DEVENV_PROFILE/include:${C_INCLUDE_PATH-}" # these provide shell completions / default config options export XDG_DATA_DIRS="$DEVENV_PROFILE/share:${XDG_DATA_DIRS-}" export XDG_CONFIG_DIRS="$DEVENV_PROFILE/etc/xdg:${XDG_CONFIG_DIRS-}" export DEVENV_DOTFILE='\''/home/vs/workspaces/oss/go-libs/xflags/.devenv'\'' export DEVENV_PROFILE='\''/nix/store/47hf8fqwz31g3mj3kf6dn0bqpj3vjkgh-devenv-profile'\'' export DEVENV_ROOT='\''/home/vs/workspaces/oss/go-libs/xflags'\'' export DEVENV_STATE='\''/home/vs/workspaces/oss/go-libs/xflags/.devenv/state'\'' export GIT_EXTERNAL_DIFF='\''difft'\'' export GOPATH='\''/home/vs/workspaces/oss/go-libs/xflags/.devenv/state/go'\'' export GOROOT='\''/nix/store/s0ld5jcy7iqhgcnbak74k1xqdw4r5r3n-go-1.20.8/share/go/'\'' export PATH=$GOPATH/bin:$PATH cat <<'\''EOF'\'' > CONTRIBUTING.md # Contributing to schukai GmbH Projects ## Code of Conduct Be a human, not an asshole. Common sense and basic human decency apply. ## Getting Started ### Setting up the Project 1. Fork the project on GitLab. 2. Clone your fork locally. Replace `[your-username]` with your GitLab username and `[project-name]` with the actual project name: ```bash git clone $(git config --get remote.origin.url) ``` 3. Add the upstream repository. Replace `[original-username]` and `[project-name]` with the original repository'\''s username and project name: ```bash git remote add upstream https://gitlab.schukai.com/[original-username]/[project-name].git ``` ### Making Changes 1. Create a new branch: ```bash git checkout -b new-feature-branch ``` 2. Make your changes. 3. Commit your changes: ```bash git commit -m "Description of change" ``` ### Submitting a Merge Request 1. Push your changes to your fork: ```bash git push origin new-feature-branch ``` 2. Navigate to the original project repository on `gitlab.schukai.com`. 3. Open a Merge Request and provide a clear description of the changes. ## Coding Guidelines - Follow the coding style used in the project. - Write unit tests for new features. - Ensure that all tests pass before submitting a Merge Request. ## Reporting Issues If you find an issue, please create a new issue on `gitlab.schukai.com`. ## Additional Resources - [GitLab Flow](https://docs.gitlab.com/ee/topics/gitlab_flow.html) - [GitLab Merge Request Guidelines](https://docs.gitlab.com/ee/user/project/merge_requests/) Thank you for your contribution! EOF cat <<'\''EOF'\'' > LICENSE Copyright (C) 2023 schukai GmbH This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. EOF cat <<'\''EOF'\'' > Taskfile.yml # THIS FILE IS AUTOGENERATED BY THE DEVENVSHELL # DO NOT EDIT THIS FILE MANUALLY # INSTEAD EDIT THE DEVENVSHELL CONFIGURATION FILE devenv.nix # AND OPEN A SHELL WITH THE COMMAND devenv shell # # Information about the task runner can be found here: # https://taskfile.dev version: '\''3'\'' tasks: default: cmds: - task --list silent: true test: desc: Execute unit tests in Go. env: TEST_BY_TASK: true cmds: - echo "Execute unit tests in Go." - gosec . - go test -tags=runOnTask -cover -v ./... - go test -tags=runOnTask -bench -v ./... - go test -tags=runOnTask -race -v ./... test-fuzz: desc: Conduct fuzzing tests.# env: TEST_BY_TASK: true cmds: - echo "Conduct fuzzing tests." - go test -tags=runOnTask -v -fuzztime=30s -fuzz=Fuzz ./... add-licenses: desc: Attach license headers to Go files. cmds: - echo "Attach license headers to Go files." - go install github.com/google/addlicense@latest - addlicense -c "schukai GmbH" -s -l "AGPL-3.0" ./*.go silent: true check-licenses: desc: Check license headers of Go files. silent: true cmds: - go-licenses save "$(get-go-default-packages)" --ignore "gitlab.schukai.com" --force --save_path ${DEVENV_ROOT}/licenses/ check: desc: Confirm repository status. cmds: - git diff-index --quiet HEAD || (echo "There are uncommitted changes after running make. Please commit or stash them before running make."; exit 1) silent: true commit: desc: Commit changes to the repository. aliases: - c - ci - git-commit cmds: - do-git-commit EOF cat <<'\''EOF'\'' > .gitlab-ci.yml # THIS FILE IS AUTOGENERATED BY THE DEVENVSHELL # DO NOT EDIT THIS FILE MANUALLY # INSTEAD EDIT THE DEVENVSHELL CONFIGURATION FILE devenv.nix # AND OPEN A SHELL WITH THE COMMAND devenv shell # image: docker-registry.schukai.com:443/nixos-ci-devenv:latest variables: # The repo name as used in # https://github.com/nix-community/NUR/blob/master/repos.json NIXOS_VERSION: "23.05" NIXPKGS_ALLOW_UNFREE: "1" NIXPKGS_ALLOW_INSECURE: "1" GIT_DEPTH: 10 stages: - test - deploy before_script: - echo > .env-gitlab-ci - variables=("HOME=$HOME" "CI_COMMIT_REF_NAME=$CI_COMMIT_REF_NAME" "CI_REPOSITORY_URL=$CI_REPOSITORY_URL" "GITLAB_TOKEN=$GITLAB_TOKEN" "CI_JOB_TOKEN=$CI_JOB_TOKEN" "GITLAB_USER_EMAIL=$GITLAB_USER_EMAIL" "GITLAB_USER_NAME=\"$GITLAB_USER_NAME\"" "CI_REGISTRY_USER=$CI_REGISTRY_USER" "CI_PROJECT_ID=$CI_PROJECT_ID" "CI_PROJECT_DIR=$CI_PROJECT_DIR" "CI_API_V4_URL=$CI_API_V4_URL" "CI_PROJECT_NAME=$CI_PROJECT_NAME" "CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA"); for var in "${variables[@]}"; do echo "$var" >> .env-gitlab-ci; done - cat .env-gitlab-ci after_script: - if [ -f .env-gitlab-ci ]; then rm .env-gitlab-ci; fi test: stage: test tags: - nixos script: - devenv shell test-lib cache: - key: nixos paths: - /nix/store artifacts: paths: - dist deploy: stage: deploy tags: - nixos script: - devenv shell -c deploy-lib when: on_success cache: - key: nixos paths: - /nix/store EOF export PS1="\[\e[0;34m\](devenv)\[\e[0m\] ${PS1-}" # set path to locales on non-NixOS Linux hosts if [ -z "${LOCALE_ARCHIVE-}" ]; then export LOCALE_ARCHIVE=/nix/store/0g0c6sbrqxmywr636qzxni44wrqqrbdp-glibc-locales-2.37-45/lib/locale/locale-archive fi # note what environments are active, but make sure we don'\''t repeat them if [[ ! "${DIRENV_ACTIVE-}" =~ (^|:)"$PWD"(:|$) ]]; then export DIRENV_ACTIVE="$PWD:${DIRENV_ACTIVE-}" fi # devenv helper if [ ! type -p direnv &>/dev/null && -f .envrc ]; then echo "You have .envrc but direnv command is not installed." echo "Please install direnv: https://direnv.net/docs/installation.html" fi mkdir -p .devenv rm -f .devenv/profile ln -s /nix/store/47hf8fqwz31g3mj3kf6dn0bqpj3vjkgh-devenv-profile .devenv/profile ' export shellHook stdenv='/nix/store/x0q2kzj5jxz32gdhf9dhilzkh4m79p9i-naked-stdenv' export stdenv system='x86_64-linux' export system runHook () { eval "$shellHook"; unset runHook } PATH="$PATH:$nix_saved_PATH" XDG_DATA_DIRS="$XDG_DATA_DIRS:$nix_saved_XDG_DATA_DIRS" export NIX_BUILD_TOP="$(mktemp -d -t nix-shell.XXXXXX)" export TMP="$NIX_BUILD_TOP" export TMPDIR="$NIX_BUILD_TOP" export TEMP="$NIX_BUILD_TOP" export TEMPDIR="$NIX_BUILD_TOP" eval "$shellHook"