{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/17357","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/17357/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/17357/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/17357/events","html_url":"https://github.com/NixOS/nixpkgs/pull/17357","id":168275666,"number":17357,"title":"lib: add fileContents function","user":{"login":"ericsagnes","id":367880,"avatar_url":"https://avatars.githubusercontent.com/u/367880?v=3","gravatar_id":"","url":"https://api.github.com/users/ericsagnes","html_url":"https://github.com/ericsagnes","followers_url":"https://api.github.com/users/ericsagnes/followers","following_url":"https://api.github.com/users/ericsagnes/following{/other_user}","gists_url":"https://api.github.com/users/ericsagnes/gists{/gist_id}","starred_url":"https://api.github.com/users/ericsagnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericsagnes/subscriptions","organizations_url":"https://api.github.com/users/ericsagnes/orgs","repos_url":"https://api.github.com/users/ericsagnes/repos","events_url":"https://api.github.com/users/ericsagnes/events{/privacy}","received_events_url":"https://api.github.com/users/ericsagnes/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/8.has:%20documentation","name":"8.has: documentation","color":"009800"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-29T08:30:30Z","updated_at":"2016-07-30T12:51:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/17357","html_url":"https://github.com/NixOS/nixpkgs/pull/17357","diff_url":"https://github.com/NixOS/nixpkgs/pull/17357.diff","patch_url":"https://github.com/NixOS/nixpkgs/pull/17357.patch"},"body":"###### Motivation for this change\r\n\r\nThe pattern `removeSuffix \"\\n\" (builtins.readFile file)` is very common to read version numbers or passwords from a single line file.\r\n\r\nHaving the functionality in lib would save some typing and [search](https://www.mail-archive.com/nix-dev@lists.science.uu.nl/msg20298.html).\r\n\r\n###### Things done\r\n\r\n- [ ] Tested using sandboxing\r\n  ([nix.useChroot](http://nixos.org/nixos/manual/options.html#opt-nix.useChroot) on NixOS,\r\n    or option `build-use-chroot` in [`nix.conf`](http://nixos.org/nix/manual/#sec-conf-file)\r\n    on non-NixOS)\r\n- Built on platform(s)\r\n   - [x] NixOS\r\n   - [ ] OS X\r\n   - [ ] Linux\r\n- [ ] Tested compilation of all pkgs that depend on this change using `nix-shell -p nox --run \"nox-review wip\"`\r\n- [ ] Tested execution of all binary files (usually in `./result/bin/`)\r\n- [x] Fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md).\r\n\r\n---\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/236363601","html_url":"https://github.com/NixOS/nixpkgs/pull/17357#issuecomment-236363601","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/17357","id":236363601,"user":{"login":"domenkozar","id":126339,"avatar_url":"https://avatars.githubusercontent.com/u/126339?v=3","gravatar_id":"","url":"https://api.github.com/users/domenkozar","html_url":"https://github.com/domenkozar","followers_url":"https://api.github.com/users/domenkozar/followers","following_url":"https://api.github.com/users/domenkozar/following{/other_user}","gists_url":"https://api.github.com/users/domenkozar/gists{/gist_id}","starred_url":"https://api.github.com/users/domenkozar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domenkozar/subscriptions","organizations_url":"https://api.github.com/users/domenkozar/orgs","repos_url":"https://api.github.com/users/domenkozar/repos","events_url":"https://api.github.com/users/domenkozar/events{/privacy}","received_events_url":"https://api.github.com/users/domenkozar/received_events","type":"User","site_admin":false},"created_at":"2016-07-30T12:51:40Z","updated_at":"2016-07-30T12:51:40Z","body":"We should use this to extract `.version` at least :)\r\n\r\nIt would make my life easier, since a lot of times I broke nixpkgs when bumping NixOS verison and introduced a newline."}}
{"actor":{"display_login":"domenkozar"}}