{"action":"opened","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/17767","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/17767/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/17767/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/17767/events","html_url":"https://github.com/NixOS/nixpkgs/issues/17767","id":171291161,"number":17767,"title":"`boot.initrd.network.ssh.enable` breaks initrd build","user":{"login":"elitak","id":769073,"avatar_url":"https://avatars.githubusercontent.com/u/769073?v=3","gravatar_id":"","url":"https://api.github.com/users/elitak","html_url":"https://github.com/elitak","followers_url":"https://api.github.com/users/elitak/followers","following_url":"https://api.github.com/users/elitak/following{/other_user}","gists_url":"https://api.github.com/users/elitak/gists{/gist_id}","starred_url":"https://api.github.com/users/elitak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elitak/subscriptions","organizations_url":"https://api.github.com/users/elitak/orgs","repos_url":"https://api.github.com/users/elitak/repos","events_url":"https://api.github.com/users/elitak/events{/privacy}","received_events_url":"https://api.github.com/users/elitak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-16T00:07:59Z","updated_at":"2016-08-16T00:07:59Z","closed_at":null,"body":"## Issue description\r\n\r\nSupport for running dropbear in init-stage-1 is broken. The initrd cannot be generated when this option is enabled.\r\n\r\n\r\n### Steps to reproduce\r\n\r\n1. add `boot.initrd.network.ssh.enable = true;` to configuration.nix\r\n2. set `boot.initrd.network.ssh.hostRSAKey` as well, to avoid the failed assertion\r\n3. `nixos-rebuild build`\r\n\r\n### Potential Fix\r\n\r\nThe problem has something to do with dropbear pulling in libnss, libc when it's not supposed to. I think dropbear should be rebuilt using static linking anyway, so my proposed fix is:\r\n\r\n    diff --git a/nixos/modules/system/boot/initrd-ssh.nix b/nixos/modules/system/boot/initrd-ssh.nix\r\n    index d0a4ce5..0c59560 100644\r\n    --- a/nixos/modules/system/boot/initrd-ssh.nix\r\n    +++ b/nixos/modules/system/boot/initrd-ssh.nix\r\n    @@ -91,8 +91,7 @@ in\r\n         } ];\r\n     \r\n         boot.initrd.extraUtilsCommands = ''\r\n    -      copy_bin_and_libs ${pkgs.dropbear}/bin/dropbear\r\n    -      cp -pv ${pkgs.glibc.out}/lib/libnss_files.so.* $out/lib\r\n    +      copy_bin_and_libs ${pkgs.dropbear.override { enableStatic=true; }}/bin/dropbear\r\n         '';\r\n     \r\n         boot.initrd.extraUtilsCommandsTest = ''\r\n\r\nDropbear fails to build statically though, so I abandoned the endeavor at this point, since I'm not even sure I know what the real problem is. Removing that `cp -pv` line does fix the build, at least.\r\n\r\n## Technical details\r\n\r\n* System: \"16.03pre75806.77f8f35\"\r\n* Nix version: nix-env (Nix) 1.11.2\r\n* Nixpkgs version: 16.09.git.ee23909 (Flounder)\r\n"}}
{"actor":{"display_login":"elitak"}}