Skip to content

Commit

Permalink
idx
Browse files Browse the repository at this point in the history
  • Loading branch information
svpino committed Oct 15, 2024
1 parent 1546f05 commit 87a0234
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .idx/dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
'';

metaflow-local-config = ''
echo '{}' > ~/.metaflowconfig/config_local.json
'';
};
Expand Down
21 changes: 21 additions & 0 deletions idx-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,26 @@
"description": "Building Machine Learning Systems Template",
"icon": "https://s3.amazonaws.com/www.ml.school/logo.png",
"params": [
{
"id": "aws_access_key_id",
"name": "AWS Access Key ID",
"type": "string",
"default": "",
"required": false
},
{
"id": "aws_secret_access_key",
"name": "AWS Secret Access Key",
"type": "string",
"default": "",
"required": false
},
{
"id": "aws_region",
"name": "AWS Region",
"type": "string",
"default": "us-east-1",
"required": false
}
]
}
24 changes: 20 additions & 4 deletions idx-template.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, ... }: {
{ pkgs, aws_access_key_id ? "", aws_secret_access_key ? "", aws_region ? "us-east-1", ... }: {
channel = "stable-23.11";

bootstrap = ''
Expand All @@ -10,8 +10,24 @@
# Set some permissions
chmod -R +w "$out"

# Remove the template files themselves and any connection to the template's
# Git repository
rm -rf "$out/.git" "$out/idx-template".{nix,json}
# Remove the template files
rm -rf "$out/idx-template".{nix,json}

${
if aws_access_key_id != "" then ''
mkdir ~/.aws
cat << EOF >> ~/.aws/credentials
[default]
aws_access_key_id = ${aws_access_key_id}
aws_secret_access_key = ${aws_secret_access_key}
EOF
cat << EOF >> ~/.aws/config
[default]
region = ${aws_region}
EOF
'';
}
'';
}

0 comments on commit 87a0234

Please sign in to comment.