Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Add Nix environment definition #94

Merged
merged 3 commits into from
Feb 18, 2019
Merged

Add Nix environment definition #94

merged 3 commits into from
Feb 18, 2019

Conversation

kierdavis
Copy link
Contributor

This enables Nix users to simply run nix-shell in the repository root to obtain a shell with python and pipenv (and anything else we may want to add in the future) available.

@mildlyincompetent
Copy link
Contributor

I recall commenting on a similar PR that this is nasty and should not go in the repo, however as I am now a NixOS user, I think this is a great idea and should go in all repos.

Copy link
Contributor

@trickeydan trickeydan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works and will be useful for when I switch to NixOS.

@trickeydan
Copy link
Contributor

I recall commenting on a similar PR that this is nasty and should not go in the repo, however as I am now a NixOS user, I think this is a great idea and should go in all repos.

Well I'm strongly considering building the new Pi OS on nix, so this is very useful.

@mildlyincompetent
Copy link
Contributor

Huh, on my system the python3 requirement was satisfied using python 3.6, which doesn't work as we require 3.7. Is it possible to specify this more precisely?

@kierdavis
Copy link
Contributor Author

@mildlyincompetent it is possible (python3 -> python37).

I thought we were still compatible with 3.6? We really need to make a decision on #79.

@mildlyincompetent
Copy link
Contributor

The pip / pipenv config isn't, so the repo isn't 3.6 compatible currently, though this may be subject to change once we work out what exactly we're supporting.

@kierdavis
Copy link
Contributor Author

Regardless, all evidence suggests that 3.7 is the preferred version for development, so I'll specify this in the shell.nix.

@kierdavis
Copy link
Contributor Author

Ugh. As a result of Nix's default python3 version being 3.6 (on the 18.09 release, haven't checked unstable), one must go out of their way to override python3Packages = python37Packages. Hydra doesn't appear to build python packages against any python version other than the default, so using a non-default python version here forces pipenv and its dependencies to be built locally. Luckily this is all automated but its a bit annoying for nix-shell to now take 10 minutes to set the environment up.

@mildlyincompetent
Copy link
Contributor

Hey at least we're not attempting to emerge, could be a worse distro. Does this process only take forever once (since I assume its results live in the nix store), or does it take ages every time? If its the former I would say it is grudgingly acceptable.

Unstable uses 3.7 I believe judging by the random docker container Dan just downloaded, and appears to have binaries for 3.7.

@kierdavis
Copy link
Contributor Author

Yes, results will persist in the store, so it'll only take forever once (unless you garbage collect the store automatically, in which case it'll take forever once per week).

@kierdavis
Copy link
Contributor Author

kierdavis commented Feb 15, 2019

Thinking about it the point about nix-shell taking a long time is moot. pipenv is broken on the current stable channel, so one must use unstable in the meantime. The next release will almost certainly make python 3.7 the default.

@trickeydan please can you check my recent commits haven't broken this for you?

Copy link
Contributor

@trickeydan trickeydan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, still works for me.

@kierdavis kierdavis merged commit 72c798b into master Feb 18, 2019
@kierdavis kierdavis deleted the add-shell-nix branch February 18, 2019 09:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants