Re: [Nix-dev] Developing with older packages
On 09/08/2014 04:56 PM, Richard Wallace wrote: Hello, I'm using nix-shell to setup a Haskell environment for development. On a project I ran into a problem recently, and I'm curious if there is a common/preferred way of solving it. The problem I ran into is that the project depends on the mongoDB 1.5 package. The API changed drastically in 2.0 and we're not ready to undertake the upgrade yet. I think I can handle this by creating a nixpkgs directory in the project, putting a mongoDB/default.nix file in there that is setup for the version we need, then override it in our shell.nix file like this: let pkgs = import nixpkgs {}; haskellPackages = pkgs.haskellPackages.override { extension = self: super: { mongoDB = self.callPackage nixpkgs/mongoDB {}; ourkidsclass = self.callPackage ./. {}; }; }; Is this a reasonable approach? Is there a better way? Thanks, Rich ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev This looks as good of a solution as any other one could come up with. Is there something you're dissatisfied with that you would like to have in a ‘better’ solution? -- Mateusz K. ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Developing with older packages
Hi. On 09/08/2014 05:56 PM, Richard Wallace wrote: The API changed drastically in 2.0 and we're not ready to undertake the upgrade yet. That sounds like it makes sense to keep mongoDB_1_5 in nixpkgs, at least for some time. More people may experience the same issue. (It seems simplified by the fact that I see no package that depends on mongoDB.) Vladimir smime.p7s Description: S/MIME Cryptographic Signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Developing with older packages
On Mon, Sep 8, 2014 at 9:03 AM, Mateusz Kowalczyk fuuze...@fuuzetsu.co.uk wrote: On 09/08/2014 04:56 PM, Richard Wallace wrote: Hello, I'm using nix-shell to setup a Haskell environment for development. On a project I ran into a problem recently, and I'm curious if there is a common/preferred way of solving it. The problem I ran into is that the project depends on the mongoDB 1.5 package. The API changed drastically in 2.0 and we're not ready to undertake the upgrade yet. I think I can handle this by creating a nixpkgs directory in the project, putting a mongoDB/default.nix file in there that is setup for the version we need, then override it in our shell.nix file like this: let pkgs = import nixpkgs {}; haskellPackages = pkgs.haskellPackages.override { extension = self: super: { mongoDB = self.callPackage nixpkgs/mongoDB {}; ourkidsclass = self.callPackage ./. {}; }; }; Is this a reasonable approach? Is there a better way? Thanks, Rich ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev This looks as good of a solution as any other one could come up with. Is there something you're dissatisfied with that you would like to have in a ‘better’ solution? Well, the mongoDB package isn't the only one that I want to get a specific version of. We originally built it with a sandbox and used `cabal freeze` to make sure everyone is using the same versions. So there are a number of such packages and I was hoping for something a bit more automated. Perhaps I can script something to make it a bit easier to maintain. Rich -- Mateusz K. ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Developing with older packages
On Mon, Sep 8, 2014 at 9:04 AM, Vladimír Čunát vcu...@gmail.com wrote: Hi. On 09/08/2014 05:56 PM, Richard Wallace wrote: The API changed drastically in 2.0 and we're not ready to undertake the upgrade yet. That sounds like it makes sense to keep mongoDB_1_5 in nixpkgs, at least for some time. More people may experience the same issue. (It seems simplified by the fact that I see no package that depends on mongoDB.) One thing that surprised me about nix when I started using it is that there isn't a way to say, I need package X with version Y. Instead, you have to resort to having multiple definitions of the package with different package names for different versions. This seems a bit hacky to me. As mentioned in a separate reply, I expect to have several such packages and being able to specify it that way would make things much easier. ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Developing with older packages
On 09/08/2014 08:12 PM, Richard Wallace wrote: One thing that surprised me about nix when I started using it is that there isn't a way to say, I need package X with version Y. Instead, you have to resort to having multiple definitions of the package with different package names for different versions. This seems a bit hacky to me. When you change version, you have to change the download hash, and often also some other things like dependencies or patches. As many things may be different, having a special attribute name is a flexible convention. In nixpkgs we do not maintain old versions unless there is a good reason to do so. For those cases, the language offers many ways of sharing code among multiple versions, although some of those techniques were disputed a lot and disapproved. Vladimir smime.p7s Description: S/MIME Cryptographic Signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Developing with older packages
On 09/08/2014 08:08 PM, Richard Wallace wrote: Well, the mongoDB package isn't the only one that I want to get a specific version of. We originally built it with a sandbox and used `cabal freeze` to make sure everyone is using the same versions. So there are a number of such packages and I was hoping for something a bit more automated. Perhaps I can script something to make it a bit easier to maintain. (CC @peti, as the thread concerns versioning of haskell packages in nixpkgs.) You can use cabal2nix to generate the .nix file for a specific package version. Vladimir smime.p7s Description: S/MIME Cryptographic Signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Developing with older packages
What about just copying the old .nix from old nixpkgs commits? On Mon, Sep 8, 2014 at 8:08 PM, Richard Wallace rwall...@thewallacepack.net wrote: On Mon, Sep 8, 2014 at 9:03 AM, Mateusz Kowalczyk fuuze...@fuuzetsu.co.uk wrote: On 09/08/2014 04:56 PM, Richard Wallace wrote: Hello, I'm using nix-shell to setup a Haskell environment for development. On a project I ran into a problem recently, and I'm curious if there is a common/preferred way of solving it. The problem I ran into is that the project depends on the mongoDB 1.5 package. The API changed drastically in 2.0 and we're not ready to undertake the upgrade yet. I think I can handle this by creating a nixpkgs directory in the project, putting a mongoDB/default.nix file in there that is setup for the version we need, then override it in our shell.nix file like this: let pkgs = import nixpkgs {}; haskellPackages = pkgs.haskellPackages.override { extension = self: super: { mongoDB = self.callPackage nixpkgs/mongoDB {}; ourkidsclass = self.callPackage ./. {}; }; }; Is this a reasonable approach? Is there a better way? Thanks, Rich ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev This looks as good of a solution as any other one could come up with. Is there something you're dissatisfied with that you would like to have in a ‘better’ solution? Well, the mongoDB package isn't the only one that I want to get a specific version of. We originally built it with a sandbox and used `cabal freeze` to make sure everyone is using the same versions. So there are a number of such packages and I was hoping for something a bit more automated. Perhaps I can script something to make it a bit easier to maintain. Rich -- Mateusz K. ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev -- www.debian.org - The Universal Operating System ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Developing with older packages
On 09/08/2014 10:27 PM, Luca Bruno wrote: www.debian.org http://www.debian.org - The Universal Operating System You should update your footer ;-) smime.p7s Description: S/MIME Cryptographic Signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Developing with older packages
Haven't found a cool slogan for nixos yet :P On Mon, Sep 8, 2014 at 11:23 PM, Vladimír Čunát vcu...@gmail.com wrote: On 09/08/2014 10:27 PM, Luca Bruno wrote: www.debian.org http://www.debian.org - The Universal Operating System You should update your footer ;-) ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev -- www.debian.org - The Universal Operating System ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev