My DEPRECATED nixos nixpkgs single user config (macOS)
Yes, this was my first adventure in nix, doing it the harder way without home-manager.
See my nix-home for a niv/home-manager based flexible config instead.
Install nix purely functional package manager (single-user).
Go to Single User Installation
It be may required for you to create a Nix Store volume because the default drive is encrypted.
sudo diskutil apfs addVolume disk1 'APFS' 'Nix Store' -mountpoint /nix
sh <(curl -L https://nixos.org/nix/install) --no-daemon
git clone git@github.com:ldeck/nix-config.git ~/.config
nix-env -iA nixpkgs.myPackages
NB: nothing will change if you've not changed any config and/or updated nix itself. See Upgrading Nix.
e.g., ~/.zshrc
#!/bin/sh
source $HOME/.config/shell/.profile
See list of macOS apps in nixpkgs/custom/apps/default.nix
nix-env -iA nixpkgs.myApps
Finds a single application via fuzzy matching if possible. If a single app can't be found, the matching applications are printed (if any), then app-path usage is printed.
Usage: app-path fuzzyname...
Locations searched (in order):
~/.nix-profile/Applications
~/.nix-profile/Applications/Utilities
~/Applications
~/Applications/Utilities
/Applications
/Applications/Utilities
/System/Applications
/System/Applications/Utilities
Examples:
% app-path cont
Matches:
| Contacts.app
| Mission Control.app
Usage: app-path fuzzyname...
% app-path conta
/System/Applications/Contacts.app
% app-path idea
/Users/ldeck/.nix-profile/Applications/IntelliJ IDEA.app
% app-path ins
Matches:
| Insomnia Designer.app |
| Insomnia.app |
Usage: app-path fuzzyname...
% app-path ins de
/Users/ldeck/.nix-profile/Applications/Insomnia Designer.app
# same as this regex
% app-path 'ins.*de'
/Users/ldeck/.nix-profile/Applications/Insomnia Designer.app
Usage: future-git <hours> [<git args>]
Downloads unresolved .*icloud files or directories.
Usage: idownload <file|dir>
Usage: java_home -v <version>
Pipe stdout to jqo to handle intermixed json and standard messages
Usage: ... | jqo
Pipe stdout to jqj to handle intermixed json and standard messages
Usage: ... | jqj
Pipe stdout to jqr to handle intermixed json and standard messages
Usage: ... | jqr
pin versions in ~/.cache/pinned-versions.tsv
shell.nix template with pinned pkgs
Symlinks ~/.nix-profile/Applications/*
to ~/Applications
.
Usage: nix-link-macapps
Open nix or system-installed apps (found using app-path).
Usage: nix-open application [args...]
Re-open nix or system-installed apps (found using app-path).
Usage: nix-reopen application [args...]
Shortcut for nix-shell -p nix-info --run "nix-info -m"
update nix, nixpkgs, myPackages, myApps and symlinks
shortcut for nix-instantiate --eval -A 'lib.version' '<nixpkgs>' | xargs
Configures sudo to be used with Touch ID.
Usage: sudo-with-touch