{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/9682","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/9682/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/9682/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/9682/events","html_url":"https://github.com/NixOS/nixpkgs/issues/9682","id":105103999,"number":9682,"title":"No way to install/use a specific package version?","user":{"login":"mayhewluke","id":5531936,"avatar_url":"https://avatars3.githubusercontent.com/u/5531936?v=4","gravatar_id":"","url":"https://api.github.com/users/mayhewluke","html_url":"https://github.com/mayhewluke","followers_url":"https://api.github.com/users/mayhewluke/followers","following_url":"https://api.github.com/users/mayhewluke/following{/other_user}","gists_url":"https://api.github.com/users/mayhewluke/gists{/gist_id}","starred_url":"https://api.github.com/users/mayhewluke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mayhewluke/subscriptions","organizations_url":"https://api.github.com/users/mayhewluke/orgs","repos_url":"https://api.github.com/users/mayhewluke/repos","events_url":"https://api.github.com/users/mayhewluke/events{/privacy}","received_events_url":"https://api.github.com/users/mayhewluke/received_events","type":"User","site_admin":false},"labels":[{"id":6314754,"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/0.kind:%20question","name":"0.kind: question","color":"84b6eb","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2015-09-06T16:55:29Z","updated_at":"2017-09-26T05:24:53Z","closed_at":"2015-09-13T14:37:14Z","author_association":"NONE","body":"> It provides . . . side-by-side installation of multiple versions of a package . . .\n> _(From the [Nix page](https://nixos.org/nix/))_\n\nI can't seem to find any way to install a specific package version, though - it seems like when installing a package you just get whatever is current in the channel you've subscribed to. If there's no way to request a specific package version, how is it possible to have \"side-by-side installation of multiple versions\"?\n\n_(Note: I understand that some packages occasionally have more than one version available in the current state of the channel and can be accessed via eg. `package-name_1.2.3`, but this seems to be the rare exception and still doesn't allow specifying a specific version, just a choice from a few available versions.)_\n\n---\n#### Potential use cases:\n\n**Solving dependency/Cabal hell:**\nI found Nix through Haskell, where a lot of people offer it as a solution to \"Cabal hell\". However, if I can only install one version of a package via Nix, I can't solve the situation where I am working on two different projects with two different and incompatible dependency requirements.\n\n**Testing against multiple versions of dependencies:**\nSay I'm writing a library, for which I originally depended on `foo-1.0.0`. A year later I'm making updates and I want to use expand the upper bound of that dependency so that users aren't restricted to an old version of the dependency. I install `foo-1.5.0`, make a bunch of updates, verify that it works, but then want to double-check that everything still works with `foo-1.0.0`, because if the new changes don't work with it I'll have to change the lower bound of the dependency, potentially causing problems for users. However, not being able to specify to Nix that I want `foo-1.0.0`, I can't test against `foo-1.0.0` and can only state the dependency as `foo == 1.5.0`, instead of the more permissible (and usable) `foo >= 1.0.0 && foo <= 1.5.0`.\n\n**Sharing build/development environments:**\n\n> Nix makes it trivial to set up and share build environments for your projects\n> _(From the [Nix page](https://nixos.org/nix/))_\n\nI've seen people say that the ability to share build/development environments across the team solves the \"Well it works on my machine\" problem. However, if I send the environment (via default.nix/shell.nix etc.) to another developer to get them up to speed with the project, they may end up installing different versions of packages than me, since the packages channel may have progressed since I last installed/updated my packages. Now we're not on the same page any more and those subtle (and painful) differences and bugs can creep back in.\n\n**Deploying to servers/CI/etc:**\nIn a similar vein to sharing development environments, it would be great to be able to use Nix to standardize the environment across all our develop/build/test/deploy phases/environments. However, since the channel could change at any point between these phases and we're not able to specify specific package versions, this isn't possible. For example, take the case where the project is deployed across multiple servers. Being in the cloud, they're ephemeral, so when one breaks for some reason it's destroyed and replaced with a new, healthy version. Except that the new version has to be brought up so speed and installs the project via Nix. Since the channel has been updated since the other servers were last updated, the new server is now running in a different environment and introduces potentially problematic inconsistencies to the system.\n\n---\n\nNow, these are all hypothetical - I don't actually have experience in any of these use cases but if my understanding is correct I can see them potentially cropping up. However, I can find no mention anywhere (despite very exhaustive searching) of anyone concerned about locking down package versions or installing specific versions when using Nix. If I'm the only one, perhaps I'm missing something fundamental here and barking up the wrong tree?\n\n**I just can't see how Nix can deliver the benefits everyone says it does without giving users a way to specify specific package versions - is there really no way to do this, or am I misunderstanding the whole system?**\n"},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/332089808","html_url":"https://github.com/NixOS/nixpkgs/issues/9682#issuecomment-332089808","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/9682","id":332089808,"user":{"login":"CMCDragonkai","id":640797,"avatar_url":"https://avatars2.githubusercontent.com/u/640797?v=4","gravatar_id":"","url":"https://api.github.com/users/CMCDragonkai","html_url":"https://github.com/CMCDragonkai","followers_url":"https://api.github.com/users/CMCDragonkai/followers","following_url":"https://api.github.com/users/CMCDragonkai/following{/other_user}","gists_url":"https://api.github.com/users/CMCDragonkai/gists{/gist_id}","starred_url":"https://api.github.com/users/CMCDragonkai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CMCDragonkai/subscriptions","organizations_url":"https://api.github.com/users/CMCDragonkai/orgs","repos_url":"https://api.github.com/users/CMCDragonkai/repos","events_url":"https://api.github.com/users/CMCDragonkai/events{/privacy}","received_events_url":"https://api.github.com/users/CMCDragonkai/received_events","type":"User","site_admin":false},"created_at":"2017-09-26T05:24:53Z","updated_at":"2017-09-26T05:24:53Z","author_association":"CONTRIBUTOR","body":"@thomastjeffery there are projects that try to automate the conversion of other package manager indexes to Nix expressions. It still requires someone to commit in the new expressions in nixpkgs. Although the I think the haskage integration is fully automated (not sure). But the basic idea is that version numbers don't make sense in Nix because it's meant to be content addressed. There needs to be a translation from the version specification to a content addressed expression in nixpkgs to get what you want. For now most of this is done manually. Also every previous iteration of a channel is still accessible."}}
{"actor":{"display_login":"CMCDragonkai"}}