Skip to content

refactor!: move prune-lock logic out of write-flake. - #22

Merged
vic merged 1 commit into
mainfrom
hooks
Jul 20, 2025
Merged

vic merged 1 commit into
mainfrom
hooks

Conversation

@vic

@vic vic commented Jul 20, 2025 •

Copy link
Copy Markdown
Member
  • Move options from _options/ to options/ directory
  • Convert all option files to proper flake-parts modules with options namespace
  • Introduce hooks system for extensible write and check operations:
    • write-hooks: run during flake generation on working copy
    • check-hooks: run during flake validation on temporary copy
  • Refactor prune-lock to use hooks system instead of hardcoded logic
  • Update formatter option to use package type instead of command string
  • Simplify write-flake.nix using new hooks architecture
  • Replace hardcoded prune-lock logic with configurable hook system

BREAKING CHANGE: The formatter is now expected to return a package with meta.mainProgram,
the old behavior expected a command string.

Copilot AI review requested due to automatic review settings July 20, 2025 08:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 flake generation system by introducing a hooks-based architecture and converting options to proper NixOS modules. The key change replaces hardcoded prune-lock logic with a configurable hooks system that allows extensible write and check operations.

  • Converts option files from simple option definitions to proper NixOS modules with options namespace
  • Introduces write-hooks and check-hooks systems for extensible flake generation and validation
  • Refactors the formatter option to use package type instead of command string for better type safety

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

File Description
modules/write-flake.nix Restructured to use hooks system instead of hardcoded prune-lock logic
modules/options.nix Simplified to import individual option modules instead of inline definitions
modules/options/*.nix New proper NixOS modules for each option with options namespace
modules/_options/*.nix Removed old option files that returned raw option definitions

Comment thread modules/options/check-hooks.nix Resolved
Comment thread modules/options/prune-lock.nix Resolved
Comment thread modules/write-flake.nix Resolved
…ystem

- Move options from _options/ to options/ directory
- Convert all option files to proper flake-parts modules with options namespace
- Introduce hooks system for extensible write and check operations:
  - write-hooks: run during flake generation on working copy
  - check-hooks: run during flake validation on temporary copy
- Refactor prune-lock to use hooks system instead of hardcoded logic
- Update formatter option to use package type instead of command string
- Simplify write-flake.nix using new hooks architecture
- Replace hardcoded prune-lock logic with configurable hook system

BREAKING CHANGE: The formatter is now expected to return a package with meta.mainProgram, 
the old behavior expected a command string.
@vic vic changed the title refactor!: convert options to proper NixOS modules with hooks system refactor!: move prune-lock logic out of write-flake. Jul 20, 2025
@vic
vic merged commit 2dda263 into main Jul 20, 2025
@vic
vic deleted the hooks branch July 20, 2025 08:09
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.

2 participants