Skip to content
/ darwindots Public template

Nix-managed MacOS system (intel) with use of nix-darwin and home-manager.

Notifications You must be signed in to change notification settings

Soikr/darwindots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Soikr's Darwindots!

Screenshot 2025-01-19 at 01 32 44

A usable and practical setup

Installation

1. Installing nix and homebrew:

sh <(curl -L https://nixos.org/nix/install)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2. Clone the repo into a designated spot in your home folder (ie. ~/.nixpgs):

nix shell --extra-experimental-features 'nix-command flakes' nixpkgs#git nixpkgs#vim
git clone https://github.com/SoiKr/darwindots ~/.nixconf
cd ~/.nixconf

3. Change the hostname and username in the flake.nix:

~/.nixconf/flake.nix

38.      user = "soikr";
39.      hostname = "snowmalus";

Warning

Dont forget to set your system hostname and user to this and reboot.

4. Setting up nix-darwin and applying the config:

nix --extra-experimental-features "nix-command flakes" build ".#darwinConfigurations.hostname_here.system"
./result/sw/bin/darwin-rebuild switch --flake .
If you already have the nix-darwin binary built:

nix run --extra-experimental-features 'nix-command flakes' nix-darwin -- switch --flake ".#darwinConfigurations.hostname_here.system"
darwin-rebuild switch --flake .

Applying changes from the config

darwin-rebuild switch --flake ~/.

Please reboot after this.

Updating

nix flake update # All Inputs
nix flake lock --update-input <input> # Single  Input

Preset ZSH Aliases for managing nix:

dr = darwin-rebuild switch --flake ~/.nixconf
ne = "nvim -c ':cd ~/.nixconf' ~/.nixconf";
nsh = "nix-shell";
ns = "nix search nixpkgs";
ngc = "nix-collect-garbage -d && nix-store --gc && nix-store --verify --check-contents && nix store optimise";

Additional configuration steps: (Sadly not everything is reproducible easily).

  1. Initialize a rustup toolchain. (ie. rustup toolchain install stable)
  2. Run discord in the terminal first to patch its settings preventing the helper popup and auto updates.
  3. If discord does prompt you with the helper popup, ignore it. If you dont, you can fix discord by doing this:

Caution

force removing the nix path that discord lays in with rm -rf

nix-store --verify --check-contents --repair

Roadmap:

  • Further nixify the config (options, colors, templates, all the stuff i dont wanna set up)

Resources

nix-darwin nix-darwin options home-manager options

Credits

Code formatted with Alejandra

  • You can do this with nix fmt

breuerfelix's dotfiles for providing a base to learn nix and nix-darwin.

bfpimentel's dotfiles for their sketchybar/aerospace integration setup.

About

Nix-managed MacOS system (intel) with use of nix-darwin and home-manager.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published