Closed10

macOS 15 SequoiaのNixユーザー問題解消

ピン留めされたアイテム
kawarimidollkawarimidoll

まとめ:
Nixを再インストールするのが一番早い

kawarimidollkawarimidoll
❯ curl --proto '=https' --tlsv1.2 -sSf -L https://github.com/NixOS/nix/raw/master/scripts/sequoia-nixbld-user-migration.sh | bash -
Attempting to migrate _nixbld users.

Step 1: move existing _nixbld users out of the destination UID range.
Password:
   Temporarily moved _nixbld5 from uid 305 -> 31000
   Temporarily moved _nixbld6 from uid 306 -> 31001
   Temporarily moved _nixbld7 from uid 307 -> 31002
   Temporarily moved _nixbld8 from uid 308 -> 31003
   Temporarily moved _nixbld9 from uid 309 -> 31004
   Temporarily moved _nixbld10 from uid 310 -> 31005
   Temporarily moved _nixbld11 from uid 311 -> 31006
   Temporarily moved _nixbld12 from uid 312 -> 31007
   Temporarily moved _nixbld13 from uid 313 -> 31008
   Temporarily moved _nixbld14 from uid 314 -> 31009
   Temporarily moved _nixbld15 from uid 315 -> 31010
   Temporarily moved _nixbld16 from uid 316 -> 31011
   Temporarily moved _nixbld17 from uid 317 -> 31012
   Temporarily moved _nixbld18 from uid 318 -> 31013
   Temporarily moved _nixbld19 from uid 319 -> 31014
   Temporarily moved _nixbld20 from uid 320 -> 31015
   Temporarily moved _nixbld21 from uid 321 -> 31016
   Temporarily moved _nixbld22 from uid 322 -> 31017
   Temporarily moved _nixbld23 from uid 323 -> 31018
   Temporarily moved _nixbld24 from uid 324 -> 31019
   Temporarily moved _nixbld25 from uid 325 -> 31020
   Temporarily moved _nixbld26 from uid 326 -> 31021
   Temporarily moved _nixbld27 from uid 327 -> 31022
   Temporarily moved _nixbld28 from uid 328 -> 31023
   Temporarily moved _nixbld29 from uid 329 -> 31024
   Temporarily moved _nixbld30 from uid 330 -> 31025
   Temporarily moved _nixbld31 from uid 331 -> 31026
   Temporarily moved _nixbld32 from uid 332 -> 31027

Step 2: re-create missing early _nixbld# users.
      _nixbld1 was missing; created with uid: 351
      _nixbld2 was missing; created with uid: 352
      _nixbld3 was missing; created with uid: 353
      _nixbld4 was missing; created with uid: 354

Step 3: relocate remaining _nixbld# UIDs to 354+
      _nixbld5 migrated to uid: 355
      _nixbld6 migrated to uid: 356
      _nixbld7 migrated to uid: 357
      _nixbld8 migrated to uid: 358
      _nixbld9 migrated to uid: 359
      _nixbld10 migrated to uid: 360
      _nixbld11 migrated to uid: 361
      _nixbld12 migrated to uid: 362
      _nixbld13 migrated to uid: 363
      _nixbld14 migrated to uid: 364
      _nixbld15 migrated to uid: 365
      _nixbld16 migrated to uid: 366
      _nixbld17 migrated to uid: 367
      _nixbld18 migrated to uid: 368
      _nixbld19 migrated to uid: 369
      _nixbld20 migrated to uid: 370
      _nixbld21 migrated to uid: 371
      _nixbld22 migrated to uid: 372
      _nixbld23 migrated to uid: 373
      _nixbld24 migrated to uid: 374
      _nixbld25 migrated to uid: 375
      _nixbld26 migrated to uid: 376
      _nixbld27 migrated to uid: 377
      _nixbld28 migrated to uid: 378
      _nixbld29 migrated to uid: 379
      _nixbld30 migrated to uid: 380
      _nixbld31 migrated to uid: 381
      _nixbld32 migrated to uid: 382
Migrated 32 users. If you want to double-check, try:
dscl . list /Users UniqueID | grep _nixbld | sort -n -k2
kawarimidollkawarimidoll

home-managerの更新ビルドが時間かかりまくって終わらないのでnixを入れ直そう

❯ /nix/nix-installer uninstall
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Password:
`nix-darwin` installation detected, it must be removed before uninstalling Nix. Please refer to https://github.com/LnL7/nix-darwin#uninstalling for instructions how to uninstall `nix-darwin`.

先にnix-darwinの削除が必要

❯ nix --extra-experimental-features "nix-command flakes" run nix-darwin#darwin-uninstaller

Uninstalling nix-darwin, this will:

    - remove /Applications/Nix Apps symlink
    - cleanup static /etc files
    - disable and remove all launchd services managed by nix-darwin
    - restore daemon service from nix installer (only when this is a multi-user install)

Proceed? [y/n] y
user defaults...
setting up user launchd services...
setting up /Applications/Nix Apps...
setting up pam...
applying patches...
setting up /etc...
system defaults...
setting up launchd services...
removing service org.nixos.activate-system
removing service org.nixos.nix-daemon
removing service org.nixos.nix-gc
removing service org.nixos.nix-optimise
configuring networking...
configuring power...
setting up /Library/Fonts/Nix Fonts...
setting nvram variables...
NOTE: the /run symlink will be removed on reboot

NOTE: The /nix/var/nix/profiles/system* profiles still exist and won't be garbage collected.

Done!

これでnix自体を除去できる

❯ /nix/nix-installer uninstall
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Nix uninstall plan (v0.20.1)

Planner: macos

Configured settings:
* nix_build_user_id_base: 300

Planned actions:
* Unconfigure Nix daemon related settings with launchctl
* Delete file `/Library/LaunchDaemons/systems.determinate.nix-installer.nix-hook.plist`
* Remove the Nix configuration from zsh's non-login shells
* Unconfigure the shell profiles
* Remove the Nix configuration in `/etc/nix/nix.conf`
* Unset the default Nix profile
* Remove time machine exclusions
* Remove Nix users and group
* Remove the directory tree in `/nix`
* Remove the APFS volume `Nix Store` on `disk3`


Proceed? ([Y]es/[n]o/[e]xplain): e
Nix uninstall 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:
* Unconfigure Nix daemon related settings with launchctl
  Run `launchctl bootout /Library/LaunchDaemons/org.nixos.nix-daemon.plist`
* Delete file `/Library/LaunchDaemons/systems.determinate.nix-installer.nix-hook.plist`
  Delete file `/Library/LaunchDaemons/systems.determinate.nix-installer.nix-hook.plist`
* Remove the Nix configuration from zsh's non-login shells
  Update `/etc/zshenv` to no longer import Nix
* Unconfigure the shell profiles
  Update shell profiles to no longer import Nix
* Remove the Nix configuration in `/etc/nix/nix.conf`
  This file is read by the Nix daemon to set its configuration options at runtime.
* Unset the default Nix profile
* Remove time machine exclusions
* Remove Nix users and group
  The Nix daemon requires system users (and a group they share) which it can act as in order to build
  Delete group `nixbld` (GID 30000)
  Delete user `_nixbld1` (UID 301) in group nixbld (GID 30000)
  Delete user `_nixbld2` (UID 302) in group nixbld (GID 30000)
  Delete user `_nixbld3` (UID 303) in group nixbld (GID 30000)
  Delete user `_nixbld4` (UID 304) in group nixbld (GID 30000)
  Delete user `_nixbld5` (UID 305) in group nixbld (GID 30000)
  Delete user `_nixbld6` (UID 306) in group nixbld (GID 30000)
  Delete user `_nixbld7` (UID 307) in group nixbld (GID 30000)
  Delete user `_nixbld8` (UID 308) in group nixbld (GID 30000)
  Delete user `_nixbld9` (UID 309) in group nixbld (GID 30000)
  Delete user `_nixbld10` (UID 310) in group nixbld (GID 30000)
  Delete user `_nixbld11` (UID 311) in group nixbld (GID 30000)
  Delete user `_nixbld12` (UID 312) in group nixbld (GID 30000)
  Delete user `_nixbld13` (UID 313) in group nixbld (GID 30000)
  Delete user `_nixbld14` (UID 314) in group nixbld (GID 30000)
  Delete user `_nixbld15` (UID 315) in group nixbld (GID 30000)
  Delete user `_nixbld16` (UID 316) in group nixbld (GID 30000)
  Delete user `_nixbld17` (UID 317) in group nixbld (GID 30000)
  Delete user `_nixbld18` (UID 318) in group nixbld (GID 30000)
  Delete user `_nixbld19` (UID 319) in group nixbld (GID 30000)
  Delete user `_nixbld20` (UID 320) in group nixbld (GID 30000)
  Delete user `_nixbld21` (UID 321) in group nixbld (GID 30000)
  Delete user `_nixbld22` (UID 322) in group nixbld (GID 30000)
  Delete user `_nixbld23` (UID 323) in group nixbld (GID 30000)
  Delete user `_nixbld24` (UID 324) in group nixbld (GID 30000)
  Delete user `_nixbld25` (UID 325) in group nixbld (GID 30000)
  Delete user `_nixbld26` (UID 326) in group nixbld (GID 30000)
  Delete user `_nixbld27` (UID 327) in group nixbld (GID 30000)
  Delete user `_nixbld28` (UID 328) in group nixbld (GID 30000)
  Delete user `_nixbld29` (UID 329) in group nixbld (GID 30000)
  Delete user `_nixbld30` (UID 330) in group nixbld (GID 30000)
  Delete user `_nixbld31` (UID 331) in group nixbld (GID 30000)
  Delete user `_nixbld32` (UID 332) in group nixbld (GID 30000)
  Remove user `_nixbld1` (UID 301) from group nixbld (GID 30000)
  Remove user `_nixbld2` (UID 302) from group nixbld (GID 30000)
  Remove user `_nixbld3` (UID 303) from group nixbld (GID 30000)
  Remove user `_nixbld4` (UID 304) from group nixbld (GID 30000)
  Remove user `_nixbld5` (UID 305) from group nixbld (GID 30000)
  Remove user `_nixbld6` (UID 306) from group nixbld (GID 30000)
  Remove user `_nixbld7` (UID 307) from group nixbld (GID 30000)
  Remove user `_nixbld8` (UID 308) from group nixbld (GID 30000)
  Remove user `_nixbld9` (UID 309) from group nixbld (GID 30000)
  Remove user `_nixbld10` (UID 310) from group nixbld (GID 30000)
  Remove user `_nixbld11` (UID 311) from group nixbld (GID 30000)
  Remove user `_nixbld12` (UID 312) from group nixbld (GID 30000)
  Remove user `_nixbld13` (UID 313) from group nixbld (GID 30000)
  Remove user `_nixbld14` (UID 314) from group nixbld (GID 30000)
  Remove user `_nixbld15` (UID 315) from group nixbld (GID 30000)
  Remove user `_nixbld16` (UID 316) from group nixbld (GID 30000)
  Remove user `_nixbld17` (UID 317) from group nixbld (GID 30000)
  Remove user `_nixbld18` (UID 318) from group nixbld (GID 30000)
  Remove user `_nixbld19` (UID 319) from group nixbld (GID 30000)
  Remove user `_nixbld20` (UID 320) from group nixbld (GID 30000)
  Remove user `_nixbld21` (UID 321) from group nixbld (GID 30000)
  Remove user `_nixbld22` (UID 322) from group nixbld (GID 30000)
  Remove user `_nixbld23` (UID 323) from group nixbld (GID 30000)
  Remove user `_nixbld24` (UID 324) from group nixbld (GID 30000)
  Remove user `_nixbld25` (UID 325) from group nixbld (GID 30000)
  Remove user `_nixbld26` (UID 326) from group nixbld (GID 30000)
  Remove user `_nixbld27` (UID 327) from group nixbld (GID 30000)
  Remove user `_nixbld28` (UID 328) from group nixbld (GID 30000)
  Remove user `_nixbld29` (UID 329) from group nixbld (GID 30000)
  Remove user `_nixbld30` (UID 330) from group nixbld (GID 30000)
  Remove user `_nixbld31` (UID 331) from group nixbld (GID 30000)
  Remove user `_nixbld32` (UID 332) from group nixbld (GID 30000)
* Remove the directory tree in `/nix`
  Nix and the Nix daemon require a Nix Store, which will be stored at `/nix`
  Removes: `/nix/var/nix/daemon-socket`, `/nix/var/nix/userpool`, `/nix/var/nix/temproots`, `/nix/var/nix/profiles/per-user`, `/nix/var/nix/profiles`, `/nix/var/nix/gcroots/per-user`, `/nix/var/nix/gcroots`, `/nix/var/nix/db`, `/nix/var/nix`, `/nix/var/log/nix/drvs`, `/nix/var/log/nix`, `/nix/var/log`, `/nix/var`
* Remove the APFS volume `Nix Store` on `disk3`
  Create or insert file `/etc/synthetic.conf`
  Create objects defined in `/etc/synthetic.conf`
  Unmount the `Nix Store` APFS volume
  Create an APFS volume on `disk3` named `Nix Store`
  Update existing entry for the APFS volume `Nix Store` to `/etc/fstab`
  Encrypt volume `Nix Store` on disk `disk3`
  Create a `launchctl` plist to mount the APFS volume `/Library/LaunchDaemons/org.nixos.darwin-store.plist`
  Bootstrap the `org.nixos.darwin-store` service via `launchctl bootstrap system /Library/LaunchDaemons/org.nixos.darwin-store.plist`
  Enable ownership on `/nix`


Proceed? ([Y]es/[n]o): Y
 INFO Revert: Remove directory `/nix/temp-install-dir`
 INFO Revert: Configure Nix daemon related settings with launchctl
 INFO Revert: Create a `launchctl` plist to put Nix into your PATH
 INFO Revert: Configuring zsh to support using Nix in non-interactive shells
 INFO Revert: Configure Nix
 INFO Revert: Configure Time Machine exclusions
 INFO Revert: Create build users (UID 301-332) and group (GID 30000)
 INFO Revert: Provision Nix
 INFO Revert: Create an encrypted APFS volume `Nix Store` for Nix on `disk3` and add it to `/etc/fstab` mounting on `/nix`
ERROR Uninstallation complete, some errors encountered
Error:
   0: Error reverting
   0: Action `create_apfs_volume` errored
      Failed to execute command with status 1 `"/usr/sbin/diskutil" "apfs" "deleteVolume" "Nix Store"`, stdout: Started APFS operation
      Deleting APFS Volume from its APFS Container
      Unmounting disk3s7
      The volume "Nix Store" on disk3s7 couldn't be unmounted because it is in use by process 0 (kernel)

      stderr: Error: -69888: Couldn't unmount disk


   0:

Location:
   src/cli/subcommand/uninstall.rs:192

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Consider reporting this error using this URL: https://github.com/DeterminateSystems/nix-installer/issues/new?title=%3Cautogenerated-issue%3E&body=%23%23+Error%0A%60%60%60%0AError%3A+%0A+++0%3A+Error+reverting%0A+++0%3A+Action+%60create_apfs_volume%60+errored%0A++++++Failed+to+execute+command+with+status+1+%60%22%2Fusr%2Fsbin%2Fdiskutil%22+%22apfs%22+%22deleteVolume%22+%22Nix+Store%22%60%2C+stdout%3A+Started+APFS+operation%0A++++++Deleting+APFS+Volume+from+its+APFS+Container%0A++++++Unmounting+disk3s7%0A++++++The+volume+%22Nix+Store%22+on+disk3s7+couldn%27t+be+unmounted+because+it+is+in+use+by+process+0+%28kernel%29%0A%0A++++++stderr%3A+Error%3A+-69888%3A+Couldn%27t+unmount+disk%0A%0A%0A%0A%60%60%60%0A%0A%23%23+Metadata%0A%7Ckey%7Cvalue%7C%0A%7C--%7C--%7C%0A%7C**version**%7C0.20.1%7C%0A%7C**os**%7Cmacos%7C%0A%7C**arch**%7Caarch64%7C%0A

止まった

https://github.com/DeterminateSystems/nix-installer/issues/1267

「再起動して再実行してください」とのこと

kawarimidollkawarimidoll

あっ実行ログつけていたのに未送信だったのか消えている…

kawarimidollkawarimidoll

ここまでのあらすじ:

これを実行してnix-darwinを消し

nix --extra-experimental-features "nix-command flakes" run nix-darwin#nix-uninstaller

これを実行してnixを消そうとし

/nix/nix-installer uninstall

しかしボリュームを消せず

https://github.com/DeterminateSystems/nix-installer/issues/1267

再起動してもう一度uninstallしようとしたが…すでに/nix/nix-installerが消えている

kawarimidollkawarimidoll

ということで再インストール

https://determinate.systems/nix-installer/

% curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --determinate
info: downloading installer https://install.determinate.systems/nix/tag/v0.27.1/nix-installer-aarch64-darwin
 INFO nix-installer v0.27.1
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Password:
 INFO nix-installer v0.27.1
Error:
   0: Planner error
   1: Error executing action
   2: Action `encrypt_apfs_volume` errored
   3: The keychain lacks a password for the already existing "Nix Store" volume on disk `disk3`, consider removing the volume with `diskutil apfs deleteVolume "Nix Store"` (if you receive error -69888, you may need to run `sudo launchctl bootout system/org.nixos.darwin-store` and `sudo launchctl bootout system/org.nixos.nix-daemon` first)

Location:
   src/cli/subcommand/install.rs:200

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Consider reporting this error using this URL: ...

だめ

前掲のQiitaの記事にあった

おそらくnix store volumeの初期化に失敗するので再起動して手動でDisk Utilityからnix storeのvolumeを削除してください。

とはこれのことか…

ChatGPTに消し方を聞いて実行

 % sudo diskutil apfs deleteVolume "Nix Store"
Started APFS operation
Deleting APFS Volume from its APFS Container
Unmounting disk3s7
Erasing any xART session referenced by B8DF9192-900F-418E-97DE-28061CA51783
Deleting Volume
Removing any Preboot and Recovery Directories
Finished APFS operation

よし

% curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --determinate
info: downloading installer https://install.determinate.systems/nix/tag/v0.27.1/nix-installer-aarch64-darwin
 INFO nix-installer v0.27.1
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
 INFO nix-installer v0.27.1
Bad request.
Could not find service "systems.determinate.nix-store" in domain for system
Nix install plan (v0.27.1)
Planner: macos

Configured settings:
* determinate_nix: true

Planned actions:
* Install Determinate Nixd
* Create an encrypted APFS volume `Nix Store` for Nix on `disk3` and add it to `/etc/fstab` mounting on `/nix`
* Extract the bundled Nix (originally from /nix/store/m6z13hyfngsxklxr0bzkk0as8ns1p6ma-nix-binary-tarball-2.24.10/nix-2.24.10-aarch64-darwin.tar.xz)
* Create a directory tree in `/nix`
* Move the downloaded Nix into `/nix`
* Create build users (UID 351-382) and group (GID 350)
* 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 the Determinate Nix daemon
* Remove directory `/nix/temp-install-dir`


Proceed? ([Y]es/[n]o/[e]xplain):  y
Error:
   0: stream did not contain valid UTF-8

Location:
   src/cli/interaction.rs:88

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Consider reporting this error using this URL: ...

ウワーッまた止まった

良くわからんのでとりあえず再実行する…

% curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --determinate
info: downloading installer https://install.determinate.systems/nix/tag/v0.27.1/nix-installer-aarch64-darwin
 INFO nix-installer v0.27.1
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
 INFO nix-installer v0.27.1
Bad request.
Could not find service "systems.determinate.nix-store" in domain for system
Nix install plan (v0.27.1)
Planner: macos

Configured settings:
* determinate_nix: true

Planned actions:
* Install Determinate Nixd
* Create an encrypted APFS volume `Nix Store` for Nix on `disk3` and add it to `/etc/fstab` mounting on `/nix`
* Extract the bundled Nix (originally from /nix/store/m6z13hyfngsxklxr0bzkk0as8ns1p6ma-nix-binary-tarball-2.24.10/nix-2.24.10-aarch64-darwin.tar.xz)
* Create a directory tree in `/nix`
* Move the downloaded Nix into `/nix`
* Create build users (UID 351-382) and group (GID 350)
* 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 the Determinate Nix daemon
* Remove directory `/nix/temp-install-dir`


Proceed? ([Y]es/[n]o/[e]xplain): y
 INFO Step: Install Determinate Nixd
 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 351-382) and group (GID 350)
 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 the Determinate Nix daemon
 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`

お?行けたぽい

kawarimidollkawarimidoll

これいきなり nix run .#updateやっていいのだろうか
→ いけそう…?

ものすごい時間かかった

Starting Home Manager activation
The previous generation number and path are in conflict! These
must be either both empty or both set but are now set to

    '54' and ''

If you don't mind losing previous profile generations then
the easiest solution is probably to run

   rm /Users/kawarimidoll/.local/state/nix/profiles/home-manager*
   rm /Users/kawarimidoll/.local/state/home-manager/gcroots/current-home

and trying home-manager switch again. Good luck!

うーーーん 過去世代を吹き飛ばすか…吹き飛ばそうか よし

% rm /Users/kawarimidoll/.local/state/nix/profiles/home-manager*
% rm /Users/kawarimidoll/.local/state/home-manager/gcroots/current-home
% nix run .#update

新時代ktkr

Updating flake...
warning: Git tree '/Users/kawarimidoll/dotfiles' is dirty
Updating home-manager...
warning: Git tree '/Users/kawarimidoll/dotfiles' is dirty
Starting Home Manager activation
Activating checkFilesChanged
Activating checkLaunchAgents
Activating checkLinkTargets
Activating writeBoundary
Activating installPackages
installing 'home-manager-path'
warning: 'https://cache.flakehub.com' does not appear to be a binary cache
building '/nix/store/***-user-environment.drv'...
Activating linkGeneration
Creating profile generation 1
Creating home file links in /Users/kawarimidoll
Activating onFilesChange
Activating setupLaunchAgents
warning: Git tree '/Users/kawarimidoll/dotfiles' is dirty
warning: 'https://cache.flakehub.com' does not appear to be a binary cache

There are 100 unread and relevant news items.
Read them by running the command "home-manager news".

あーでも今度はnix-darwinの方で止まってしまったぞ

Updating nix-darwin...
warning: 'https://cache.flakehub.com' does not appear to be a binary cache
building the system configuration...
warning: Git tree '/Users/kawarimidoll/dotfiles' is dirty
error:
       … while evaluating the attribute 'value'
         at /nix/store/***-source/lib/modules.nix:816:9:
          815|     in warnDeprecation opt //
          816|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          817|         inherit (res.defsFinal') highestPrio;

       … while evaluating the option `system.build':

       … while evaluating the attribute 'mergedValue'
         at /nix/store/***-source/lib/modules.nix:851:5:
          850|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          851|     mergedValue =
             |     ^
          852|       if isDefined then

       … while evaluating definitions from `/nix/store/***-source/modules/system':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error:
       Failed assertions:
       - The `system.stateVersion` option is not defined in your
       nix-darwin configuration. The value is used to conditionalize
       backwards‐incompatible changes in default settings. You should
       usually set this once when installing nix-darwin on a new system
       and then never change it (at least without reading all the relevant
       entries in the changelog using `darwin-rebuild changelog`).

       You can use the current value for new installations as follows:

           system.stateVersion = 5;

ChatGPT訳

エラー:検証失敗
system.stateVersion オプションがあなたの nix-darwin 設定に定義されていません。この値は、デフォルト設定の後方互換性のない変更を条件付きで適用するために使用されます。通常、nix-darwin を新しいシステムにインストールする際に一度設定し、その後は変更しないべきです(少なくとも、darwin-rebuild changelog を使用して変更履歴をすべて確認してから変更するべきです)。
新しいインストールの場合は、次のように現在の値を使用できます:
system.stateVersion = 5;

kawarimidollkawarimidoll

stateVersionを設定したのだが…うーんまだだめか

% nix run .#update-darwin
warning: Git tree '/Users/kawarimidoll/dotfiles' is dirty
Updating flake...
warning: Git tree '/Users/kawarimidoll/dotfiles' is dirty
Updating nix-darwin...
building the system configuration...
warning: Git tree '/Users/kawarimidoll/dotfiles' is dirty
warning: 'https://cache.flakehub.com' does not appear to be a binary cache
Password:
setting up /run via /etc/synthetic.conf...
error: Unexpected files in /etc, aborting activation
The following files have unrecognized content and would be overwritten:

  /etc/nix/nix.conf

Please check there is nothing critical in these files, rename them by adding .before-nix-darwin to the end, and then try again.

どうやらこれだな

https://github.com/LnL7/nix-darwin/issues/149#issuecomment-2442971641

ChatGPT訳

こんにちは。インストール時に --determinate オプションを選択したようですね。このオプションを選ぶと、Determinate Systems のインストーラーが、彼らが修正した下流の「Determinate Nix」ディストリビューションをインストールします。コメントに「このファイルを変更しないでください!このファイルは置き換えられます!」と書かれていることから、追加された独自のデーモンが Nix の設定を変更している可能性があり、そのため nix-darwin がそれを上書きしようとすると問題が発生するかもしれません。Determinate Systems には nix-darwin 用のモジュールがありますが、それも内部を独自に変更しているため、いつでも壊れる可能性があります。
そのため、Determinate Systems のソフトウェアに関するサポートを受けるか、--determinate オプションを使用せずに再インストールすることをお勧めします。Determinate Systems のインストーラーを使って通常の Nix をインストールすれば、nix-darwin と問題なく動作するはずです。(はい、用語が少し混乱を招くのは残念ですが。)

確かに過去記事の時点では--determinateをつけずにインストールしていた

https://zenn.dev/kawarimidoll/articles/0a4ec8bab8a8ba

ということで再度アンインストール → --determinateをつけずにインストール → nix run .#update

kawarimidollkawarimidoll

ようやく通った〜〜すごい時間かかったわ

% nix run .#update
warning: Git tree '/Users/kawarimidoll/dotfiles' is dirty
Updating flake...
warning: Git tree '/Users/kawarimidoll/dotfiles' is dirty
Updating home-manager...
warning: Git tree '/Users/kawarimidoll/dotfiles' is dirty
[5/26/41 built, 541 copied (5860.2/5862.2 MiB), 1434.1 MiB DL] building ncurses-6.4.20221231 (installPhase): make[1]: ディレクトリ [5/26/41 built, 541 copied (5860.2/5862.2 MiB), 1434.1 MiB DL] building ncurses-6.4.20221231 (installPhase): make[1]: ディレクトリ [5/26/41 built, 541 copied (5860.2/5862.2 MiB), 1434.1 MiB DL] building ncurses-6.4.20221231 (installPhase): make[1]: ディレクトリ [5/26/41 built, 541 copied (5860.2/5862.2 MiB), 1434.1 MiB DL] building ncurses-6.4.20221231 (installPhase): make[1]: ディレクトリ [3/31/41 built, 541 copied (5860.2/5862.2 MiB), 1434.1 MiB DL] building vim-latest (buildPhase): 1318 個の翻訳メッセージ2837 個の翻
[3/31/41 built, 541 copied (5860.2/5862.2 MiB), 1434.1 MiB DL] building vim-latest (buildPhase): make[2]: ディレクトリ '/private/tm[3/31/41 built, 541 copied (5860.2/5862.2 MiB), 1434.1 MiB DL] building vim-latest (buildPhase): make[2]: ディレクトリ '/private/tm[3/31/41 built, 541 copied (5860.2/5862.2 MiB), 1434.1 MiB DL] building vim-latest (buildPhase): make[2]: ディレクトリ '/private/tm[3/31/41 built, 541 copied (5860.2/5862.2 MiB), 1434.1 MiB DL] building vim-latest (installPhase): make[2]: ディレクトリ '/private/[3/31/41 built, 541 copied (5860.2/5862.2 MiB), 1434.1 MiB DL] building vim-latest (installPhase): make[2]: ディレクトリ '/private/[3/31/41 built, 541 copied (5860.2/5862.2 MiB), 1434.1 MiB DL] building vim-latest (installPhase): make[2]: ディレクトリ '/private/Starting Home Manager activation
Activating checkFilesChanged
Activating checkLaunchAgents
Activating checkLinkTargets
Activating writeBoundary
Activating installPackages
installing 'home-manager-path'
building '/nix/store/kndhgrfw7zx02rxnhal8acd2ndjacjsg-user-environment.drv'...
Activating linkGeneration
Cleaning up orphan links from /Users/kawarimidoll
No change so reusing latest profile generation 1
Creating home file links in /Users/kawarimidoll
Activating onFilesChange
Activating setupLaunchAgents
warning: Git tree '/Users/kawarimidoll/dotfiles' is dirty

There are 100 unread and relevant news items.
Read them by running the command "home-manager news".

Updating nix-darwin...
building the system configuration...
warning: Git tree '/Users/kawarimidoll/dotfiles' is dirty
Password:
user defaults...
restarting Dock...
setting up user launchd services...
Homebrew bundle...
==> Downloading https://formulae.brew.sh/api/formula.jws.json
############################################################################################################################ 100.0%
Using pinentry-mac
Homebrew Bundle complete! 1 Brewfile dependency now installed.
Password:
setting up /Applications/Nix Apps...
setting up pam...
applying patches...
setting up /etc...
system defaults...
setting up launchd services...
creating service org.nixos.activate-system
reloading service org.nixos.nix-daemon
creating service org.nixos.nix-gc
creating service org.nixos.nix-optimise
reloading nix-daemon...
waiting for nix-daemon
waiting for nix-daemon
configuring networking...
configuring power...
setting up /Library/Fonts/Nix Fonts...
setting nvram variables...
Update complete!
このスクラップは13日前にクローズされました