{"action":"closed","number":17784,"pull_request":{"url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/17784","id":81556753,"html_url":"https://github.com/NixOS/nixpkgs/pull/17784","diff_url":"https://github.com/NixOS/nixpkgs/pull/17784.diff","patch_url":"https://github.com/NixOS/nixpkgs/pull/17784.patch","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/17784","number":17784,"state":"closed","locked":false,"title":"nixos/stage-1: add mechanism which lustrates all impurities from /","user":{"login":"obadz","id":3359345,"avatar_url":"https://avatars.githubusercontent.com/u/3359345?v=3","gravatar_id":"","url":"https://api.github.com/users/obadz","html_url":"https://github.com/obadz","followers_url":"https://api.github.com/users/obadz/followers","following_url":"https://api.github.com/users/obadz/following{/other_user}","gists_url":"https://api.github.com/users/obadz/gists{/gist_id}","starred_url":"https://api.github.com/users/obadz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obadz/subscriptions","organizations_url":"https://api.github.com/users/obadz/orgs","repos_url":"https://api.github.com/users/obadz/repos","events_url":"https://api.github.com/users/obadz/events{/privacy}","received_events_url":"https://api.github.com/users/obadz/received_events","type":"User","site_admin":false},"body":"###### Motivation for this change\r\n\r\nThis mechanism can be used for either:\r\n- Return an existing NixOS install to its \"first boot\" state; or\r\n- Turn a non-NixOS install into a NixOS system (see below)\r\n\r\n> lustrate /ˈlʌstreɪt/ verb:\r\n> \"purify by expiatory sacrifice, ceremonial washing, or some other ritual action.\"\r\n\r\n- `sudo touch /etc/NIXOS_LUSTRATE`\r\n  ⇒ on next reboot, during stage 1, everything but `/nix` and `/boot`\r\n  is moved to `/old-root`\r\n- `echo \"etc/passwd\" | sudo tee -a /etc/NIXOS_LUSTRATE`\r\n  ⇒ on next reboot, during stage 1, everything but `/nix` and `/boot`\r\n  is moved to `/old-root`; *except* `/etc/passwd` which is copied back.\r\n\r\nUseful for installing NixOS in place on another distro. For instance:\r\n\r\n```\r\n$ nix-env -iE '_: with import <nixpkgs/nixos> { configuration = {}; }; with config.system.build; [ nixos-generate-config manual.manpages ]'\r\n$ sudo mkdir /etc/nixos\r\n$ sudo `which nixos-generate-config`\r\n```\r\n\r\n… edit the configuration files in `/etc/nixos` using `man configuration.nix`  if needed\r\n\r\n  maybe add: `users.extraUsers.root.initialHashedPassword = \"\"` ?\r\n\r\n… Build the entire NixOS system and link it to the system profile:\r\n```\r\n$ nix-env -p /nix/var/nix/profiles/system -f '<nixpkgs/nixos>' -iA system\r\n```\r\n\r\n… If you were using a single user install:\r\n```\r\n$ sudo chown -R 0.0 /nix\r\n```\r\n… NixOS is about to take over\r\n```\r\n$ sudo touch /etc/NIXOS\r\n$ sudo touch /etc/NIXOS_LUSTRATE\r\n```\r\n\r\n… Let's keep the configuration files we just created\r\n```\r\n$ echo etc/nixos | sudo tee -a /etc/NIXOS_LUSTRATE\r\n```\r\n\r\n```\r\n$ sudo mv -v /boot /boot.bak &&\r\n  sudo /nix/var/nix/profiles/system/bin/switch-to-configuration boot\r\n$ sudo reboot\r\n```\r\n\r\n… NixOS boots, Stage 1 moves all the old distro stuff in `/old-root`.\r\n\r\n###### Things done\r\n\r\n- [x] 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   - [x] Linux\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\ncc @edolstra @domenkozar @aszlig @cleverca22 @grahamc","created_at":"2016-08-16T22:37:09Z","updated_at":"2016-08-22T00:15:14Z","closed_at":"2016-08-22T00:15:13Z","merged_at":"2016-08-22T00:15:13Z","merge_commit_sha":"3d16af70bf894ce15ec9bdcad3c9ac736dc43630","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/NixOS/nixpkgs/milestones/9","html_url":"https://github.com/NixOS/nixpkgs/milestones/16.09","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/milestones/9/labels","id":1599653,"number":9,"title":"16.09","description":"The next release after 16.03. Perhaps it will be 16.09","creator":{"login":"vcunat","id":1785925,"avatar_url":"https://avatars.githubusercontent.com/u/1785925?v=3","gravatar_id":"","url":"https://api.github.com/users/vcunat","html_url":"https://github.com/vcunat","followers_url":"https://api.github.com/users/vcunat/followers","following_url":"https://api.github.com/users/vcunat/following{/other_user}","gists_url":"https://api.github.com/users/vcunat/gists{/gist_id}","starred_url":"https://api.github.com/users/vcunat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcunat/subscriptions","organizations_url":"https://api.github.com/users/vcunat/orgs","repos_url":"https://api.github.com/users/vcunat/repos","events_url":"https://api.github.com/users/vcunat/events{/privacy}","received_events_url":"https://api.github.com/users/vcunat/received_events","type":"User","site_admin":false},"open_issues":50,"closed_issues":43,"state":"open","created_at":"2016-02-23T13:45:20Z","updated_at":"2016-08-22T00:15:14Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/17784/commits","review_comments_url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/17784/comments","review_comment_url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/17784/comments","statuses_url":"https://api.github.com/repos/NixOS/nixpkgs/statuses/c8c421250ae34728b3411e78510986e0262cb593","head":{"label":"obadz:nixos-lustrate","ref":"nixos-lustrate","sha":"c8c421250ae34728b3411e78510986e0262cb593","user":{"login":"obadz","id":3359345,"avatar_url":"https://avatars.githubusercontent.com/u/3359345?v=3","gravatar_id":"","url":"https://api.github.com/users/obadz","html_url":"https://github.com/obadz","followers_url":"https://api.github.com/users/obadz/followers","following_url":"https://api.github.com/users/obadz/following{/other_user}","gists_url":"https://api.github.com/users/obadz/gists{/gist_id}","starred_url":"https://api.github.com/users/obadz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obadz/subscriptions","organizations_url":"https://api.github.com/users/obadz/orgs","repos_url":"https://api.github.com/users/obadz/repos","events_url":"https://api.github.com/users/obadz/events{/privacy}","received_events_url":"https://api.github.com/users/obadz/received_events","type":"User","site_admin":false},"repo":{"id":31687701,"name":"nixpkgs","full_name":"obadz/nixpkgs","owner":{"login":"obadz","id":3359345,"avatar_url":"https://avatars.githubusercontent.com/u/3359345?v=3","gravatar_id":"","url":"https://api.github.com/users/obadz","html_url":"https://github.com/obadz","followers_url":"https://api.github.com/users/obadz/followers","following_url":"https://api.github.com/users/obadz/following{/other_user}","gists_url":"https://api.github.com/users/obadz/gists{/gist_id}","starred_url":"https://api.github.com/users/obadz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obadz/subscriptions","organizations_url":"https://api.github.com/users/obadz/orgs","repos_url":"https://api.github.com/users/obadz/repos","events_url":"https://api.github.com/users/obadz/events{/privacy}","received_events_url":"https://api.github.com/users/obadz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/obadz/nixpkgs","description":"Nix Packages collection","fork":true,"url":"https://api.github.com/repos/obadz/nixpkgs","forks_url":"https://api.github.com/repos/obadz/nixpkgs/forks","keys_url":"https://api.github.com/repos/obadz/nixpkgs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/obadz/nixpkgs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/obadz/nixpkgs/teams","hooks_url":"https://api.github.com/repos/obadz/nixpkgs/hooks","issue_events_url":"https://api.github.com/repos/obadz/nixpkgs/issues/events{/number}","events_url":"https://api.github.com/repos/obadz/nixpkgs/events","assignees_url":"https://api.github.com/repos/obadz/nixpkgs/assignees{/user}","branches_url":"https://api.github.com/repos/obadz/nixpkgs/branches{/branch}","tags_url":"https://api.github.com/repos/obadz/nixpkgs/tags","blobs_url":"https://api.github.com/repos/obadz/nixpkgs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/obadz/nixpkgs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/obadz/nixpkgs/git/refs{/sha}","trees_url":"https://api.github.com/repos/obadz/nixpkgs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/obadz/nixpkgs/statuses/{sha}","languages_url":"https://api.github.com/repos/obadz/nixpkgs/languages","stargazers_url":"https://api.github.com/repos/obadz/nixpkgs/stargazers","contributors_url":"https://api.github.com/repos/obadz/nixpkgs/contributors","subscribers_url":"https://api.github.com/repos/obadz/nixpkgs/subscribers","subscription_url":"https://api.github.com/repos/obadz/nixpkgs/subscription","commits_url":"https://api.github.com/repos/obadz/nixpkgs/commits{/sha}","git_commits_url":"https://api.github.com/repos/obadz/nixpkgs/git/commits{/sha}","comments_url":"https://api.github.com/repos/obadz/nixpkgs/comments{/number}","issue_comment_url":"https://api.github.com/repos/obadz/nixpkgs/issues/comments{/number}","contents_url":"https://api.github.com/repos/obadz/nixpkgs/contents/{+path}","compare_url":"https://api.github.com/repos/obadz/nixpkgs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/obadz/nixpkgs/merges","archive_url":"https://api.github.com/repos/obadz/nixpkgs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/obadz/nixpkgs/downloads","issues_url":"https://api.github.com/repos/obadz/nixpkgs/issues{/number}","pulls_url":"https://api.github.com/repos/obadz/nixpkgs/pulls{/number}","milestones_url":"https://api.github.com/repos/obadz/nixpkgs/milestones{/number}","notifications_url":"https://api.github.com/repos/obadz/nixpkgs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/obadz/nixpkgs/labels{/name}","releases_url":"https://api.github.com/repos/obadz/nixpkgs/releases{/id}","deployments_url":"https://api.github.com/repos/obadz/nixpkgs/deployments","created_at":"2015-03-05T00:36:51Z","updated_at":"2016-01-12T14:55:39Z","pushed_at":"2016-08-20T21:35:29Z","git_url":"git://github.com/obadz/nixpkgs.git","ssh_url":"git@github.com:obadz/nixpkgs.git","clone_url":"https://github.com/obadz/nixpkgs.git","svn_url":"https://github.com/obadz/nixpkgs","homepage":null,"size":322921,"stargazers_count":0,"watchers_count":0,"language":"Nix","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"obadz"}},"base":{"label":"NixOS:master","ref":"master","sha":"65ef681c94c6ce201db1134616733f2e60aa91ba","user":{"login":"NixOS","id":487568,"avatar_url":"https://avatars.githubusercontent.com/u/487568?v=3","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://avatars.githubusercontent.com/u/487568?v=3","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":"2016-08-21T12:32:43Z","pushed_at":"2016-08-22T00:15:15Z","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":573431,"stargazers_count":1258,"watchers_count":1258,"language":"Nix","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1571,"mirror_url":null,"open_issues_count":1497,"forks":1571,"open_issues":1497,"watchers":1258,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/17784"},"html":{"href":"https://github.com/NixOS/nixpkgs/pull/17784"},"issue":{"href":"https://api.github.com/repos/NixOS/nixpkgs/issues/17784"},"comments":{"href":"https://api.github.com/repos/NixOS/nixpkgs/issues/17784/comments"},"review_comments":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/17784/comments"},"review_comment":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NixOS/nixpkgs/pulls/17784/commits"},"statuses":{"href":"https://api.github.com/repos/NixOS/nixpkgs/statuses/c8c421250ae34728b3411e78510986e0262cb593"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"obadz","id":3359345,"avatar_url":"https://avatars.githubusercontent.com/u/3359345?v=3","gravatar_id":"","url":"https://api.github.com/users/obadz","html_url":"https://github.com/obadz","followers_url":"https://api.github.com/users/obadz/followers","following_url":"https://api.github.com/users/obadz/following{/other_user}","gists_url":"https://api.github.com/users/obadz/gists{/gist_id}","starred_url":"https://api.github.com/users/obadz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obadz/subscriptions","organizations_url":"https://api.github.com/users/obadz/orgs","repos_url":"https://api.github.com/users/obadz/repos","events_url":"https://api.github.com/users/obadz/events{/privacy}","received_events_url":"https://api.github.com/users/obadz/received_events","type":"User","site_admin":false},"comments":9,"review_comments":0,"commits":1,"additions":52,"deletions":3,"changed_files":2}}
{"actor":{"display_login":"obadz"}}