Skip to content

ramytanios/nix-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My personal Nix configuration flake.

Nix configuration flake for my personal machines (macOS and NixOS).

I am a complete Nix beginner -- don't blindly copy paste

This is work in progress!

💡Heavily inspired by buntec

Fresh NixOS install

After installing NixOS from a USB drive, follow these steps:

  1. Clone this repo and cd into it.

  2. Copy /etc/nixos/hardware-configuration.nix into ./system (OK to overwrite existing dummy file).

  3. Finally, to build and activate in one step using the apps provided by the flake

nix run .#rebuild-nixos # system configuration
nix run .#hm-switch-nixos # dotfiles and home configuration

Fresh macOS install

(Heavily inspired by this gist)

To bootstrap a fresh macOS install, follow these steps:

  1. Install Homebrew (only needed for managing GUI apps via casks)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install Nix:
curl -L https://nixos.org/nix/install | sh
  1. Enable flakes
mkdir -p ~/.config/nix
cat <<EOF > ~/.config/nix/nix.conf
experimental-features = nix-command flakes
EOF
  1. To work around this issue
sudo mv /etc/nix/nix.conf /etc/nix/.nix-darwin.bkp.nix.conf
  1. Clone this repo, cd into it, then build and activate with the following commands:
nix run .#rebuild-macos # system configuration
nix run .#hm-switch-macos # dotfiles and home configuration

Migrating an existing macOS install to Nix

  1. Uninstall Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
  1. Delete everything under ~/.config and any other "dot files" in your home directory.

  2. Delete all applications that are listed as Homebrew casks in ./system/configuration-darwin.nix

  3. Follow the steps for a fresh macOS install.

About

My personal Nix configuration files ⚙️❄️

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published