Skip to content

refactor(nix): migrate from flake-utils to flake-parts#250

Merged
ryoppippi merged 4 commits intomainfrom
refactor/migrate-flake-utils-to-flake-parts
Dec 16, 2025
Merged

refactor(nix): migrate from flake-utils to flake-parts#250
ryoppippi merged 4 commits intomainfrom
refactor/migrate-flake-utils-to-flake-parts

Conversation

@ryoppippi
Copy link
Copy Markdown
Contributor

@ryoppippi ryoppippi commented Dec 15, 2025

Summary

Migrates the Nix flake configuration from flake-utils to flake-parts for improved modularity and type safety.

What Changed

  • Replaced flake-utils input with flake-parts
  • Refactored outputs to use mkFlake with perSystem pattern
  • Explicitly declared supported systems: x86_64-linux, aarch64-linux, aarch64-darwin
  • Removed x86_64-darwin support (no longer needed)

Why

flake-parts provides several advantages over flake-utils:

  • Uses NixOS module system pattern for better composability
  • Type-safe options with improved error messages
  • Support for advanced features like partitions and flakeModules
  • More maintainable structure for complex configurations

Summary by cubic

Migrates the Nix flake from flake-utils to flake-parts for a modular, type-safe per-system setup. Adds nixfmt to the dev shell with automatic .nix formatting on pre-commit, and simplifies CI by loading the dev environment in the shared setup-nix action.

  • Refactors

    • Switch to flake-parts mkFlake with perSystem.
    • Supported systems: x86_64-linux, aarch64-linux, aarch64-darwin; drop x86_64-darwin.
    • Move nix develop into setup-nix action; remove duplicate steps in CI, release, and dry-publish workflows.
    • Add nixfmt-rfc-style to devShell; run nixfmt via lefthook pre-commit.
  • Dependencies

    • Replace flake-utils with flake-parts and add nixpkgs.lib input.
    • Update flake.lock to reflect the new inputs.

Written for commit 2c9a8ff. Summary will update automatically on new commits.

Replace flake-utils with flake-parts for a more modular and type-safe
Nix flake configuration. flake-parts uses the NixOS module system
pattern, providing better extensibility and composability.

Key changes:
- Replace flake-utils input with flake-parts
- Use mkFlake with perSystem pattern instead of eachDefaultSystem
- Explicitly declare supported systems (x86_64-linux, aarch64-linux,
  aarch64-darwin)
- Remove x86_64-darwin from supported systems as it is no longer needed

Benefits of flake-parts:
- NixOS-style module system for flake configuration
- Type-safe options with better error messages
- Support for advanced features like partitions and flakeModules
- More maintainable structure for complex flake configurations
@ryoppippi ryoppippi requested a review from a team as a code owner December 15, 2025 23:02
Copilot AI review requested due to automatic review settings December 15, 2025 23:02
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Dec 15, 2025

Open in StackBlitz

npm i https://pkg.pr.new/StackOneHQ/stackone-ai-node/@stackone/ai@250

commit: 2c9a8ff

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Dec 15, 2025

Open in StackBlitz

npm i https://pkg.pr.new/StackOneHQ/stackone-ai-node/@stackone/ai@250

commit: aa39a39

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the Nix flake configuration by migrating from flake-utils to flake-parts for improved modularity and type safety. The migration adopts the NixOS module system pattern and explicitly declares supported systems.

Key Changes:

  • Replaced flake-utils dependency with flake-parts
  • Refactored outputs structure from eachDefaultSystem to mkFlake with perSystem pattern
  • Explicitly declared three supported systems (x86_64-linux, aarch64-linux, aarch64-darwin), removing x86_64-darwin

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
flake.nix Migrated from flake-utils to flake-parts, refactored outputs using mkFlake with explicit system declarations
flake.lock Updated dependency tree to replace flake-utils with flake-parts and nixpkgs-lib

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add nixfmt-rfc-style as a development dependency in the Nix flake and
configure lefthook to automatically format .nix files on pre-commit.

Uses `nix develop --command` to run nixfmt from the devShell context,
ensuring consistent Nix code formatting across the project.
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Copy link
Copy Markdown
Contributor

@glebedel glebedel left a comment

Choose a reason for hiding this comment

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

LGTM

@ryoppippi ryoppippi merged commit b5defd8 into main Dec 16, 2025
13 checks passed
@ryoppippi ryoppippi deleted the refactor/migrate-flake-utils-to-flake-parts branch December 16, 2025 13:53
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.

3 participants