Advertisement
Guest User

Untitled

a guest
Apr 11th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. # image.nix
  2.  
  3. {config, pkgs, ...}:
  4.  
  5. {
  6. # base on the minimal image and include channel
  7. imports = [
  8. <nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
  9. <nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
  10. ];
  11.  
  12. # enable ssh
  13. systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ];
  14.  
  15. users.users.root.openssh.authorizedKeys.keys = [
  16. (builtins.readFile "~/.ssh/id_rsa.pub")
  17. ];
  18. }
  19.  
  20.  
  21.  
  22. # bash
  23.  
  24. nix-build '<nixpkgs/nixos>' -E "$(cat image.nix | sed 's:~:$HOME:')"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement