diff --git a/README.md b/README.md index f43648d7..a61b036b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,6 @@ I use [fzf](http://github.com/junegunn/fzf) to act as my fuzzy-matcher. ## Nix -1. [Prepare disk for Nix]. 1. Install [nix] 1. Install [nix-darwin] 1. Install [home-manager] @@ -29,14 +28,11 @@ https://github.com/rycee/home-manager/archive/master.tar.gz home-manager https://nixos.org/channels/nixpkgs-unstable unstable ``` -1. Build nix: - ```sh % darwin-rebuild switch -I darwin-config=$HOME/src/dotfiles/nixpkgs/darwin-configuration.nix % home-manager switch -f $HOME/src/dotfiles/config/nixpkgs/home.nix ``` -[Prepare disk for Nix]: https://github.com/teoljungberg/blob/master/hooks/setup-nix [nix]: https://nixos.org/download.html [nix-darwin]: https://github.com/LnL7/nix-darwin [home-manager]: https://github.com/rycee/home-manager diff --git a/hooks/setup-nix b/hooks/setup-nix deleted file mode 100755 index d0644acd..00000000 --- a/hooks/setup-nix +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# Taken from Burke Libbey[1] -# [1]: https://github.com/burke/b/blob/master/README.md - -set -ex - -setup_root_mount() { - path=$1 - name=$2 - echo "$path" | sudo tee -a /etc/synthetic.conf - /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -B - echo "LABEL=$name /$path apfs rw" | sudo tee -a /etc/fstab - sudo diskutil apfs addVolume disk1 APFSX "$name" -mountpoint "/$path" - sudo diskutil enableOwnership "/$path" - sudo chown -R "$(whoami)" "/$path" - passphrase=$(ruby -rsecurerandom -e 'puts SecureRandom.hex(32)') - uuid="$(diskutil info /nix | awk '$2 == "UUID:" { print $3 }')" - echo "$passphrase" | sudo diskutil apfs enableFileVault "/$path" -user disk -stdinpassphrase - security add-generic-password \ - -l "$name" \ - -a "$uuid" \ - -s "$uuid" \ - -D "Encrypted Volume Password" \ - -w "$passphrase" \ - -T "/System/Library/CoreServices/APFSUserAgent" \ - -T "/System/Library/CoreServices/CSUserAgent" -} - -setup_root_mount nix Nix -setup_root_mount run Run - -sudo mv /etc/shells /etc/shells.before-nix -sudo mv /etc/zprofile /etc/zprofile.before-nix -sudo mv /etc/zshrc /etc/zshrc.before-nix