Upgrade to Pro — share decks privately, control downloads, hide ads and more …

dotfiles について話したい #湘なんか

dotfiles について話したい #湘なんか

湘.なんか #1 - connpass
https://shonanpm.connpass.com/event/321325/ で話した時の資料です。

すてにゃん

August 24, 2024
Tweet

More Decks by すてにゃん

Other Decks in Programming

Transcript

  1. ͓͞Β͍ - dot fi les ͱ͸Կ͔ • .gitcon fi g

    ͱ͔ .bashrc ͱ͔ .vimrc ͱ͔ɺʮdotʯͰ࢝·ΔઃఆϑΝΠ ϧ܈ͷ͜ͱΛ·ͱΊͯʮdot fi lesʯͱݺͿ • ࣗ෼ͷखݩ؀ڥͷηοτΞοϓ΍ɺ։ൃνʔϜͷ։ൃ؀ڥηοτΞο ϓͳͲͷͨΊʹ͜͏͍͏ઃఆϑΝΠϧΛ؅ཧɾڞ༗͢Δͱศར
  2. GitHub ʹ stefafafan/dot fi les Λ࡞੒ • https://github.com/stefafafan/dot fi les

    • Ҏલ·Ͱ gitcon fi g ͔͠ஔ͍ͯͳ͔͚ͬͨͲɺ΍ͬͱ৭ʑى͖࢝Ί ͨͷ͕͜͜Ұिؒ • dot fi lesୡਓͷΈͳ͞Μ͔Β஌ݟΛಘ͍ͨʂ • ʮ͜Ε͕ࢲͷdot fi lesͰ͢ʯͱXʹϙετ͍ͯͩ͘͠͞
  3. ͦ͏͍͑͹dot fi lesͷ؅ཧํ๏͸Ͳ͏͢Ε͹ • ࢲ͸ https://www.chezmoi.io/ Λ࢖͍࢝Ίͨ • ಡΈํ͸ shay-moi

    • Go੡ɺγϯάϧόΠφϦͷπʔϧ • dot fi les͸γϯϘϦοΫϦϯΫͰ͸ͳ͘ϑΝΠϧͱͯ͠؅ཧ
  4. chezmoi ͷ࢖͍ํ - ηοτΞοϓ • chezmoi init • chezmoi add

    ~/.bashrc • chezmoi cd && git add . && git commit -m “foobar” && git push • →खݩͷ ~/.bashrc ΛpushͰ͖ͨ
  5. chezmoi ͷ࢖͍ํ - ଞϚγϯ΁ͷద༻ • sh -c "$(curl -fsLS get.chezmoi.io)"

    -- init --apply $GITHUB_USERNAME • chezmoi ΠϯετʔϧࡁΈͷ৔߹ • chezmoi init —apply $GITHUB_USERNAME • ݸਓతʹ͸ηοτΞοϓ࣌ʹ get.chezmoi.io ͷΑ͏ͳυϝΠϯΛ࢖͏ ͷ͕Ͳ͜·Ͱ৴༻Ͱ͖Δͷ͔एׯෆ҆ͳؾ΋͢Δ
  6. Homebrewύοέʔδͷ؅ཧ • Brew fi le Λ༻ҙ͢Ε͹ϚγϯΛލ͍Ͱ͍͍ײ͡ʹ؅ཧ͠΍͍͢ • ࢀߟ: Brew fi

    le Ͱ Homebrew ͷϥΠϒϥϦΛ؅ཧ͠Α͏ʂ https:// kakakakakku.hatenablog.com/entry/2020/09/17/124653
  7. Brew fi le ͷ࢖͍ํ • brew bundle dump • →

    Brew fi le͕Ͱ͖ΔͷͰத਎Λద౰ʹௐ੔ͯ͠ίϛοτ • ଞϚγϯͰ brew bundle • Brew fi leʹ͋Δύοέʔδ͕Πϯετʔϧ͞ΕΔ • https://github.com/stefafafan/dot fi les/blob/main/Brew fi le
  8. ػີ৘ใ͸Ͳ͏͢Δʁ - chezmoiฤ • chezmoi͸͞·͟·ͳPassword managerͱͷ࿈ܞʹରԠ͍ͯ͠Δ • https://www.chezmoi.io/user-guide/password-managers/ • ྫ͑͹

    1Password ͷ CLI ͔Β伴ͷ஋Λऔಘ͢ΔɺΈ͍ͨͳ͜ͱ͕Ͱ͖Δ • ࢀߟ: https://zenn.dev/ryo_kawamata/articles/introduce- chezmoi#1passwordΛར༻ͨ͠ηΩϡΞͳ؅ཧ • AWS Secrets Manager, MacOSͷKeychainͳͲʹ΋ରԠ͍ͯ͠·͢