[Nix-dev] Using hoogle in a haskell development environment on nix

2014-12-29 Thread cdep.illab...@gmail.com
I'm trying to use hoogle in a Haskell development environment exactly
like the one described by O'Charles' wiki:
http://wiki.ocharles.org.uk/Nix

I have modified shell.nix like below in order to use hoogleLocal, but
it doesn't seem to install the hoogle binary for me.

let
  pkgs = import  {};

  # I'm attempting to use hoogle here, but it is not working.
  haskellPackages =
let callPackage = pkgs.lib.callPackageWith haskellPackages;
in pkgs.recurseIntoAttrs (pkgs.haskellPackages.override {
  extension = self: super: {
thiscurrentpackage = self.callPackage ./. {};
hoogleLocal = pkgs.haskellPackages.hoogleLocal.override {
  packages = self.thiscurrentpackage;
};
  };
});
in pkgs.myEnvFun {
  name = haskellPackages.thiscurrentpackage.name;
  buildInputs = [
(haskellPackages.ghcWithPackages (hs: ([
  hs.cabalInstall
  hs.ghcMod
  hs.yesodBin
  # This doesn't appear to install the hoogle binary?
  hs.hoogleLocal
] ++ hs.thiscurrentpackage.propagatedNativeBuildInputs)))
  ];
}


In the resulting shell, the hoogle binary is not available.

If I include "hs.hoogle" to the buildInputs, the hoogle binary is
installed but it can't find the databases.  Below is what happens when
I try to use it.

$ nix-shell
..
$ hoogle Monad
Could not find some databases: default
Searching in:
  .

/nix/store/91y9q2y5a2ws8xgcsx1gkhfagc0f2qz6-haskell-hoogle-ghc7.8.3-4.2.36-shared/share/x86_64-linux-ghc-7.8.3/hoogle-4.2.36/databases

There are no available databases, generate them with: hoogle data
$ hoogle data
hoogle: 
/nix/store/91y9q2y5a2ws8xgcsx1gkhfagc0f2qz6-haskell-hoogle-ghc7.8.3-4.2.36-shared/share/x86_64-linux-ghc-7.8.3/hoogle-4.2.36/databases:
changeWorkingDirectory: does not exist (No such file or directory)
$

Anyone know how to get this working correctly for a setup like the
described by O'Charles?


P.S.  This is a marginally related question, but is there some way to
list what packages are available in an environment after running
`nix-shell`?

For instance, I would like to be able to run `nix-shell`, then once
inside the nix-shell I could run something like `nix-env -q` and have
it print out haskellPackages.ghcMod, haskellPackages.cabalInstall,
haskellPackages.yesodBin, haskellPackages.thiscurrentpackage, etc.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] nixops elastic ip

2014-12-29 Thread stewart mackenzie
Hello,

Ie is there a way to make Nixops control Amazon's Elastic IP to
automatically allocate and assign an IP address?

Kind regards
Stewart
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] How to get rid of systemd (was: Modifying the init system (introducing S6 supervision suite))

2014-12-29 Thread Colin Putney
On Sun, Dec 28, 2014 at 11:11 PM, Ertugrul Söylemez  wrote:

> Hi Colin,
>
> > This sounds a lot like Disnix! How would it be similar? How would it
> > be different?
>
> Disnix and NixOps are machine-oriented.  You have a network of machines
> with configurations.  The goal is a service-oriented architecture.
> Every service itself is a "machine", and those machines can be combined
> to larger machines.
>

Yeah, that's certainly true of Nixops. My understanding of Disnix, though,
is that it let's you describe, separately, services in the abstract,
machines available for running them, and the deployment of abstract
services onto the physical machines.

Disnix seems to be dead, though, so even if what you're proposing is very
similar, it would be a big improvement on the current state of the art.

-Colin
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Service composition

2014-12-29 Thread Ludovic Courtès
Ertugrul Söylemez  skribis:

>> FWIW, Guix uses an approach along these lines: the ‘bitlbee-service’
>> function, for instance, returns a ‘service’ object as a monadic value
>> (see
>> 
>> for details.)
>
> The way I understand the section on the store monad is that it's really
> a state monad with a view on the current store (they should really show
> the underlying types to make this easier to understand).

Yes.

>> What’s unsatisfying (and thus subject to change) is that
>> ‘operating-system’ objects (which are pure declarations) end up with
>> monadic values in their ‘services’ field.  That makes it inconvenient
>> to, say, filter items from that list, or to tweak their configuration,
>> because one first needs to bind them.  That said, it’s probably not a
>> problem for Nix, because every Nix function is really a function in
>> what we call the “store monad”.
>
> You could think of it that way, if you wanted.  I prefer to think of
> what Nix does as the same magic that functional languages do with other
> resources like memory (alloc and GC).

Sure.  You realize there’s no magic when you actually implement the
store in a general-purpose language.  ;-)

> As a first approximation there would be a Service monoid, which would
> combine certain typical attributes about a service, including startup
> scripts, required bind-mounts, required system resources and if really
> necessary shutdown scripts (most programs should shutdown properly when
> the container goes down).
>
> Service : Mon
>
> Its identity idS would be the empty service, which you can think of as
> an empty group of processes with no mounts, no resources, etc.
>
> The Bitlbee service would be constructed through a regular function that
> takes the typical bitlbee options.  Nothing special here:
>
> bitlbee : BitlbeeConf -> Service

OK.  I suppose ‘Service’ would specify required user accounts, PAM
services, etc., right?

> The nginx function is more interesting.  It involves a second monoid,
> the monoid of web services (identity idW):
>
> WebService : Mon
>
> Then nginx is a monoid morphism,
>
> nginx : WebService -> Service
>
> that is a function with additional structure, in particular:
>
> nginx x ◇ nginx y ≡ nginx (x ◇ y)
> nginx idW ≡ idS

Very interesting.  I wonder what other types of services would benefit
from similar treatment.

[...]

> I hope this gives a first impression of how everything would fit
> together.

Definitely.  That gives me a fair amount of food for thought.

Thank you!

Ludo’.

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Haskell NG

2014-12-29 Thread roconnor
On Sun, 28 Dec 2014, Charles Strahan wrote:

> 
> > I'm trying to think of a way of selling my oop library [...]
> 
> What OOP library are you talking about? Is it available for me to view online?

Sure, you can look at lib/oop.nix from

https://github.com/NixOS/nixpkgs/commit/6daa5a15a71021e6c1e77fec098eba818755e5aa

See also 

Package collections is the first time I have really felt that OOP was the 
best solution to the problem at hand, though I kind of think the 
collection of versioned packages should be separate from the recursive 
knot of curated packages for installation.

-- 
Russell O'Connor  
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev