Using snap-loader-dynamic with NixOS

30 views
Skip to first unread message

Matthew Pickering

unread,
Dec 12, 2014, 6:26:49 AM12/12/14
to snap_fr...@googlegroups.com
Hi,

Is is possible to use snap-loader-dynamic with NixOS? I've tried several things:

1. Building as normal "nix-build build.nix" and then /result/bin/App
2. Building inside the shell "nix-shell" "cabal configure
-fdevelopment" "cabal build" and then "dist/build/App/App"
3. As 2. but copying the executable to the main dir (where dist is).

1 and 2 complain as follows

can't find a package database at dist/package.conf.inplace

3. complains about not being able to find module Main.

Any ideas how to get this work?


Matt

MightyByte

unread,
Dec 12, 2014, 10:06:57 AM12/12/14
to snap_fr...@googlegroups.com
This sounds more like a nix question to me. I've never used nix, so I
can't help much.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Snap Framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to snap_framewor...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

shahn

unread,
Dec 12, 2014, 11:17:32 AM12/12/14
to snap_fr...@googlegroups.com
This is not really an answer to your question, but: I tried that once too, but gave up. Instead I used the static loader with reserve ([1]), that worked for me.

Cheers,
Sönke

[1] https://github.com/sol/reserve

Eric Rasmussen

unread,
Dec 12, 2014, 4:21:46 PM12/12/14
to snap_fr...@googlegroups.com
Hi,

I think what you want to add to your package's cabal.mkDerivation is:

cabal.mkDerivation (self: {
  # your existing package definition...
  extraConfigureFlags = [ "-fdevelopment" ];
})

This will ensure cabal configure is called with -fdevelopment and all of the other arguments needed for the nix build (like the locations of ghc, cabal, ghc package dir, etc).

However, I couldn't fully test it because it looks like the snapLoaderDynamic package in nixpkgs was marked as broken:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/haskell/snap/loader-dynamic.nix#L16

If you already have it installed you should be ok with just adding the flag I mentioned, but otherwise someone needs to look into fixing the package.

Hope that helps,
Eric








--

Matthew Pickering

unread,
Dec 13, 2014, 8:53:24 PM12/13/14
to snap_fr...@googlegroups.com
Thanks for your help.

Indeed the snap-loader-dynamic package is broken. I think this is because at some point the bound for directory-tree got bumped on hackage and the package didn't get updated in the nix repo. It should be quite easy to fix.

@Eric - this is what I have previously tried without luck! Thanks for your detailed response anyway.

@Sönke - Thanks, I will have a closer look at reserve tomorrow.
Reply all
Reply to author
Forward
0 new messages