Skip to content

My Nix Configuration on MacOS & Ubuntu 🖥️

Notifications You must be signed in to change notification settings

arifvn/nixfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Nix Configuration on MacOS & Ubuntu 🖥️

Prerequisite

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

Build

Darwin

  1. Create /run directory as nix-darwin needs it.
printf 'run\tprivate/var/run\n' | sudo tee -a /etc/synthetic.conf
/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t
  1. Install homebrew.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Build and apply your configuration.
nix build .#darwinConfigurations.arifvn.system
./result/sw/bin/darwin-rebuild switch --flake .#arifvn
  1. Switch configuration.
  • drs (to build and switch your configuration)
  • psc (to build and cache your configuration)

Ubuntu

nix build .#homeConfigurations.arifvn.activationPackage
./result/activate

Possible Issues

Darwin

  • warning: failed to execute apfs.util. If you encountered it, you might have needed to restart your machine.
  • warning: can't link /etc/shells or warning can't link /etc/nix/nix.conf. You might get them saying that files under /etc can't be linked as they already exist. You'll need to delete those files and run darwin-rebuild switch again. It'd be good if you had those files backed up first, just in case.
sudo cp /etc/shells /etc/shells.bak && sudo rm /etc/shells
sudo cp /etc/bashrc /etc/bashrc.bak && sudo rm /etc/bashrc
sudo cp /etc/nix/nix.conf /etc/nix/nix.conf.bak

nix build .#darwinConfigurations.arifvn.system --extra-experimental-features nix-command --extra-experimental-features flakes
./result/sw/bin/darwin-rebuild switch --flake .#arifvn
  • command not found: darwin-rebuild. Are nix and darwin-rebuild available in your shell if you open a new terminal and run exec /run/current-system/sw/bin/fish? If so, you might need to run chsh to set the default shell that terminal emulators on your system will use. Try running chsh -s /run/current-system/sw/bin/fish to set Fish as your default shell.

  • Some system settings like Dock settings or Finder settings might only take effects after you reboot your machine.

  • Some apps might need to be configured mannually afterward as they don't come up with configuration files including android-studio, istat-menus and raycast.

Ubuntu

✅ None. It hasn't been found yet.

Acknowledgements

Usefull nix config repos (very much inspire this repo) :

Nix builtin functions:

Tutorials:

About

My Nix Configuration on MacOS & Ubuntu 🖥️

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published