Skip to content

refactor(build): use immutable functions for retrieving compile-time variables#84

Merged
water-sucks merged 1 commit intonix-community:mainfrom
water-sucks:use-safer-interface-for-compile-time-vars
Jul 7, 2025
Merged

refactor(build): use immutable functions for retrieving compile-time variables#84
water-sucks merged 1 commit intonix-community:mainfrom
water-sucks:use-safer-interface-for-compile-time-vars

Conversation

@water-sucks
Copy link
Copy Markdown
Collaborator

The -ldflags option for go build does not support setting types other than strings for variables.

As such, for the buildOpts.Flake compile-time variable, this resulted in unwieldy string comparisons everywhere to determine Boolean values.

This fixes that DX issue by exposing functions that return the values for each compile-time variable in the internal/build package, and the variables themselves are moved to separate internal/build/vars subpackage that should not be touched by anything other than the Go build system.

@water-sucks water-sucks merged commit 3322a0a into nix-community:main Jul 7, 2025
1 check passed
@water-sucks water-sucks deleted the use-safer-interface-for-compile-time-vars branch July 7, 2025 06:44
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.

1 participant