Advertisement
Guest User

Untitled

a guest
Nov 10th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. { config, pkgs, ... }:
  2.  
  3. {
  4. boot.initrd.network = {
  5. # This will use udhcp to get an ip address.
  6. # Make sure you have added the kernel module for your network driver to `boot.initrd.availableKernelModules`,
  7. # so your initrd can load it!
  8. # Static ip addresses might be configured using the ip argument in kernel command line:
  9. # https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt
  10. enable = true;
  11. ssh = {
  12. enable = true;
  13. # To prevent ssh from freaking out because a different host key is used,
  14. # a different port for dropbear is useful (assuming the same host has also a normal sshd running)
  15. port = 22;
  16. # dropbear uses key format different from openssh; can be generated by using:
  17. # $ nix-shell -p dropbear --command "dropbearkey -t ecdsa -f /tmp/initrd-ssh-key"
  18. hostECDSAKey = "/root/initrd-ssh-key";
  19. # public ssh key used for login
  20. authorizedKeys = config.users.users.imon.openssh.authorizedKeys.keys;
  21. };
  22. # this will automatically load the zfs password prompt on login
  23. # and kill the other prompt so boot can continue
  24. postCommands = ''
  25. echo "zfs load-key -a; killall zfs" >> /root/.profile
  26. '';
  27. };
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement