Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modernize nix a little #173

Merged
merged 4 commits into from
May 18, 2021
Merged

Conversation

michaelglass
Copy link
Contributor

@michaelglass michaelglass commented Apr 15, 2021

the problems

  1. updating (or changing) the shell's veresion of librdkafka from nix is an arduous process
  2. nix-shell is slow to launch

the solutions

1. niv handles nix versioning.

before

  1. visit https://github.com/nixos/nixpkgs
  2. find the right branch
  3. find the right rev
  4. download the rev and get the SHA of the download
  5. update both in the right nix file.

after

$ niv update

2. [opt-in] if you have direnv installed and setup, direnv allow will cache nix-shell launch

this PR adds a .envrc, which in combination with direnv makes nix usage snappy

it also updates change the existing nixpkgs version to resolve security warnings with modern nixpkgs.

@AlexeyRaga
Copy link
Member

Thanks, I'll have a look soon.
The diff looks scary though ;) We only need to provide a version of librdkafka in shell, and having that much nix code for it... Not sure how I feel about it, but I'll have a look :)

@michaelglass
Copy link
Contributor Author

one of the files is the generated json parser from niv

@michaelglass
Copy link
Contributor Author

@AlexeyRaga

  • updated the PR description to explain the intent
  • split up the commits so it's clear what part of this code was auto-generated by niv

Copy link

@endgame endgame left a comment

Choose a reason for hiding this comment

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

@AlexeyRaga All this is doing is pinning nixpkgs instead of getting whatever version is in the user's channels. Until flakes take over (eventually, I hope, because they seem good in theory), niv seems to be the predominant way of pinning remote nix deps.

@AlexeyRaga
Copy link
Member

@michaelglass There was a bit of a mess with branches (GH force-switched the default branch from master to main and I haven't noticed). I have update main, could you please update your PR too?

@michaelglass
Copy link
Contributor Author

thanks @AlexeyRaga. rebased on main

@AlexeyRaga AlexeyRaga merged commit 1bfc027 into haskell-works:main May 18, 2021
@michaelglass michaelglass deleted the direnv-nix-hooks branch July 19, 2021 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants