Skip to content

beetcb/dev.nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Reproducable Dev Environment using NixOS

Local Environment Info

My daily development environment, running on VMware Workstation | VMware Fusion | MacOS.

screenshot

Background image source: https://unsplash.com/photos/5Lw1U5BIumE

Install NixOS/Nix(Darwin)

  • Without flakes(only on linux vm)

    1. Follow the manual installation guide

    2. Post installation

      a. enable vmware-tools

      virtualisation.vmware.guest.enable = true;

      b. hiDPI settings

      c. install nix flakes

      d. rebuild whole system with sudo nixos-rebuild --flake "."

      e. GUNPG | SSH

  • With flakes

    Follow the manual installation guide, replace 2.3.5 command with the following

    # optional dir creation for store dev.nix repo
    sudo mkdir -p /etc/build
    sudo chown -R $(whoami) /etc/build
    
    # when running on darwin, install nix, then darwin first.
    # enter a shell env(with nix flakes installed)
    nix-shell -p nixFlakes git
    
    # clone repo using git
    git clone https://github.com/beetcb/dev.nix.git /etc/build/
    
    # replace hardware configruation with newly generated one(can be safly ignored on darwin)
    cp /mnt/etc/nixos/hardware-configuration.nix /etc/build/os/nixos/hardware.nix
    
    # finally, install nixos
    ## linux
    sudo nixos-install --impure --flake /etc/build
    ## darwin
    darwin-rebuild switch --flake /etc/build
    
    # ssh stuff
    ssh-keygen -t ed25519 -C "$($ git config user.email)"
    cat ~/.ssh/id_ed25519.pub
    ## time to sync your configs to remote git hosting service like github.com,
    ## you can clone my repo and reset remote url(to your cloned repo ssh url) to quickly achieve this.
    git remote set-url origin git@github.com:beetcb/dev.nix.git

Nix/NixOS/VM Gotchas

Bellow is a list of gotchas I've encountered, record them as a reminder.

Channels

Update: use unstatble channel for all!

  • For system pkgs: nixos latest statble channel
  • For user pkgs: mixin of nixos latest unstatble & statble channel

Quick options refs