Config changes
This commit is contained in:
@@ -13,15 +13,16 @@ check_template () {
|
||||
if [ -z "$TEMPLATE" ]; then
|
||||
echo "No template given"
|
||||
list_templates
|
||||
exit 1
|
||||
return 1
|
||||
elif [ ! -e "$TEMPLATES_DIR/$TEMPLATE" ]; then
|
||||
echo "The given template '$TEMPLATE' doesn't exist!"
|
||||
list_templates
|
||||
exit 1
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
devenv_install() {
|
||||
TEMPLATE=$1
|
||||
install -m 644 $TEMPLATES_DIR/$TEMPLATE/* ./
|
||||
echo "use flake . --impure" > .envrc
|
||||
direnv allow
|
||||
@@ -29,22 +30,26 @@ devenv_install() {
|
||||
|
||||
devenv_init() {
|
||||
TEMPLATE=$1
|
||||
check_template $TEMPLATE
|
||||
devenv_install
|
||||
if ! check_template $TEMPLATE ; then
|
||||
return 1
|
||||
fi
|
||||
devenv_install $TEMPLATE
|
||||
}
|
||||
|
||||
devenv_sandbox() {
|
||||
DIRECTORY=$1
|
||||
if [ -z "$DIRECTORY" ]; then
|
||||
show_help_sandbox
|
||||
exit 1
|
||||
return 1
|
||||
fi
|
||||
SANDBOX_DIR="$SANDBOXES_DIR/$DIRECTORY"
|
||||
TEMPLATE=$2
|
||||
if [ -z "$TEMPLATE" ]; then
|
||||
TEMPLATE=$DIRECTORY
|
||||
fi
|
||||
check_template $TEMPLATE
|
||||
if ! check_template $TEMPLATE; then
|
||||
return 1
|
||||
fi
|
||||
if [ ! -e $SANDBOX_DIR ]; then
|
||||
echo "Creating sandbox at $SANDBOX_DIR with template $TEMPLATE"
|
||||
mkdir -p $SANDBOX_DIR
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
projectDependencies = with pkgs; [
|
||||
python = pkgs.python39;
|
||||
pythonPackages = pkgs.python39Packages;
|
||||
|
||||
projectDependencies = with pythonPackages; [
|
||||
];
|
||||
|
||||
in {
|
||||
@@ -16,12 +19,19 @@
|
||||
nativeBuildInputs = [ pkgs.bashInteractive ];
|
||||
buildInputs = with pkgs; [
|
||||
# Core python dependencies
|
||||
python39
|
||||
python39Packages.pip
|
||||
python39Packages.virtualenv
|
||||
python
|
||||
pythonPackages.pip
|
||||
pythonPackages.virtualenv
|
||||
# IDE tools
|
||||
pythonPackages.isort
|
||||
nodePackages.pyright
|
||||
# Development tools
|
||||
python39Packages.ipython
|
||||
black
|
||||
pythonPackages.ipython
|
||||
pythonPackages.pytest
|
||||
pythonPackages.setuptools
|
||||
] ++ projectDependencies;
|
||||
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user