Code Monkey home page Code Monkey logo

nixos-config's Introduction

Nix Darwin Kickstarter - Minimal

A basic configuration comprising essential settings for initiating nix-darwin. It can be safely deployed to your system.

How to Start

  1. Install Nix package manager via Nix Official.
  2. Read all the files in this minimal folder, and understand what they do.
    1. If you have trouble understanding, ryan4yin/nixos-and-flakes-book is a good resource to learn nix and flakes.
  3. Install Homebrew, see https://brew.sh/
    1. Homebrew is required to install most of the GUI apps, App Store's apps, and some CLI apps that are not available in nix's package repository nixpkgs.
  4. Search TODO in this minimal folder, and complete all the TODOs.
  5. Run the following command in the root of your nix configuration to start your nix-darwin journey(please change hostname to your hostname):
     nix build .#darwinConfigurations.hostname.system \
     	--extra-experimental-features 'nix-command flakes'
    
     ./result/sw/bin/darwin-rebuild switch --flake .#hostname

To simplify the command, adding the following content by create a Makefile in the root of your nix configuration:

# please change 'hostname' to your hostname
deploy:
	nix build .#darwinConfigurations.hostname.system \
	   --extra-experimental-features 'nix-command flakes'

	./result/sw/bin/darwin-rebuild switch --flake .#hostname

Then you can run make deploy in the root of your nix configuration to deploy your configuration.

Configuration Structure

Your current nix-darwin configuration's structure should be as follows:

› tree
.
├── flake.lock  # a lock file generated by nix, you can ignore it for now
├── flake.nix   # the entry point of your nix configuration, you need to add your hostname here
├── modules     # a folder contains all your nix-darwin configuration files
│   ├── apps.nix        # contains all your homebrew & nix apps(both GUI & CLI)
│   ├── host-users.nix  # defines your hostname & all your system users
│   ├── nix-core.nix    # nix's core configuration, you can ignore it for now
│   └── system.nix      # defines your macOS's system configuration(like dock, trackpad, keyboard, finder, loginwindow, etc.)
└── README.md

Notes on Network Proxy

If you are in a network environment that requires proxy(such as China), you may need to set up proxy for nix and homebrew.

Please refer to the rich-demo folder for more details:

nixos-config's People

Contributors

jjyr avatar

Watchers

James Cloos avatar  avatar  avatar

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.