{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/26287","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/26287/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/26287/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/26287/events","html_url":"https://github.com/NixOS/nixpkgs/pull/26287","id":232684723,"number":26287,"title":"Generalize notion of arch-dependent modules","user":{"login":"abbradar","id":1174810,"avatar_url":"https://avatars0.githubusercontent.com/u/1174810?v=4","gravatar_id":"","url":"https://api.github.com/users/abbradar","html_url":"https://github.com/abbradar","followers_url":"https://api.github.com/users/abbradar/followers","following_url":"https://api.github.com/users/abbradar/following{/other_user}","gists_url":"https://api.github.com/users/abbradar/gists{/gist_id}","starred_url":"https://api.github.com/users/abbradar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abbradar/subscriptions","organizations_url":"https://api.github.com/users/abbradar/orgs","repos_url":"https://api.github.com/users/abbradar/repos","events_url":"https://api.github.com/users/abbradar/events{/privacy}","received_events_url":"https://api.github.com/users/abbradar/received_events","type":"User","site_admin":false},"labels":[{"id":6314752,"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/0.kind:%20enhancement","name":"0.kind: enhancement","color":"84b6eb","default":false},{"id":105675218,"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/1.severity:%20mass-rebuild","name":"1.severity: mass-rebuild","color":"e11d21","default":false},{"id":126506370,"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/2.status:%20work-in-progress","name":"2.status: work-in-progress","color":"e6e6e6","default":false},{"id":60265212,"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/6.topic:%20nixos","name":"6.topic: nixos","color":"fef2c0","default":false},{"id":207327249,"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/9.needs:%20changelog","name":"9.needs: changelog","color":"eb6420","default":false},{"id":465618943,"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/9.needs:%20community%20feedback","name":"9.needs: community feedback","color":"eb6420","default":false},{"id":289925828,"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/9.needs:%20documentation","name":"9.needs: documentation","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-05-31T20:23:46Z","updated_at":"2018-04-26T15:56:57Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/26287","html_url":"https://github.com/NixOS/nixpkgs/pull/26287","diff_url":"https://github.com/NixOS/nixpkgs/pull/26287.diff","patch_url":"https://github.com/NixOS/nixpkgs/pull/26287.patch"},"body":"###### Motivation for this change\r\n\r\nCurrently we have several places in NixOS which use global architecture-dependent modules:\r\n\r\n* OpenGL drivers;\r\n* Input methods;\r\n* sane drivers;\r\n* GTK engines;\r\n\r\nAll of those share common properties:\r\n\r\n* They are necessarily \"impure\";\r\n* They are architecture-dependent -- that is, 32-bit program must use 32-bit modules;\r\n* They are commonly found through hardcoded paths or environment variables.\r\n\r\nThis patch allows NixOS modules to specify functions that return needed packages given a package set as value for `libraries.packages`. Those functions are combined and used to build per-arch environments in /run/current-system/${system}-lib where `system` is `stdenv.system` for a given arch. Also we add a way to specify PATH-like variables that refer to those directories in `libraries.environment`.\r\n\r\nFor now those paths are added in `LD_LIBRARY_PATH` like OpenGL drivers currently. We want to move from this when `libglvnd` allows us but meanwhile I sanitize all packages in `libraries.packages`, removing all non-directories in `/lib`. This shields people from accidentially polluting their library path by e.g. adding a VDPAU driver. To avoid sanitization one needs to use `libraries.unsafePackages`, the only current user now is our OpenGL module. When `LD_LIBRARY_PATH=/lib` is dropped this won't be necessary.\r\n\r\nThe end goal of this patch is to both streamline arch-dependent modules and add multi-arch support to things that don't have it now, for example IM modules. If implemented correctly all applications, both 32-bit and 64-bit, should have same themes, input modules, drivers and all other arch-dependent modules available in the system as long as `libraries.support32Bit` is flipped. Also we get rid of `/run/opengl-driver{,-32}` which I dislike personally (why have it when we already have `/run/current-system`?) :D\r\n\r\nThis patchset also cleans up our environment variables situation, some things being prerequisites to the main idea and some (DEs envvar cleanup) because they came along and were straightforward.\r\n\r\n###### Things done\r\n\r\n- [ ] Tested using sandboxing\r\n  ([nix.useSandbox](http://nixos.org/nixos/manual/options.html#opt-nix.useSandbox) on NixOS,\r\n    or option `build-use-sandbox` in [`nix.conf`](http://nixos.org/nix/manual/#sec-conf-file)\r\n    on non-NixOS)\r\n- Built on platform(s)\r\n   - [ ] NixOS\r\n   - [ ] macOS\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\nInitial implementation is finished and I'm now trying to build my system with this. Before continuing though I'd like to hear feedback from others."},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/384694405","html_url":"https://github.com/NixOS/nixpkgs/pull/26287#issuecomment-384694405","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/26287","id":384694405,"user":{"login":"Ericson2314","id":1055245,"avatar_url":"https://avatars3.githubusercontent.com/u/1055245?v=4","gravatar_id":"","url":"https://api.github.com/users/Ericson2314","html_url":"https://github.com/Ericson2314","followers_url":"https://api.github.com/users/Ericson2314/followers","following_url":"https://api.github.com/users/Ericson2314/following{/other_user}","gists_url":"https://api.github.com/users/Ericson2314/gists{/gist_id}","starred_url":"https://api.github.com/users/Ericson2314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ericson2314/subscriptions","organizations_url":"https://api.github.com/users/Ericson2314/orgs","repos_url":"https://api.github.com/users/Ericson2314/repos","events_url":"https://api.github.com/users/Ericson2314/events{/privacy}","received_events_url":"https://api.github.com/users/Ericson2314/received_events","type":"User","site_admin":false},"created_at":"2018-04-26T15:56:57Z","updated_at":"2018-04-26T15:56:57Z","author_association":"MEMBER","body":"Which changes haha?"}}
{"actor":{"display_login":"Ericson2314"}}