Add nix-ld option to project-init

This commit is contained in:
coolneng 2022-09-04 08:44:32 +02:00
parent 39ee7e9042
commit ef7d21638d
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 6 additions and 0 deletions

View File

@ -6,12 +6,15 @@ usage() {
echo "type remote-git: VCS project with README, LICENSE and tests" echo "type remote-git: VCS project with README, LICENSE and tests"
echo "type src: Simple coding project" echo "type src: Simple coding project"
echo "type doc: Assignment" echo "type doc: Assignment"
echo "type nix-ld: Run unpatched programs with Nix"
exit 1 exit 1
} }
copy_nix_files() { copy_nix_files() {
if [ "$1" = "flake" ]; then if [ "$1" = "flake" ]; then
cp ~/Documents/IT/flake-template.nix flake.nix cp ~/Documents/IT/flake-template.nix flake.nix
elif [ "$1" = "nix-ld" ]; then
cp ~/Documents/IT/nix-ld.nix shell.nix
fi fi
cp ~/Documents/IT/shell.nix . cp ~/Documents/IT/shell.nix .
} }
@ -58,6 +61,9 @@ elif [ "$type" = "src" ]; then
mkdir src data mkdir src data
touch .project touch .project
direnv_integration "nix" direnv_integration "nix"
elif [ "$type" = "nix-ld" ]; then
copy_nix_files "nix-ld"
direnv_integration "nix"
else else
usage usage
fi fi