{"action":"created","comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/comments/149575200","pull_request_review_id":74989825,"id":149575200,"diff_hunk":"@@ -63,6 +63,8 @@ let\n     postInstall = ''\n       substituteInPlace $out/lib/systemd/system/wg-quick@.service \\\n         --replace /usr/bin $out/bin\n+      substituteAll ${./wg-default.sh} \"$out\"/bin/wg-default\n+      chmod a+x \"$out\"/bin/wg-default","path":"pkgs/os-specific/linux/wireguard/default.nix","position":20,"original_position":20,"commit_id":"822521334809acc196191ac782560f2b7f6b207e","original_commit_id":"822521334809acc196191ac782560f2b7f6b207e","user":{"login":"zx2c4","id":10643,"avatar_url":"https://avatars1.githubusercontent.com/u/10643?v=4","gravatar_id":"","url":"https://api.github.com/users/zx2c4","html_url":"https://github.com/zx2c4","followers_url":"https://api.github.com/users/zx2c4/followers","following_url":"https://api.github.com/users/zx2c4/following{/other_user}","gists_url":"https://api.github.com/users/zx2c4/gists{/gist_id}","starred_url":"https://api.github.com/users/zx2c4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zx2c4/subscriptions","organizations_url":"https://api.github.com/users/zx2c4/orgs","repos_url":"https://api.github.com/users/zx2c4/repos","events_url":"https://api.github.com/users/zx2c4/events{/privacy}","received_events_url":"https://api.github.com/users/zx2c4/received_events","type":"User","site_admin":false},"body":"`wg-default` is not appropriate as a name. See earlier comment.","created_at":"2017-11-08T04:50:24Z","updated_at":"2017-11-08T04:50:24Z","html_url":"https://github.com/NixOS/nixpkgs/pull/31250#discussion_r149575200","pull_request_url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/31250","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/comments/149575200"},"html":{"href":"https://github.com/NixOS/nixpkgs/pull/31250#discussion_r149575200"},"pull_request":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/31250"}}},"pull_request":{"url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/31250","id":150680716,"html_url":"https://github.com/NixOS/nixpkgs/pull/31250","diff_url":"https://github.com/NixOS/nixpkgs/pull/31250.diff","patch_url":"https://github.com/NixOS/nixpkgs/pull/31250.patch","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/31250","number":31250,"state":"open","locked":false,"title":"wireguard: add support for default routing","user":{"login":"shaunren","id":388428,"avatar_url":"https://avatars0.githubusercontent.com/u/388428?v=4","gravatar_id":"","url":"https://api.github.com/users/shaunren","html_url":"https://github.com/shaunren","followers_url":"https://api.github.com/users/shaunren/followers","following_url":"https://api.github.com/users/shaunren/following{/other_user}","gists_url":"https://api.github.com/users/shaunren/gists{/gist_id}","starred_url":"https://api.github.com/users/shaunren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaunren/subscriptions","organizations_url":"https://api.github.com/users/shaunren/orgs","repos_url":"https://api.github.com/users/shaunren/repos","events_url":"https://api.github.com/users/shaunren/events{/privacy}","received_events_url":"https://api.github.com/users/shaunren/received_events","type":"User","site_admin":false},"body":"###### Motivation for this change\r\nCurrently, when the allowedIP is set to 0.0.0.0/0 or ::/0, the default route is replaced to go through the wireguard wireguard. This is undesirable because the packets from the wireguard interface itself is looped back into the interface, making the interface unable to connect to its endpoint(s). This change replicates the bahaviour of the wg-quick script in this case, by routing all packets with a specific fwmark set by the wireguard interface to the default interface.\r\n\r\n###### Things done\r\n\r\n<!-- Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers. -->\r\n\r\n- [ ] Tested using sandboxing ([nix.useSandbox](http://nixos.org/nixos/manual/options.html#opt-nix.useSandbox) on NixOS, or option `build-use-sandbox` in [`nix.conf`](http://nixos.org/nix/manual/#sec-conf-file) on non-NixOS)\r\n- Built on platform(s)\r\n   - [x] NixOS\r\n   - [ ] macOS\r\n   - [ ] other Linux distributions\r\n- [ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside [nixos/tests](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests))\r\n- [ ] Tested compilation of all pkgs that depend on this change using `nix-shell -p nox --run \"nox-review wip\"`\r\n- [x] 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","created_at":"2017-11-04T15:18:55Z","updated_at":"2017-11-08T04:50:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1f13da9e3fcc1e9588fe10e03b1955340dd72f4","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/31250/commits","review_comments_url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/31250/comments","review_comment_url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/31250/comments","statuses_url":"https://api.github.com/repos/NixOS/nixpkgs/statuses/822521334809acc196191ac782560f2b7f6b207e","head":{"label":"shaunren:wireguard","ref":"wireguard","sha":"822521334809acc196191ac782560f2b7f6b207e","user":{"login":"shaunren","id":388428,"avatar_url":"https://avatars0.githubusercontent.com/u/388428?v=4","gravatar_id":"","url":"https://api.github.com/users/shaunren","html_url":"https://github.com/shaunren","followers_url":"https://api.github.com/users/shaunren/followers","following_url":"https://api.github.com/users/shaunren/following{/other_user}","gists_url":"https://api.github.com/users/shaunren/gists{/gist_id}","starred_url":"https://api.github.com/users/shaunren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaunren/subscriptions","organizations_url":"https://api.github.com/users/shaunren/orgs","repos_url":"https://api.github.com/users/shaunren/repos","events_url":"https://api.github.com/users/shaunren/events{/privacy}","received_events_url":"https://api.github.com/users/shaunren/received_events","type":"User","site_admin":false},"repo":{"id":104852104,"name":"nixpkgs","full_name":"shaunren/nixpkgs","owner":{"login":"shaunren","id":388428,"avatar_url":"https://avatars0.githubusercontent.com/u/388428?v=4","gravatar_id":"","url":"https://api.github.com/users/shaunren","html_url":"https://github.com/shaunren","followers_url":"https://api.github.com/users/shaunren/followers","following_url":"https://api.github.com/users/shaunren/following{/other_user}","gists_url":"https://api.github.com/users/shaunren/gists{/gist_id}","starred_url":"https://api.github.com/users/shaunren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaunren/subscriptions","organizations_url":"https://api.github.com/users/shaunren/orgs","repos_url":"https://api.github.com/users/shaunren/repos","events_url":"https://api.github.com/users/shaunren/events{/privacy}","received_events_url":"https://api.github.com/users/shaunren/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shaunren/nixpkgs","description":"Nix Packages collection","fork":true,"url":"https://api.github.com/repos/shaunren/nixpkgs","forks_url":"https://api.github.com/repos/shaunren/nixpkgs/forks","keys_url":"https://api.github.com/repos/shaunren/nixpkgs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shaunren/nixpkgs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shaunren/nixpkgs/teams","hooks_url":"https://api.github.com/repos/shaunren/nixpkgs/hooks","issue_events_url":"https://api.github.com/repos/shaunren/nixpkgs/issues/events{/number}","events_url":"https://api.github.com/repos/shaunren/nixpkgs/events","assignees_url":"https://api.github.com/repos/shaunren/nixpkgs/assignees{/user}","branches_url":"https://api.github.com/repos/shaunren/nixpkgs/branches{/branch}","tags_url":"https://api.github.com/repos/shaunren/nixpkgs/tags","blobs_url":"https://api.github.com/repos/shaunren/nixpkgs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shaunren/nixpkgs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shaunren/nixpkgs/git/refs{/sha}","trees_url":"https://api.github.com/repos/shaunren/nixpkgs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shaunren/nixpkgs/statuses/{sha}","languages_url":"https://api.github.com/repos/shaunren/nixpkgs/languages","stargazers_url":"https://api.github.com/repos/shaunren/nixpkgs/stargazers","contributors_url":"https://api.github.com/repos/shaunren/nixpkgs/contributors","subscribers_url":"https://api.github.com/repos/shaunren/nixpkgs/subscribers","subscription_url":"https://api.github.com/repos/shaunren/nixpkgs/subscription","commits_url":"https://api.github.com/repos/shaunren/nixpkgs/commits{/sha}","git_commits_url":"https://api.github.com/repos/shaunren/nixpkgs/git/commits{/sha}","comments_url":"https://api.github.com/repos/shaunren/nixpkgs/comments{/number}","issue_comment_url":"https://api.github.com/repos/shaunren/nixpkgs/issues/comments{/number}","contents_url":"https://api.github.com/repos/shaunren/nixpkgs/contents/{+path}","compare_url":"https://api.github.com/repos/shaunren/nixpkgs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shaunren/nixpkgs/merges","archive_url":"https://api.github.com/repos/shaunren/nixpkgs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shaunren/nixpkgs/downloads","issues_url":"https://api.github.com/repos/shaunren/nixpkgs/issues{/number}","pulls_url":"https://api.github.com/repos/shaunren/nixpkgs/pulls{/number}","milestones_url":"https://api.github.com/repos/shaunren/nixpkgs/milestones{/number}","notifications_url":"https://api.github.com/repos/shaunren/nixpkgs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shaunren/nixpkgs/labels{/name}","releases_url":"https://api.github.com/repos/shaunren/nixpkgs/releases{/id}","deployments_url":"https://api.github.com/repos/shaunren/nixpkgs/deployments","created_at":"2017-09-26T07:38:36Z","updated_at":"2017-09-26T07:39:06Z","pushed_at":"2017-11-05T11:24:12Z","git_url":"git://github.com/shaunren/nixpkgs.git","ssh_url":"git@github.com:shaunren/nixpkgs.git","clone_url":"https://github.com/shaunren/nixpkgs.git","svn_url":"https://github.com/shaunren/nixpkgs","homepage":null,"size":627445,"stargazers_count":0,"watchers_count":0,"language":"Nix","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"NixOS:master","ref":"master","sha":"d9024786f2a5e67f1a03be162647ef2e0202c64a","user":{"login":"NixOS","id":487568,"avatar_url":"https://avatars3.githubusercontent.com/u/487568?v=4","gravatar_id":"","url":"https://api.github.com/users/NixOS","html_url":"https://github.com/NixOS","followers_url":"https://api.github.com/users/NixOS/followers","following_url":"https://api.github.com/users/NixOS/following{/other_user}","gists_url":"https://api.github.com/users/NixOS/gists{/gist_id}","starred_url":"https://api.github.com/users/NixOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NixOS/subscriptions","organizations_url":"https://api.github.com/users/NixOS/orgs","repos_url":"https://api.github.com/users/NixOS/repos","events_url":"https://api.github.com/users/NixOS/events{/privacy}","received_events_url":"https://api.github.com/users/NixOS/received_events","type":"Organization","site_admin":false},"repo":{"id":4542716,"name":"nixpkgs","full_name":"NixOS/nixpkgs","owner":{"login":"NixOS","id":487568,"avatar_url":"https://avatars3.githubusercontent.com/u/487568?v=4","gravatar_id":"","url":"https://api.github.com/users/NixOS","html_url":"https://github.com/NixOS","followers_url":"https://api.github.com/users/NixOS/followers","following_url":"https://api.github.com/users/NixOS/following{/other_user}","gists_url":"https://api.github.com/users/NixOS/gists{/gist_id}","starred_url":"https://api.github.com/users/NixOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NixOS/subscriptions","organizations_url":"https://api.github.com/users/NixOS/orgs","repos_url":"https://api.github.com/users/NixOS/repos","events_url":"https://api.github.com/users/NixOS/events{/privacy}","received_events_url":"https://api.github.com/users/NixOS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NixOS/nixpkgs","description":"Nix Packages collection","fork":false,"url":"https://api.github.com/repos/NixOS/nixpkgs","forks_url":"https://api.github.com/repos/NixOS/nixpkgs/forks","keys_url":"https://api.github.com/repos/NixOS/nixpkgs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NixOS/nixpkgs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NixOS/nixpkgs/teams","hooks_url":"https://api.github.com/repos/NixOS/nixpkgs/hooks","issue_events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/events{/number}","events_url":"https://api.github.com/repos/NixOS/nixpkgs/events","assignees_url":"https://api.github.com/repos/NixOS/nixpkgs/assignees{/user}","branches_url":"https://api.github.com/repos/NixOS/nixpkgs/branches{/branch}","tags_url":"https://api.github.com/repos/NixOS/nixpkgs/tags","blobs_url":"https://api.github.com/repos/NixOS/nixpkgs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NixOS/nixpkgs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NixOS/nixpkgs/git/refs{/sha}","trees_url":"https://api.github.com/repos/NixOS/nixpkgs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NixOS/nixpkgs/statuses/{sha}","languages_url":"https://api.github.com/repos/NixOS/nixpkgs/languages","stargazers_url":"https://api.github.com/repos/NixOS/nixpkgs/stargazers","contributors_url":"https://api.github.com/repos/NixOS/nixpkgs/contributors","subscribers_url":"https://api.github.com/repos/NixOS/nixpkgs/subscribers","subscription_url":"https://api.github.com/repos/NixOS/nixpkgs/subscription","commits_url":"https://api.github.com/repos/NixOS/nixpkgs/commits{/sha}","git_commits_url":"https://api.github.com/repos/NixOS/nixpkgs/git/commits{/sha}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/comments{/number}","issue_comment_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments{/number}","contents_url":"https://api.github.com/repos/NixOS/nixpkgs/contents/{+path}","compare_url":"https://api.github.com/repos/NixOS/nixpkgs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NixOS/nixpkgs/merges","archive_url":"https://api.github.com/repos/NixOS/nixpkgs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NixOS/nixpkgs/downloads","issues_url":"https://api.github.com/repos/NixOS/nixpkgs/issues{/number}","pulls_url":"https://api.github.com/repos/NixOS/nixpkgs/pulls{/number}","milestones_url":"https://api.github.com/repos/NixOS/nixpkgs/milestones{/number}","notifications_url":"https://api.github.com/repos/NixOS/nixpkgs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/labels{/name}","releases_url":"https://api.github.com/repos/NixOS/nixpkgs/releases{/id}","deployments_url":"https://api.github.com/repos/NixOS/nixpkgs/deployments","created_at":"2012-06-04T02:49:46Z","updated_at":"2017-11-07T10:10:21Z","pushed_at":"2017-11-08T04:48:56Z","git_url":"git://github.com/NixOS/nixpkgs.git","ssh_url":"git@github.com:NixOS/nixpkgs.git","clone_url":"https://github.com/NixOS/nixpkgs.git","svn_url":"https://github.com/NixOS/nixpkgs","homepage":null,"size":683298,"stargazers_count":1981,"watchers_count":1981,"language":"Nix","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2340,"mirror_url":null,"archived":false,"open_issues_count":2515,"forks":2340,"open_issues":2515,"watchers":1981,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/31250"},"html":{"href":"https://github.com/NixOS/nixpkgs/pull/31250"},"issue":{"href":"https://api.github.com/repos/NixOS/nixpkgs/issues/31250"},"comments":{"href":"https://api.github.com/repos/NixOS/nixpkgs/issues/31250/comments"},"review_comments":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/31250/comments"},"review_comment":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/31250/commits"},"statuses":{"href":"https://api.github.com/repos/NixOS/nixpkgs/statuses/822521334809acc196191ac782560f2b7f6b207e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zx2c4"}}