Skip to content

Instantly share code, notes, and snippets.

@yuanwang-wf
Forked from yuanw/nixosOnMBP.org
Last active June 30, 2020 17:38
Show Gist options
  • Save yuanwang-wf/74f57b9d1d879fc96a9169862273a92b to your computer and use it in GitHub Desktop.
Save yuanwang-wf/74f57b9d1d879fc96a9169862273a92b to your computer and use it in GitHub Desktop.

Get Nixos ISO

https://nixos.org/download.html

Install Driver (doesn’t work as it is)

https://apple.stackexchange.com/questions/168291/how-to-release-mouse-capture-in-virtualbox

https://apple.stackexchange.com/questions/64064/how-do-i-find-out-what-wireless-card-my-mac-has

login as root

sudo passwd root

GParted for partitions

https://gparted.org/ https://gparted.org/display-doc.php?name=help-manual

We need 3 partitions

  1. boot (512M)
  2. swap (same with memory)
  3. main (the rest)
mkfs.fat -F 32 -n boot /dev/sda3
mkswap -L swap /dev/sda2
mkfs.ext4 -L nixos /dev/sda1

Install

mount /dev/disk/by-label/nixos /mnt
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot
swapon /dev/sda2
nixos-generate-config --root /mnt
nix-env -f '<nixpkgs>' -iA emacs
emacs /mnt/etc/nixos/configuration.nix
// boot.loader.systemd-boot.enable to true
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub.enable = true;
boot.loader.grub.devices = [ "nodev" ];
boot.loader.grub.efiInstallAsRemovable = true;
boot.loader.grub.efiSupport = true;
boot.loader.grub.useOSProber = true;

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment