Difference between revisions of "NixOS"

From CAC Documentation wiki
Jump to navigation Jump to search
(Adding configuration.nix)
 
Line 43: Line 43:
 
   6. Verify image is seen between projects (how)?
 
   6. Verify image is seen between projects (how)?
 
   (While there are NixOS release, it seems less important to version an image based on them, thus we just name the image NixOS).
 
   (While there are NixOS release, it seems less important to version an image based on them, thus we just name the image NixOS).
 +
  7. Update the gist on this page (or submit pull request to do so).

Latest revision as of 16:47, 19 November 2018

System Configuration

The image isn't quite minimal and currently comes with ample disk space (41GiB). Several editors and a minimalist windowing environment are provided. Resizing is possible using manual steps in linux and the openstack cli. The system is entirely defined by:

<gist>e04ac9830106d090c02f36c49828883b</gist>


Update Image

  • From a newly created NixOS instance:
 sudo nix-channel --update
  • Inspect/edit /etc/nixos/configuration.nix
 sudo nixos-rebuild switch
 sudo reboot # and then confirm working
 nix-collect-garbage -d && sudo nix-collect-garbage -d 
 sudo reboot # and then confirm working
  • Change nixos password (passwd) and confirm nothing funny in /etc/shadow!!!
  • Update nixos user password in Shared-CornellCAC last pass vault
  • Confirm you can't ssh or login as root without a password
  • Further cleanup:
 sudo rm -fr /var/lib/cloud/
 rm /home/nixos/.bash_history
  • From OpenStack:
 1. Shut off instance
 2. Create snapshot
  • Work in progress

---

 3. Rename old Image (snapshot) to NixOS-Old
 4. Name new image (snapshot) NixOS; Edit imate: Make sure Protected/Sharing is set to Yes. update metadata as necessary (may need to delete base_image_ref as it is empty). 
 5. Test that new image works by creating and testing an instance.
 6. Verify image is seen between projects (how)?
 (While there are NixOS release, it seems less important to version an image based on them, thus we just name the image NixOS).
 7. Update the gist on this page (or submit pull request to do so).