hmemcpy / milewski-ctfp-pdf

Bartosz Milewski's 'Category Theory for Programmers' unofficial PDF and LaTeX source
https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
Other
10.84k stars 575 forks source link

Nix tweaks #252

Closed jkachmar closed 3 years ago

jkachmar commented 3 years ago

A fair bit of this PR is stylistic, so feel free to reject or request significant changes if you feel I've overstepped any bounds on the project!


I wanted to build this locally, but I ran into some problems. I got a little carried away and ended up refactoring shell.nix a bit as well as pinning everything to a specific commit of nixpkgs in the process 😅.

On the LaTeX side, it looks like the project needed zref, catchfile, and import from CTAN; dropping those into the texlive bundle seemed to resolve my issues there.

Since I was doing all of that anyway, I decided to go ahead and manage the two Python dependencies with Nix as well. This feels a bit nicer than managing them with virtualenv, and it would probably make it a bit easier to build this project with Nix if someone wanted to in the future.

hmemcpy commented 3 years ago

Joe, these are great! As you can probably tell, I learned nix from I-have-no-idea-what-I'm-doing.pdf, so any and all improvements are welcome!

I got a new machine and don't even have nix on it at the moment, will be a good opportunity to try this out!

drupol commented 3 years ago

We should have a docker compose file inside the project to be able to test these things.

jkachmar commented 3 years ago

@hmemcpy glad I could help! I was going to take a look at CI a bit as well, but it looks like you’re only using Nix on Travis (not on GitHub actions).

@drupol I’m not sure I follow; do you mean a Dockerfile that would drop somebody into an environment with Nix so they could develop in that container without having to install Nix on their own machine?

drupol commented 3 years ago

@drupol I’m not sure I follow; do you mean a Dockerfile that would drop somebody into an environment with Nix so they could develop in that container without having to install Nix on their own machine?

Yes exactly :-)

jkachmar commented 3 years ago

Hmm, I’m looking at the PDF Travis uploaded to S3 and it seems like the images didn’t get included somehow.

When I ran this locally I’m pretty sure the images were included without issue so I’m gonna have to go back and check that my changes didn’t mess anything up 😔


@drupol Makes sense! I think there might even be an open PR with some work towards this right now, but I’m not sure if it needs to be spruced up a little before it could be merged.

drupol commented 3 years ago

Hmm, I’m looking at the PDF Travis uploaded to S3 and it seems like the images didn’t get included somehow.

Have you checked the PDFs generated by Github ? https://github.com/hmemcpy/milewski-ctfp-pdf/releases/tag/f76e9d3

hmemcpy commented 3 years ago

I will admit it's been a while since I looked, unfortunately :(

Life got in the way...

But I think I remember people complaining about the lack of images from Travis CI. I can report the GitHub-generated PDFs are fine (thanks again @drupol!)

I think the Travis build should be retired.

jkachmar commented 3 years ago

Makes sense.

If the Travis build is to be retired, I could have a go at adding a GitHub Action which just runs through a basic test of the Nix-based build to ensure that everything works as expected in the development environment.