Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coder deployment for INF110
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Théo Zimmermann
Coder deployment for INF110
Commits
0b2c2f50
Unverified
Commit
0b2c2f50
authored
2 months ago
by
Théo Zimmermann
Browse files
Options
Downloads
Patches
Plain Diff
Enable running Jupyter from VS Code.
parent
675efad9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
flake.nix
+32
-14
32 additions, 14 deletions
flake.nix
with
34 additions
and
14 deletions
.gitignore
+
2
−
0
View file @
0b2c2f50
...
...
@@ -2,7 +2,9 @@ openrc
*.csv
.direnv
.ipynb_checkpoints
venv
result
snapshots
*.tar.zst
*.zip
*~
\ No newline at end of file
This diff is collapsed.
Click to expand it.
flake.nix
+
32
−
14
View file @
0b2c2f50
...
...
@@ -4,28 +4,46 @@
};
outputs
=
{
self
,
nixpkgs
}:
let
pkgs
=
nixpkgs
.
legacyPackages
.
x86_64-linux
;
let
pkgs
=
nixpkgs
.
legacyPackages
.
x86_64-linux
;
pythonPackages
=
pkgs
.
python311Packages
;
venvDir
=
"venv"
;
in
{
devShell
.
x86_64-linux
=
pkgs
.
mkShell
{
buildInputs
=
with
pkgs
;
[
(
python311
.
withPackages
(
ps
:
with
ps
;
[
# We need to make sure that all Python the programs are installed
# with the same version of Python to avoid overriding PYTHONPATH
jupyter
python-openstackclient
python-magnumclient
python-octaviaclient
httpie
requests
]))
buildInputs
=
with
pkgs
;
with
pythonPackages
;
[
# We need to make sure that all Python the programs are installed
# with the same version of Python to avoid overriding PYTHONPATH
jupyter
python-openstackclient
python-magnumclient
python-octaviaclient
httpie
requests
pwgen
jq
nixpkgs-fmt
];
shellHook
=
''
source openrc
SOURCE_DATE_EPOCH=$(date +%s)
if [ -d "
${
venvDir
}
" ]; then
echo "Skipping venv creation, '
${
venvDir
}
' already exists"
else
echo "Creating new venv environment in path: '
${
venvDir
}
'"
# Note that the module venv was only introduced in python 3, so for 2.7
# this needs to be replaced with a call to virtualenv
${
pythonPackages
.
python
.
interpreter
}
-m venv "
${
venvDir
}
"
fi
# Under some circumstances it might be necessary to add your virtual
# environment to PYTHONPATH, which you can do here too;
PYTHONPATH=$PWD/
${
venvDir
}
/
${
pythonPackages
.
python
.
sitePackages
}
/:$PYTHONPATH
source "
${
venvDir
}
/bin/activate"
''
;
};
...
...
@@ -64,4 +82,4 @@
};
};
};
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment