diff --git a/scripts/.local/share/scripts/project-init b/scripts/.local/share/scripts/project-init index 32e364e..84cd100 100755 --- a/scripts/.local/share/scripts/project-init +++ b/scripts/.local/share/scripts/project-init @@ -10,8 +10,10 @@ usage() { } copy_nix_files() { + if [ "$1" = "flake" ]; then + cp ~/Documents/IT/flake-template.nix flake.nix + fi cp ~/Documents/IT/shell.nix . - cp ~/Documents/IT/flake-template.nix flake.nix } git_initialization() { @@ -21,7 +23,11 @@ git_initialization() { } direnv_integration() { - echo "use flake" >.envrc + if [ "$1" = "flake" ]; then + echo "use flake" >.envrc + else + echo "use nix" >.envrc + fi direnv allow } @@ -33,25 +39,25 @@ type=$1 if [ "$type" = "git" ]; then mkdir src data - copy_nix_files + copy_nix_files "flake" git_initialization - direnv_integration + direnv_integration "flake" elif [ "$type" = "remote-git" ]; then touch README.org cp ~/Documents/IT/gpl-3.0.md LICENSE.md - copy_nix_files + copy_nix_files "flake" mkdir src tests data git_initialization - direnv_integration + direnv_integration "flake" elif [ "$type" = "doc" ]; then mkdir docs docs/assets touch docs/Summary.org touch .project elif [ "$type" = "src" ]; then - copy_nix_files + copy_nix_files "nix" mkdir src data touch .project - direnv_integration + direnv_integration "nix" else usage fi