Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { config, pkgs, ... }:
- {
- boot.initrd.network = {
- # This will use udhcp to get an ip address.
- # Make sure you have added the kernel module for your network driver to `boot.initrd.availableKernelModules`,
- # so your initrd can load it!
- # Static ip addresses might be configured using the ip argument in kernel command line:
- # https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt
- enable = true;
- ssh = {
- enable = true;
- # To prevent ssh from freaking out because a different host key is used,
- # a different port for dropbear is useful (assuming the same host has also a normal sshd running)
- port = 22;
- # dropbear uses key format different from openssh; can be generated by using:
- # $ nix-shell -p dropbear --command "dropbearkey -t ecdsa -f /tmp/initrd-ssh-key"
- hostECDSAKey = "/root/initrd-ssh-key";
- # public ssh key used for login
- authorizedKeys = config.users.users.imon.openssh.authorizedKeys.keys;
- };
- # this will automatically load the zfs password prompt on login
- # and kill the other prompt so boot can continue
- postCommands = ''
- echo "zfs load-key -a; killall zfs" >> /root/.profile
- '';
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement