Code Monkey home page Code Monkey logo

dev.nix's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.