m1 mac 式年遷宮 ver.2025
ghqのバックアップどこに移動させよう
USBメモリどこやったっけ?
一昨年のやつ
仕事のために最低限必要なソフトウェア
- jetbrains-toolbox
- Android Studio
- karabiner-elements
- XCode
- notion
- notion-calendar
- keepassxc
パッケージマネージャーはnixを試そうと思ってる
- home-manager
- nix-darwin
が必要になるらしい
見てる
usbメモリ探そ
部屋の掃除を始めてしまった。。
結局USBメモリは見つからなかったのでコンビニでSDカード買ってきた
SDカードに移している者たち
- リカバリーコード
- Rectangleのコンフィグ
- エクスポートを自動化したい
- UserDefaultsに出力してるだけってあったからそっちから引っこ抜く方法を考えればいいんかな
- scripts
- git管理するまでもない書き捨てスクリプトたち
- AndroidStudioProjects
こんなもんだっけか?
dotfilesの更新終わり
業務リポジトリに溜め込まれたスタッシュどうしよう
スタッシュ47個は流石に多いってw
古い記憶すぎて思い出す気にもなれないから、もう1回やり直してもいいよね
リポジトリ整理終わり
じゃあいよいよOSクリーンインストールに入ろうかな
今後は1ヶ月に1回のペースでクリーンインストールできるようにしていきたい
SDカードに移すべきファイルがどれかっていうのを探すのだるいから$HOME/local
に全部突っ込むようにしようかな
そうすればバックアップ作業はこのディレクトリをガッと持っていくだけで済むもんね
システム設定>一般>転送またはリセット>すべてのコンテンツと設定を消去
を実行
まずはWiFiを繋げる
再起動
オンボーディング
日本語
日本
またWiFiに繋げる
Apple IDにログイン
コンピュータアカウント作成
位置情報の許可を求められた
Apple Payにカード追加してみた
Safariでzennを開いて今これを書いている
nixをインストールする
sh <(curl -L https://nixos.org/nix/install)
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 [351..382]) and groups (gid 350) 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?
[y/n]
error: failed to bootstrap /nix
If you enabled FileVault after booting, this is likely a known issue
with macOS that you'll have to reboot to fix. If you didn't enable FV,
though, please open an issue describing how the system that you see
this error on was set up.
We'd love to help if you need it.
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
FileVaultで怒られちゃった
再起動したら動くようになった
余計なもののない美しい世界
nix-shell経由でneofetchを動かしてみる
インストールが長い。。
nix-shell -p neofetch --run neofetch
なんかすごい勢いでstore内のファイルが捨てられた
nix-store --gc
nixの設定を置く場所を決める
君に決めた
mkdir nix
cd nix
pwd
# $HOME/nix
おもむろにnix-darwinをインストールする
nix flake init -t nix-darwin --extra-experimental-features "nix-command flakes"
-
--extra-experimental-features "nix-command flakes"
ってなんだろう?
ちょこっとだけいじった
{
description = "mikan m1 mac-book-pro nix-darwin system flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, nix-darwin, nixpkgs }:
let
configuration = { pkgs, ... }: {
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages =
[ pkgs.vim
];
# Necessary for using flakes on this system.
nix.settings.experimental-features = "nix-command flakes";
# Enable alternative shell support in nix-darwin.
# programs.fish.enable = true;
# Set Git commit hash for darwin-version.
system.configurationRevision = self.rev or self.dirtyRev or null;
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 5;
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin";
};
in
{
# Build darwin flake using:
# $ darwin-rebuild build --flake .#mikan
darwinConfigurations."mikan" = nix-darwin.lib.darwinSystem {
modules = [ configuration ];
};
};
}
nix-darwinをいざインストール
nix run nix-darwin --extra-experimental-features "nix-command flakes" -- switch --flake ~/nix#mikan
nixパッケージの検索
from terminal
nix search nixpkgs <name>
from browser
flake.nixの変更を適用
darwin-rebuild switch --flake ~/nix#mikan
wezterm入れてみるか
nixpkgs経由でGUIを入れるとspotlight検索に引っかからない位置に置かれてしまう
/Application/Nix\ App/...
眠い寝る
まだ仕事できる環境にはなってないので明日早起きしてから作業する
weztermのインストールを試みる
nixpkgs経由でインストールしたやつは豆腐になってる。。
設定変えれば直るらしいけどめんどくさいな
homebrewを使ってみよう
inputsに追加
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
ouputsに追加
modules = [
configuration
nix-homebrew.darwinModules.nix-homebrew
{
nix-home-brew {
enable = true;
enableRosetta = true;
user = "mikan";
autoMigrate = true;
};
}
];
なぜかここに作られた
which brew
# /opt/homebrew/bin/brew
Rosettaのインストールを求められた
softwareupdate --install-rosetta
Command Line Toolsのインストールを求められた
xcode-select --install
一旦仕事に必要な道具を準備してからまた夜クリーンインストールしよう
- gh
- ghq
- slack
- jetbrains-tool-box
- arc
- keepassxc
nix-installerの方が便利らしいから次はこれ使おう
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
それではもう一度消してみる
homebrewで管理してたやつは一通り入れた
skkの辞書ってどうやって入れたんだっけ?
rustを入れよう思う
nixpkgsから入れるよりoverlayを経由した方がいいらしい
masonでイントールするLSPはものによっては前提条件を求められるからめんどくさいな
ghq getをインストールスクリプトに入れたいんだけどどう書こう?
ghq listの結果をgit管理することにした
やっぱ怖いからgit管理に入れるのはやめた
~/localに置くことにする
uninstall
homebrew
brew uninstall --force $(brew list)
nix-darwin
nix --extra-experimental-features "nix-command flakes" run nix-darwin#darwin-uninstaller --no-confirm
nix store
nix-store --gc
nix
/nix/nix-installer uninstall --no-confirm
git cloneを早くするためにshallow clone
# 速度重視
git clone --depth 1 <repo>
# 普段
git clone --depth 100
git fetch --depth <number>
git fetch --unshallow
gitリポジトリをshallow cloneしたらfetchできてもswitch出来なくなった
これしたら動くようになった
git remote set-branches origin '*'
git approveコマンドが失われてしまった
あれってgit管理してなかったっけ?
思い出したscriptディレクトリに置いてたんだ
git-hogeって名前の実行可能なスクリプトファイルにパスを通せばgit hoge
でできるのを利用してたんだった
シェルスクリプトの引数のどれがどれか一生覚えられる気がしない
IdeaVim入れたらなんか言われた
ApplePressAndHoldEnabledが0に設定されてしまうのか
覚えておこう
nixに慣れてきたので本格的に入門してみようと思う
今年の式年遷宮はこれにて終了