Skip to content

Instantly share code, notes, and snippets.

@costrouc
Created July 17, 2019 18:17
Show Gist options
  • Save costrouc/31905f5a03cc3e9b35b0b2ce67a9ee14 to your computer and use it in GitHub Desktop.
Save costrouc/31905f5a03cc3e9b35b0b2ce67a9ee14 to your computer and use it in GitHub Desktop.
{ pkgs ? import <nixpkgs> { }, pythonPackages ? pkgs.python3Packages }:
let pythonEnv = pythonPackages.python.withPackages
(ps: with ps; [ numpy jupyterlab ]);
in {
shell = pkgs.mkShell {
buildInputs = [ pythonEnv ];
};
# https://grahamc.com/blog/nix-and-layered-docker-images
# docker
# - docker load < ./result
# - docker run -it
docker = pkgs.dockerTools.buildLayeredImage {
name = "numpy-example";
tag = "latest";
config.Cmd = [ "${pythonEnv.interpreter}" ];
maxLayers = 120;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment