Skip to content

Instantly share code, notes, and snippets.

@sjahl
Created September 28, 2021 14:36
Show Gist options
  • Save sjahl/e210cd667c822d66c61b3de750a00504 to your computer and use it in GitHub Desktop.
Save sjahl/e210cd667c822d66c61b3de750a00504 to your computer and use it in GitHub Desktop.
reproducible python environment with nix
{ pkgs ? import <nixpkgs> {} }:
let
mach-nix = import (builtins.fetchGit {
url = "https://github.com/DavHau/mach-nix";
ref = "refs/tags/3.3.0";
}) {
pkgs = pkgs;
python = "python37";
pypiDataRev = "48f4b1841d11673822d3f42178480378d1a07a90"; # 2021-09-27T20:16:37Z
pypiDataSha256 = "0iallhbxsa3gmgby3rrfhz1a3yq9pdyakrk0p6036spyhig8p4bh";
};
customPython = mach-nix.mkPython {
requirements = builtins.readFile ./requirements.txt;
};
in
pkgs.mkShell {
buildInputs = [ customPython ];
shellHook = ''
alias vim='nvim'
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment