Advertisement
Guest User

Untitled

a guest
Apr 11th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. # configuration.nix
  2.  
  3. { lib, pkgs, config, ... }:
  4.  
  5. with lib;
  6.  
  7. {
  8. imports = [
  9. <nixpkgs/nixos/modules/installer/netboot/netboot-minimal.nix>
  10. ./autoreboot.nix
  11. ./kexec.nix
  12. ./justdoit.nix
  13. ];
  14.  
  15. boot.loader.grub.enable = false;
  16. boot.kernelParams = [
  17. "console=ttyS0,115200" # allows certain forms of remote access, if the hardware is setup right
  18. "panic=30" "boot.panic_on_fail" # reboot the machine upon fatal boot issues
  19. ];
  20. systemd.services.sshd.wantedBy = mkForce [ "multi-user.target" ];
  21. networking.hostName = "kexec";
  22.  
  23. users.users.root.openssh.authorizedKeys.keys = [ (builtins.getEnv "ssh_key") ];
  24. }
  25.  
  26.  
  27. # script.sh
  28.  
  29. ssh_key=$(cat ~/.ssh/id_rsa.pub)
  30.  
  31. nix-build '<nixpkgs/nixos>' -Q -j 4 \
  32. -A config.system.build.kexec_tarball \
  33. -I nixos-config="configuration.nix"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement