00:00
pbb has joined #nixos-ruby
00:05
pbb has quit [Excess Flood]
00:08
rickhull has joined #nixos-ruby
00:09
<
rickhull >
error: value is a function while a set was expected, at /home/rwh/git/ballistics/shell.nix:9:4
00:18
pbb has joined #nixos-ruby
01:46
<
rickhull >
somewhat related, and more generally: I am trying to use nixos as a development platform. I have some gems I'd like to update, e.g. `git clone $GITHUB_URL`
01:47
<
rickhull >
I am pretty new to nixos and mostly used to Debian
01:48
<
rickhull >
on Debian, I make sure the ruby package is installed, and that gives me rake and some other things, or I can use a newer rake gem
01:49
<
rickhull >
right off the bat, I'd like to be able to run the tests, e.g. `rake test` for the newly cloned gem
01:50
<
rickhull >
but I need to have an environment that will have all dependencies satisfied. on Debian systems, this is basically running some `apt install` and `gem install` commands
01:51
<
rickhull >
then I can generally just `ruby -Ilib test/*.rb`
01:51
<
rickhull >
or `rake test`
01:52
<
rickhull >
now, I am trying to do that dev environment stuff with `nix-shell`
01:54
<
rickhull >
this includes a C extension
01:54
<
rickhull >
the gemspec lists a development_dependency on rake-compiler
01:54
<
rickhull >
there is no Gemfile for this or most of my gems
01:54
<
rickhull >
to get to a point where I can `rake test` after `git clone`:
01:55
<
rickhull >
i need to have `rake` -- I am using ruby.withPackages for this in my shell.nix
01:55
<
rickhull >
one question, how do I specify a newer rake? right now it gives me rake-10.5.0
01:57
<
rickhull >
with `rake`, I can run `rake compile` to compile the C extension (note -- I may have previously done `gem install rake-compiler`)
01:58
<
rickhull >
at that point, `rake test` should work
01:59
<
rickhull >
`gem list rake` : `rake (13.0.1, 10.5.0)`
01:59
<
rickhull >
I believe I have installed 13.0.1 via `gem install rake` (but it's not in my PATH)
02:00
<
rickhull >
so I'm really fuzzy on how gems get installed, selected, and into PATH -- using nix-shell vs `gem install`
02:05
<
rickhull >
oh -- I guess I'm leaving out that on Debian I would use chruby -- and I believe that helps with adding user-installed gems to the user's PATH
02:45
pbb has joined #nixos-ruby
03:30
<
manveru >
rickhull: i'll be able to help in a bit, barley up yet :)
03:47
pbb has quit [Remote host closed the connection]
03:48
pbb has joined #nixos-ruby
03:52
pbb has joined #nixos-ruby
03:59
<
manveru >
rickhull: so... for this specific example you'll need a Gemfile
04:02
<
manveru >
and you were missing the `minitest` dependency
04:15
<
manveru >
also thanks, there was a mistake in my blog post...
05:00
<
rickhull >
manveru: what's the fix? xD
05:03
<
manveru >
and some more :)
05:05
<
manveru >
i'll squash it in a bit
05:10
<
manveru >
guess it would be nice to have some example project that shows how i usually set up all this stuff
05:15
<
rickhull >
yes, and I have some ideas / complaints about making some docs more noob friendly
05:19
<
manveru >
alright, that should be the final one for now
05:19
<
manveru >
there's a lot of boilerplate unfortunately
05:19
<
rickhull >
yes, but I suppose that's the tradeoff for specifying $EVERYTHING
05:20
<
manveru >
pretty much
05:20
<
manveru >
so the Gemfile is mostly so `bundix` can generate a `gemset.nix`, which has hashes for each gem
05:21
<
manveru >
since bundler won't add hashes to its lockfiles for some reason
05:21
<
rickhull >
I am still taking this in, and it's late for me and I've had a few.... but I have some general questions
05:21
<
manveru >
the `niv` stuff is for hashing other dependencies (in this case nixpkgs)
05:23
<
rickhull >
you helped me add rake to my nix-shell, but it is 10.5.0
05:23
<
rickhull >
what controls that?
05:23
<
rickhull >
with import <nixpkgs> {};ruby.withPackages (p: [ p.rake ])
05:23
<
manveru >
the rake in this nix-shell is `13.0.1`
05:24
<
manveru >
the one in nixpkgs is older, since it has to be compatible with a few hundred other gems
05:24
<
rickhull >
ah, ok, so that's my stable nixpkgs channel?
05:25
<
manveru >
that's what `<nixpkgs>` is, it gets the `nixpkgs` value from your `NIX_PATH` environment variable or channel
05:25
<
manveru >
so just specifying that, will not be very pure or reproducible
05:25
<
manveru >
since when you update your channels, your project will change behaviour
05:25
<
manveru >
that's what the `niv` part is for
05:25
<
manveru >
with the stuff in the `nix` folder in my commit
05:26
<
rickhull >
what is niv, in a nutshell?
05:28
<
manveru >
`niv` generates a `sources.json` file with urls and hashes for downloading arbitrary dependencies and a nice way to manage them
05:28
<
manveru >
it also makes a `sources.nix` file that lets you import those dependencies into nix code easily
05:29
<
manveru >
yeah, the main docs should be better :)
05:29
<
rickhull >
what is the error with function vs. set in the shell.nix example from your blogpost? I am just trying to understand
05:30
<
manveru >
i forgot to call it
05:30
<
rickhull >
the error message makes it tough to diagnose
05:30
<
manveru >
the `import (...)` should be `import (...) {}`
05:33
<
rickhull >
I have to say, it's difficult to read Nix outside of the main examples. in terms of predicting or anticipating behavior
05:33
<
rickhull >
i can grasp at some really nice properties that make for a really nice system
05:34
<
rickhull >
but the dusty crevices are indeed dusty xD
05:35
<
manveru >
yeah... there's still some way to go to make it sexy and shiny
05:35
<
manveru >
but the error reporting is probably my biggest complaint as well
06:04
<
rickhull >
I added empty braces to the import
06:04
<
rickhull >
error: getting status of '/home/rwh/git/ballistics/gemset.nix': No such file or directory
06:05
<
rickhull >
now, I can see `gemset.nix` in your commit
06:05
<
manveru >
that's generated using `bundix -l`
06:06
<
rickhull >
let's take a step back for a sec. why isn't the .gemspec enough?
06:06
<
rickhull >
is it because parsing .gemspec is harder than parsing Gemfile ?
06:07
<
rickhull >
should I have to declare dependencies twice?
14:54
zarel has joined #nixos-ruby
14:57
zarel_ has joined #nixos-ruby
14:58
zarel has quit [Ping timeout: 246 seconds]
15:06
zarel_ has quit [Ping timeout: 258 seconds]
15:07
zarel has joined #nixos-ruby
17:10
rickhull has quit [Remote host closed the connection]
20:10
rickhull has joined #nixos-ruby
20:17
rickhull has quit [Remote host closed the connection]
22:50
pbb has quit [Remote host closed the connection]
22:51
pbb has joined #nixos-ruby