Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install tools to use hugo with Nix to avoid unstable snap #279

Merged
merged 2 commits into from
Apr 4, 2024

Conversation

kachick
Copy link
Collaborator

@kachick kachick commented Apr 4, 2024

Fixes #276

Nix を使うと Nix 自体のセットアップに掛かるところでオーバーヘッドかかったりもしがちなんですが、今回は snap を使った dart-sass のインストールが遅すぎるということでトータルで見ると10倍近く高速化しました。
なるべく既存コードへ差異がでないように差し込んだのでメンテナンスコストは大幅に上がったりしないんじゃないかなと思うんですけどどうでしょう?
(他には brew を使ってsassいれるとかも有りそう。試しては居ないです)

Before

Total 7.5~12 minutes

image

image

After

Total 1.3~1.5 minutes

image

Summary by CodeRabbit

  • 新機能
    • edge-pkgs.dprintをパッケージリストに追加しました。
    • 特定の設定を持つhugo-nixの新しいエントリをappsセクションに含めるように変更しました。

Copy link

coderabbitai bot commented Apr 4, 2024

Walkthrough

この変更は、.github/workflows/generate_site_and_deploy.yamlファイルのワークフローステップの大幅な変更を含んでいます。Hugo CLIとDart SassのインストールをNixベースのアクションに置き換え、キャッシュキーを調整し、Node.js依存関係のインストールをNixを使用するように更新し、ビルドコマンドをNixを介してHugoを実行するように変更しました。

flake.nixファイルでは、edge-pkgs.dprintをパッケージリストに追加し、appsセクションにhugo-nixという新しいエントリーを特定の設定で追加しました。

Changes

ファイル 変更の概要
.github/workflows/generate_site_and_deploy.yaml ワークフローステップの大幅な変更
flake.nix edge-pkgs.dprintを追加
appsセクションにhugo-nixの新規エントリーを追加

Assessment against linked issues

Objective Addressed Explanation
sudo snap install dart-sassがデプロイ時に時間がかかる 直接的な解決策は提供されていませんが、関連する変更がある可能性があります。

🐰🌼📜✨

変わりゆくコードの中で

新たな道を切り拓く

長い待ち時間にさよならを

速さと効率の新時代へ

🚀🌟🐇💫

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e6e0f51 and bba7291.
Files selected for processing (2)
  • .github/workflows/generate_site_and_deploy.yaml (1 hunks)
  • flake.nix (1 hunks)
Additional comments not posted (5)
flake.nix (2)

33-33: edge-pkgs.dprintの追加は良い改善です。


41-57: hugo-nixエントリーの追加は、デプロイメントプロセスの改善に貢献する良い変更です。パフォーマンスの向上が期待されます。

.github/workflows/generate_site_and_deploy.yaml (3)

31-34: キャッシュキーの更新は、Nixベースのビルドプロセスに適応するための適切な変更です。


40-40: Node.js依存関係をNixを通じてインストールする変更は、依存関係の管理を改善します。


48-48: HugoをNixを通じて実行する変更は、ビルドプロセスの一貫性と再現性を向上させます。

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between bba7291 and a417e55.
Files selected for processing (1)
  • .github/workflows/generate_site_and_deploy.yaml (1 hunks)
Additional comments not posted (4)
.github/workflows/generate_site_and_deploy.yaml (4)

31-33: キャッシュキーの更新を行ってください。これにより、Nixのフレーク機能を利用して依存関係のキャッシュをより効率的に管理できます。


37-37: DeterminateSystems/nix-installer-action@v10を使用してNixをセットアップしてください。これにより、ビルドプロセス全体がNixによって管理され、依存関係の解決が容易になります。


42-42: Node.jsの依存関係をインストールするためにnix develop --command npm ciを使用してください。これにより、Nixの環境内で依存関係が正確に解決され、プロジェクトの再現性が向上します。


50-50: Hugoをビルドするためにnix run .#hugo-nix -- --panicOnWarningコマンドを使用してください。これにより、Nixによって管理される環境内でHugoが実行され、ビルドプロセスの一貫性と再現性が保証されます。

@kachick kachick requested a review from pankona April 4, 2024 10:55
Copy link
Owner

@pankona pankona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

速くなったならよし

@pankona pankona merged commit f457208 into main Apr 4, 2024
7 checks passed
@pankona pankona deleted the hugo-build-with-nix branch April 4, 2024 11:05
@kachick
Copy link
Collaborator Author

kachick commented Apr 4, 2024

Azs!

なんか良くなかったら戻しましょう!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sudo snap install dart-sass takes long time in deploy
2 participants