No description
| home/tom | ||
| modules | ||
| packages/karabiner-driverkit | ||
| systems | ||
| .gitignore | ||
| CLAUDE.md | ||
| flake.lock | ||
| flake.nix | ||
| Makefile | ||
| README.md | ||
| test.sh | ||
Nix development machines
Instructions
Darwin
sudo softwareupdate --install-rosetta
nix --extra-experimental-features 'flakes nix-command' run nix-darwin -- switch --option eval-cache false --flake 'git+https://src.bhamops.com/tom/nix.git?ref=refactor/use-nix-darwin#goose' --refresh
chsh -s /run/current-system/sw/bin/fish␊
If nix doctor reports the following:
$ nix doctor
[FAIL] Multiple versions of nix found in PATH:
/nix/store/49wgh2fy77pfvcrbnsr0i6mkbhdkwqr7-nix-2.21.2/bin
/nix/store/hghqbpw1d5a2kqzjjn68wm9klqbmjvk0-nix-2.18.2/bin
[PASS] All profiles are gcroots.
[PASS] Client protocol matches store protocol.
[INFO] You are trusted by store uri: daemon
Then run this to remove root user's version of nix
sudo -i nix-env -e nix
Old
# Install nix
sh <(curl -L https://nixos.org/nix/install)
# Install and switch to Home Manager
nix run --extra-experimental-features 'nix-command flakes' 'git+https://src.bhamops.com/tom/nix#homeConfigurations.macos.activationPackage'
home-manager switch --flake "git+https://src.bhamops.com/tom/nix#macos"
Helpers
Using NH
nh home switch . -- --impure
nh darwin switch .
NixOS Generation cleanup
nixos-rebuild list-generations
sudo nix-env --delete-generations --profile /nix/var/nix/profiles/system 86 90 91
sudo nixos-rebuild switch --flake .
Darwin
Find file to set when changing 'System Preferences'
sudo fs_usage -f filesys | grep cfprefsd
```
Find plist to change
```bash
sudo fs_usage -f filesys | grep plist
```
## Good Resources
### Reference
- [nix-darwin (Official)](https://daiderd.com/nix-darwin/manual/index.html)
- [nix-dawrin (MyNixoOS)](https://mynixos.com/nix-darwin)
- [home-manager](https://home-manager-options.extranix.com/)
- [nixpkgs documentation](https://ryantm.github.io/nixpkgs/)
- [nix builtins documentation](https://nix.dev/manual/nix/latest/language/builtins)
- [MacOS settings discovery](https://rderik.com/blog/tracking-where-settings-are-stored-on-macos/)
- [Nix Glossary](https://nix.dev/manual/nix/2.22/glossary)
### Packages
- [nixhub](https://www.nixhub.io)
- [nixpkgs-ruby](https://github.com/bobvanderlinden/nixpkgs-ruby)
### Learning
- https://nixos-and-flakes.thiscute.world/introduction/
### Firefox
- https://github.com/Kreyren/nixos-config/blob/bd4765eb802a0371de7291980ce999ccff59d619/nixos/users/kreyren/home/modules/web-browsers/firefox/firefox.nix#L116-L148
### Example designs to look into
- https://github.com/drupol/nixos-x260
- https://johns.codes/blog/organizing-system-configs-with-nixos https://github.com/JRMurr/NixOsConfig/tree/main
- https://discourse.nixos.org/t/nixos-config-base-a-modularized-base-for-nixos-configs/28171/2 https://github.com/dch82/NixOS-Config-Base