Sender | Message | Time |
---|---|---|
11 Jul 2023 | ||
what would you say is the biggest benefit of using flakes over not using them? | 06:44:02 | |
OK, it sounds a bit like templates (for setting up a dev env)? | 07:01:43 | |
I think there is emphatically no consensus on flakes | 07:01:50 | |
ok | 07:03:15 | |
I’d like to have something like setup_env("4.2.1", c("dplyr", "tidyr", "janitor"), ide = "rstudio") that would create a default.nix and build the environment. Then, users would be advised to go to the environment and start rstudio from there, so that they could work in that new environment shipping that specific version of R and packages | 07:06:04 | |
ah, I see, you want to configure it from an R session different to the one you want to use for development? | 10:10:10 | |
yes, because I want to build something that R users could use with as little friction as possible | 10:12:48 | |
and R users are really used to do everything from the R session, not so much from a cli tool | 10:13:04 | |
something that would mimic renv in a sense, but with nix instead (and nix would even go further, as it would even provide a separate R installation and potentielly RStudio as well) | 10:13:48 | |
then that default.nix file could be used for reproducibility purposes | 10:14:18 | |
got it | 22:13:55 | |
12 Jul 2023 | ||
08:46:24 | ||
So I've started playing with Nix. I am trying to build an environment with R and some packages installed (inside Docker, just to avoid interfering with my system). Here is the default.nix that I'm using:
| 12:19:26 | |
I can drop into a nix shell using CMD nix-shell /home/renv/default.nix in the Dockerfile and then running a container | 12:20:01 | |
but when I try to build the environment first, and then drop into bash that doesn't work. So when I do
| 12:20:39 | |
* but when I try to build the environment first, and then drop into bash that doesn't work. So when I do
| 12:20:48 | |
* but when I try to build the environment first, and then drop into bash that doesn't work. So when I do
I get following error message
| 12:21:37 | |
surely I'm missing something obvious, but can't find it 😅 | 12:23:01 | |
* but when I try to build the environment first, and then drop into bash that doesn't work. So when I do
I get following error message
| 12:23:29 | |
ok so some more googling led me to write this default.nix:
| 13:04:26 | |
* ok so some more googling led me to write this default.nix:
| 13:04:47 | |
and now it builds successfully | 13:05:00 | |
I guess the issue was that before I wasn't creating an environment, because I wasn't using mkShell explicitely? | 13:05:51 | |
In reply to @brodriguesco:matrix.orgThese general nix questions are better in #nix:nixos.org, but to answer your questions derivations have to produce all outputs, of which out is mandatory. Your expression above did not create the output path expected so your got an error when you tried to build it. mkShell is a wrapper around mkDerivation that simply dumps some text into the output path (see pkgs/build-support/mkShell/default.nix ). | 23:23:44 | |
13 Jul 2023 | ||
Ah great many thanks. I figured it had to do something with the fact that mkShell likely provided the required outputs, which I would have had to provide by hand otherwise | 07:52:14 | |
I've joined the NixOS channel, I'll ask these types of questions in there in the future, thanks! | 07:52:56 | |
17 Jul 2023 | ||
14:29:47 | ||
ok, it's been a while since i looked at this, but i'm having a go at implementing a nix-flakes buildpack for repo2docker which will allow use of a git repo with a flake.nix on https://mybinder.org/ | 14:32:09 | |
story so far is that i got it working 2 years ago using the existing nix buildpack and edolstra's flake-compat, and to prove the long-term reproducibility of nix, it still builds and runs using repo2docker ! https://codeberg.org/jezcope/binder-nix-flakes | 14:34:22 | |
hmm, OK, first roadblock to doing anything with a reasonably recent nixpkgs is this: repo2docker does not work with jupyter-server v2 https://github.com/jupyter-server/jupyter_server/issues/1038 | 16:24:45 |