nix導入

オラァ!!
curl -L https://nixos.org/nix/install | sh

bashrcがミスってて変なエラーが出ていたが最初のページのnix-shellのお試しは問題なくできた
ちなみに完了後にnix-collect-garbage
を行ったところ2182 store paths deleted, 1175.63 MiB freed
だったので相当ストレージを消費する まあお試しとはいえgitもnvimもpythonも新しく入れたわけだから当然か

再びやっていこう
導入
curl -L https://nixos.org/nix/install | sh
削除
~/.profileやshellのrcなどから . "$HOME/.nix-profile/etc/profile.d/nix.sh"
を削除
rm -rf $HOME/{.nix-channels,.nix-defexpr,.nix-profile,.config/nixpkgs} sudo
rm -rf /nix
インストールログ
❯ curl -L https://nixos.org/nix/install | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 4267 100 4267 0 0 4941 0 --:--:-- --:--:-- --:--:-- 4941
downloading Nix 2.23.3 binary tarball for aarch64-darwin from 'https://releases.nixos.org/nix/nix-2.23.3/nix-2.23.3-aarch64-darwin.tar.xz' to '/var/folders/m8/1733z37n46q8nzndldgx6hpm0000gn/T/nix-binary-tarball-unpack.UKRHmAz6P7'...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12.1M 100 12.1M 0 0 5278k 0 0:00:02 0:00:02 --:--:-- 5280k
Switching to the Multi-user Installer
Welcome to the Multi-User Nix Installation
This installation tool will set up your computer with the Nix package
manager. This will happen in a few stages:
1. Make sure your computer doesn't already have Nix. If it does, I
will show you instructions on how to clean up your old install.
2. Show you what I am going to install and where. Then I will ask
if you are ready to continue.
3. Create the system users (uids [301..332]) and groups (gid 30000)
that the Nix daemon uses to run builds. To create system users
in a different range, exit and run this tool again with
NIX_FIRST_BUILD_UID set.
4. Perform the basic installation of the Nix files daemon.
5. Configure your shell to import special Nix Profile files, so you
can use Nix.
6. Start the Nix daemon.
Would you like to see a more detailed list of what I will do?
No TTY, assuming you would say yes :)
I will:
- make sure your computer doesn't already have Nix files
(if it does, I will tell you how to clean them up.)
- create local users (see the list above for the users I'll make)
- create a local group (nixbld)
- install Nix in to /nix
- create a configuration file in /etc/nix
- set up the "default profile" by creating some Nix-related files in
/var/root
- back up /etc/bashrc to /etc/bashrc.backup-before-nix
- update /etc/bashrc to include some Nix configuration
- back up /etc/zshrc to /etc/zshrc.backup-before-nix
- update /etc/zshrc to include some Nix configuration
- create a Nix volume and a LaunchDaemon to mount it
- create a LaunchDaemon (at /Library/LaunchDaemons/org.nixos.nix-daemon.plist) for nix-daemon
Ready to continue?
No TTY, assuming you would say yes :)
---- let's talk about sudo -----------------------------------------------------
This script is going to call sudo a lot. Normally, it would show you
exactly what commands it is running and why. However, the script is
run in a headless fashion, like this:
$ curl -L https://nixos.org/nix/install | sh
or maybe in a CI pipeline. Because of that, I'm going to skip the
verbose output in the interest of brevity.
If you would like to
see the output, try like this:
$ curl -L -o install-nix https://nixos.org/nix/install
$ sh ./install-nix
~~> Fixing any leftover Nix volume state
Before I try to install, I'll check for any existing Nix volume config
and ask for your permission to remove it (so that the installer can
start fresh). I'll also ask for permission to fix any issues I spot.
~~> Checking for artifacts of previous installs
Before I try to install, I'll check for signs Nix already is or has
been installed on this system.
---- Nix config report ---------------------------------------------------------
Temp Dir: /var/folders/m8/1733z37n46q8nzndldgx6hpm0000gn/T/tmp.Gi8NSVEvkX
Nix Root: /nix
Build Users: 32
Build Group ID: 30000
Build Group Name: nixbld
build users:
Username: UID
_nixbld1: 301
_nixbld2: 302
_nixbld3: 303
_nixbld4: 304
_nixbld5: 305
_nixbld6: 306
_nixbld7: 307
_nixbld8: 308
_nixbld9: 309
_nixbld10: 310
_nixbld11: 311
_nixbld12: 312
_nixbld13: 313
_nixbld14: 314
_nixbld15: 315
_nixbld16: 316
_nixbld17: 317
_nixbld18: 318
_nixbld19: 319
_nixbld20: 320
_nixbld21: 321
_nixbld22: 322
_nixbld23: 323
_nixbld24: 324
_nixbld25: 325
_nixbld26: 326
_nixbld27: 327
_nixbld28: 328
_nixbld29: 329
_nixbld30: 330
_nixbld31: 331
_nixbld32: 332
Ready to continue?
No TTY, assuming you would say yes :)
---- Preparing a Nix volume ----------------------------------------------------
Nix traditionally stores its data in the root directory /nix, but
macOS now (starting in 10.15 Catalina) has a read-only root directory.
To support Nix, I will create a volume and configure macOS to mount it
at /nix.
~~> Configuring /etc/synthetic.conf to make a mount-point at /nix
Password:
~~> Creating a Nix volume
disk3s7 was already unmounted
~~> Configuring /etc/fstab to specify volume mount options
~~> Encrypt the Nix volume
Volume Nix Store on Nix Store mounted
Encrypting with the new "Disk" crypto user on disk3s7
The new "Disk" user will be the only one who has initial access to disk3s7
The new APFS crypto user UUID will be 3759231F-FC18-430B-9EDA-31C54F84CFB3
Encryption has likely completed due to AES hardware; see "diskutil apfs list"
Volume Nix Store on disk3s7 force-unmounted
~~> Configuring LaunchDaemon to mount 'Nix Store'
~~> Setting up the build group nixbld
Created: Yes
~~> Setting up the build user _nixbld1
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 1
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld2
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 2
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld3
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 3
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld4
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 4
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld5
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 5
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld6
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 6
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld7
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 7
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld8
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 8
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld9
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 9
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld10
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 10
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld11
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 11
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld12
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 12
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld13
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 13
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld14
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 14
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld15
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 15
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld16
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 16
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld17
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 17
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld18
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 18
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld19
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 19
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld20
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 20
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld21
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 21
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld22
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 22
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld23
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 23
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld24
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 24
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld25
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 25
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld26
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 26
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld27
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 27
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld28
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 28
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld29
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 29
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld30
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 30
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld31
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 31
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld32
Created: Yes
Hidden: Yes
Home Directory: /var/empty
Note: Nix build user 32
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the basic directory structure
chown: /nix/.Trashes: Operation not permitted
chown: /nix/.Trashes: Operation not permitted
install: creating directory '/nix/var'
install: creating directory '/nix/var/log'
install: creating directory '/nix/var/log/nix'
install: creating directory '/nix/var/log/nix/drvs'
install: creating directory '/nix/var/nix'
install: creating directory '/nix/var/nix/db'
install: creating directory '/nix/var/nix/gcroots'
install: creating directory '/nix/var/nix/profiles'
install: creating directory '/nix/var/nix/temproots'
install: creating directory '/nix/var/nix/userpool'
install: creating directory '/nix/var/nix/daemon-socket'
install: creating directory '/nix/var/nix/gcroots/per-user'
install: creating directory '/nix/var/nix/profiles/per-user'
install: creating directory '/nix/store'
install: creating directory '/etc/nix'
~~> Installing Nix
Alright! We have our first nix at /nix/store/kcjwh67xvb3kkjp16p8nn0krzvanp3rl-nix-2.23.3
Just finished getting the nix database ready.
~~> Setting up shell profiles: /etc/bashrc /etc/profile.d/nix.sh /etc/zshrc /etc/bash.bashrc /etc/zsh/zshrc
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
~~> Setting up shell profiles for Fish with conf.d/nix.fish inside /etc/fish /usr/local/etc/fish /opt/homebrew/etc/fish /opt/local/etc/fish
~~> Setting up the default profile
installing 'nix-2.23.3'
building '/nix/store/61y0qhzpcqngfgd4znppcc1z5sfd2534-user-environment.drv'...
installing 'nss-cacert-3.95'
building '/nix/store/r5yx343mvjgfva90kk7i5di4iqi4rrm6-user-environment.drv'...
unpacking 1 channels...
~~> Setting up the nix-daemon LaunchDaemon
Alright! We're done!
Try it! Open a new terminal, and type:
$ nix-shell -p nix-info --run "nix-info -m"
Thank you for using this installer. If you have any feedback or need
help, don't hesitate:
You can open an issue at
https://github.com/NixOS/nix/issues/new?labels=installer&template=installer.md
Or get in touch with the community: https://nixos.org/community
---- Reminders -----------------------------------------------------------------
[ 1 ]
Nix won't work in active shell sessions until you restart them.
指示通りshellセッションを立ち上げ直し nix --version
が通ることを確認

https://github.com/kawarimidoll/flask-practice で fh init
してみた
flask-practice
❯ nix run "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz#fh" -- init
Let's build a Nix flake!
> An optional description for your flake: my flask practice
> Which systems would you like to support? You selected 1 system: aarch64-darwin
> Which Nixpkgs version would you like to include? latest stable (currently 23.11)
> This seems to be a Python project. Would you like to initialize your flake with some standard dependencies for Python? Yes
> Select a version of Python 3.11
> You can add any of these Python tools to your environment if you wish pip
> Add any of these standard utilities to your environment if you wish curl, git
> Would you like to add our recommended Nix formatter (nixpkgs-fmt) to your environment? Yes
> Would you like to add doc comments to your flake that explain the meaning of different aspects of the flake? Yes
> Would you like to add any environment variables? Yes
> Variable name:
> Would you like to add a shell hook that runs every time you enter your Nix development environment? No
> Would you like to support legacy Nix commands like `nix-build` and `nix-shell`? Yes
> Would you like to add your new Nix files to Git? Yes
> Would you like to add a .envrc file so that you can use direnv in this project? Yes
> You'll need to run `direnv allow` to activate direnv in this project. Would you like to do that now? No
Your flake is ready to go! Run `nix flake show` to see which outputs it provides.
このへんのファイルが追加
❯ g status --short
?? .envrc
?? default.nix
?? flake.lock
?? flake.nix
?? shell.nix
↑ これ一回ぜんぶunstageしてしまったんだけどnixはgit管理下のファイルじゃないと認識できないことに注意

macosでのアンインストールはここにある
detsysのインストーラーを使っておけばもっと簡単だったな

一度アンインストールプロセスを行った ↑の記事だとバージョンが古い?ので以下を追加でやる必要があった
diskutil apfs deleteVolume "Nix Store"
sudo launchctl bootout system/org.nixos.darwin-store
あっていうか公式のアンインストールプロセスがあったじゃん…これを見るべきだった
nix-installerを使って入れ直す
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
インストールログ
❯ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
info: downloading installer https://install.determinate.systems/nix/tag/v0.20.1/nix-installer-aarch64-darwin
nix-installer
needs to run as root
, attempting to escalate now via sudo
...
Nix install plan (v0.20.1)
Planner: macos (with default settings)
Planned actions:
- Create an encrypted APFS volume
Nix Store
for Nix ondisk3
and add it to/etc/fstab
mounting on/nix
- Extract the bundled Nix (originally from /nix/store/8jlzxrnl7zfk04r0q1hczr3fpylkwah5-nix-binary-tarball-2.23.3/nix-2.23.3-aarch64-darwin.tar.xz)
- Create a directory tree in
/nix
- Move the downloaded Nix into
/nix
- Create build users (UID 301-332) and group (GID 30000)
- Configure Time Machine exclusions
- Setup the default Nix profile
- Place the Nix configuration in
/etc/nix/nix.conf
- Configure the shell profiles
- Configuring zsh to support using Nix in non-interactive shells
- Create a
launchctl
plist to put Nix into your PATH - Configure Nix daemon related settings with launchctl
- Remove directory
/nix/temp-install-dir
Proceed? ([Y]es/[n]o/[e]xplain): e
Nix install plan (v0.20.1)
Planner: macos
Configured settings:
- case_sensitive: false
- diagnostic_endpoint: "https://install.determinate.systems/nix/diagnostic"
- enterprise_edition: false
- extra_conf: []
- force: false
- modify_profile: true
- nix_build_group_id: 30000
- nix_build_group_name: "nixbld"
- nix_build_user_count: 32
- nix_build_user_id_base: 300
- nix_build_user_prefix: "_nixbld"
- nix_package_url: null
- proxy: null
- root_disk: "disk3"
- ssl_cert_file: null
- volume_encrypt: null
- volume_label: "Nix Store"
Planned actions:
- Create an encrypted APFS volume
Nix Store
for Nix ondisk3
and add it to/etc/fstab
mounting on/nix
Create or insert file/etc/synthetic.conf
Create objects defined in/etc/synthetic.conf
Unmount theNix Store
APFS volume
Create an APFS volume ondisk3
namedNix Store
Update existing entry for the APFS volumeNix Store
to/etc/fstab
Encrypt volumeNix Store
on diskdisk3
Create alaunchctl
plist to mount the APFS volume/Library/LaunchDaemons/org.nixos.darwin-store.plist
Bootstrap theorg.nixos.darwin-store
service vialaunchctl bootstrap system /Library/LaunchDaemons/org.nixos.darwin-store.plist
Enable ownership on/nix
- Extract the bundled Nix (originally from /nix/store/8jlzxrnl7zfk04r0q1hczr3fpylkwah5-nix-binary-tarball-2.23.3/nix-2.23.3-aarch64-darwin.tar.xz)
- Create a directory tree in
/nix
Create directory/nix/var
Create directory/nix/var/log
Create directory/nix/var/log/nix
Create directory/nix/var/log/nix/drvs
Create directory/nix/var/nix
Create directory/nix/var/nix/db
Create directory/nix/var/nix/gcroots
Create directory/nix/var/nix/gcroots/per-user
Create directory/nix/var/nix/profiles
Create directory/nix/var/nix/profiles/per-user
Create directory/nix/var/nix/temproots
Create directory/nix/var/nix/userpool
Create directory/nix/var/nix/daemon-socket
- Move the downloaded Nix into
/nix
Nix is being downloaded to/nix/temp-install-dir
and should be in/nix
- Create build users (UID 301-332) and group (GID 30000)
The Nix daemon requires system users (and a group they share) which it can act as in order to build
Create groupnixbld
(GID 30000)
Create user_nixbld1
(UID 301) in groupnixbld
(GID 30000)
Create user_nixbld2
(UID 302) in groupnixbld
(GID 30000)
Create user_nixbld3
(UID 303) in groupnixbld
(GID 30000)
Create user_nixbld4
(UID 304) in groupnixbld
(GID 30000)
Create user_nixbld5
(UID 305) in groupnixbld
(GID 30000)
Create user_nixbld6
(UID 306) in groupnixbld
(GID 30000)
Create user_nixbld7
(UID 307) in groupnixbld
(GID 30000)
Create user_nixbld8
(UID 308) in groupnixbld
(GID 30000)
Create user_nixbld9
(UID 309) in groupnixbld
(GID 30000)
Create user_nixbld10
(UID 310) in groupnixbld
(GID 30000)
Create user_nixbld11
(UID 311) in groupnixbld
(GID 30000)
Create user_nixbld12
(UID 312) in groupnixbld
(GID 30000)
Create user_nixbld13
(UID 313) in groupnixbld
(GID 30000)
Create user_nixbld14
(UID 314) in groupnixbld
(GID 30000)
Create user_nixbld15
(UID 315) in groupnixbld
(GID 30000)
Create user_nixbld16
(UID 316) in groupnixbld
(GID 30000)
Create user_nixbld17
(UID 317) in groupnixbld
(GID 30000)
Create user_nixbld18
(UID 318) in groupnixbld
(GID 30000)
Create user_nixbld19
(UID 319) in groupnixbld
(GID 30000)
Create user_nixbld20
(UID 320) in groupnixbld
(GID 30000)
Create user_nixbld21
(UID 321) in groupnixbld
(GID 30000)
Create user_nixbld22
(UID 322) in groupnixbld
(GID 30000)
Create user_nixbld23
(UID 323) in groupnixbld
(GID 30000)
Create user_nixbld24
(UID 324) in groupnixbld
(GID 30000)
Create user_nixbld25
(UID 325) in groupnixbld
(GID 30000)
Create user_nixbld26
(UID 326) in groupnixbld
(GID 30000)
Create user_nixbld27
(UID 327) in groupnixbld
(GID 30000)
Create user_nixbld28
(UID 328) in groupnixbld
(GID 30000)
Create user_nixbld29
(UID 329) in groupnixbld
(GID 30000)
Create user_nixbld30
(UID 330) in groupnixbld
(GID 30000)
Create user_nixbld31
(UID 331) in groupnixbld
(GID 30000)
Create user_nixbld32
(UID 332) in groupnixbld
(GID 30000)
Add user_nixbld1
(UID 301) to groupnixbld
(GID 30000)
Add user_nixbld2
(UID 302) to groupnixbld
(GID 30000)
Add user_nixbld3
(UID 303) to groupnixbld
(GID 30000)
Add user_nixbld4
(UID 304) to groupnixbld
(GID 30000)
Add user_nixbld5
(UID 305) to groupnixbld
(GID 30000)
Add user_nixbld6
(UID 306) to groupnixbld
(GID 30000)
Add user_nixbld7
(UID 307) to groupnixbld
(GID 30000)
Add user_nixbld8
(UID 308) to groupnixbld
(GID 30000)
Add user_nixbld9
(UID 309) to groupnixbld
(GID 30000)
Add user_nixbld10
(UID 310) to groupnixbld
(GID 30000)
Add user_nixbld11
(UID 311) to groupnixbld
(GID 30000)
Add user_nixbld12
(UID 312) to groupnixbld
(GID 30000)
Add user_nixbld13
(UID 313) to groupnixbld
(GID 30000)
Add user_nixbld14
(UID 314) to groupnixbld
(GID 30000)
Add user_nixbld15
(UID 315) to groupnixbld
(GID 30000)
Add user_nixbld16
(UID 316) to groupnixbld
(GID 30000)
Add user_nixbld17
(UID 317) to groupnixbld
(GID 30000)
Add user_nixbld18
(UID 318) to groupnixbld
(GID 30000)
Add user_nixbld19
(UID 319) to groupnixbld
(GID 30000)
Add user_nixbld20
(UID 320) to groupnixbld
(GID 30000)
Add user_nixbld21
(UID 321) to groupnixbld
(GID 30000)
Add user_nixbld22
(UID 322) to groupnixbld
(GID 30000)
Add user_nixbld23
(UID 323) to groupnixbld
(GID 30000)
Add user_nixbld24
(UID 324) to groupnixbld
(GID 30000)
Add user_nixbld25
(UID 325) to groupnixbld
(GID 30000)
Add user_nixbld26
(UID 326) to groupnixbld
(GID 30000)
Add user_nixbld27
(UID 327) to groupnixbld
(GID 30000)
Add user_nixbld28
(UID 328) to groupnixbld
(GID 30000)
Add user_nixbld29
(UID 329) to groupnixbld
(GID 30000)
Add user_nixbld30
(UID 330) to groupnixbld
(GID 30000)
Add user_nixbld31
(UID 331) to groupnixbld
(GID 30000)
Add user_nixbld32
(UID 332) to groupnixbld
(GID 30000) - Configure Time Machine exclusions
Configure Time Machine exclusion on/nix/store
Configure Time Machine exclusion on/nix/var
- Setup the default Nix profile
- Place the Nix configuration in
/etc/nix/nix.conf
This file is read by the Nix daemon to set its configuration options at runtime.
Create directory/etc/nix
Merge or create nix.conf file/etc/nix/nix.conf
- Configure the shell profiles
Update shell profiles to import Nix - Configuring zsh to support using Nix in non-interactive shells
Update/etc/zshenv
to import Nix - Create a
launchctl
plist to put Nix into your PATH - Configure Nix daemon related settings with launchctl
Copy/nix/var/nix/profiles/default/Library/LaunchDaemons/org.nixos.nix-daemon.plist
to/Library/LaunchDaemons/org.nixos.nix-daemon.plist
Runlaunchctl bootstrap /Library/LaunchDaemons/org.nixos.nix-daemon.plist
- Remove directory
/nix/temp-install-dir
Proceed? ([Y]es/[n]o): y
INFO Step: Create an encrypted APFS volume Nix Store
for Nix on disk3
and add it to /etc/fstab
mounting on /nix
INFO Step: Provision Nix
INFO Step: Create build users (UID 301-332) and group (GID 30000)
INFO Step: Configure Time Machine exclusions
INFO Step: Configure Nix
INFO Step: Configuring zsh to support using Nix in non-interactive shells
INFO Step: Create a launchctl
plist to put Nix into your PATH
INFO Step: Configure Nix daemon related settings with launchctl
INFO Step: Remove directory /nix/temp-install-dir
Nix was installed successfully!
To get started using Nix, open a new shell or run . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh

生nixをhomebrewの代わりにするのはなんとなくできた
次はhome-managerする
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update

homebrewから移せなかった(nixで提供されていなかった)CLIたち
-
結局使ってないので消したもの
- clog
- gitbatch
- github-markdown-toc
- jpeg
- keith/formulae/reminders-cli
-
nix-darwinに移したもの
- pinentry-mac
-
保留
- sleepwatcher
- 移したいのだがserviceの扱いがわからないのでどうしたらいいのやら
- mas
- app storeのアプリ自体をnix-darwinで管理できるみたいなのでそちらに移行したら削除できる
- gaze
- これ自体はnixpkgsに無いがほかのwatchコマンドでもいいよな…
- watchexecとかにしようかな
- sleepwatcher
-
git-now
- 別に使ってないんだけど便利そうなのでなにかに使いたい
-
logdy
- 別に使ってないんだけど便利そうなのでなにかに使いたい