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

Configure cli flags via flake.nix #4611

Open
garbas opened this issue Mar 6, 2021 · 7 comments
Open

Configure cli flags via flake.nix #4611

garbas opened this issue Mar 6, 2021 · 7 comments
Labels
flakes UX The way in which users interact with Nix. Higher level than UI.
Projects

Comments

@garbas
Copy link
Member

garbas commented Mar 6, 2021

We already allow to configure (certain) nix.conf options via flake.nix (done in #4189). It would be very useful to extend this to also allow to configure cli flags via flake.nix.

@garbas garbas added improvement UX The way in which users interact with Nix. Higher level than UI. flakes labels Mar 6, 2021
@thufschmitt
Copy link
Member

Shouldn't we rather make the relevant CLI flags nix.conf options ?

@zimbatm
Copy link
Member

zimbatm commented Mar 6, 2021

Are there specific examples?

@garbas
Copy link
Member Author

garbas commented Mar 6, 2021

An example would be part of the solution for #4609, where you could more in detail define your development environment variables with providing different defaults for --keep and --ignore-environment.

@stale
Copy link

stale bot commented Sep 3, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Sep 3, 2021
@thufschmitt thufschmitt added this to In progress in UX Oct 22, 2021
@domenkozar
Copy link
Member

I'd really like to setup a post build hook for flake commands.

@stale stale bot removed the stale label Oct 29, 2021
@thufschmitt
Copy link
Member

I'd really like to setup a post build hook for flake commands.

That’s slightly orthogonal: It’s already possible to set options in flake.nix (just not arbitrary cli flags, but post-build-hook is an option). The missing bit for your use-case is probably that these aren’t forwarded to the daemon atm. #5504 should fix that

@thufschmitt thufschmitt moved this from In progress to Backlog in UX Nov 17, 2021
@stale stale bot added the stale label Aug 13, 2022
@stale stale bot removed the stale label Dec 5, 2022
@srid
Copy link

srid commented Apr 12, 2023

Shouldn't we rather make the relevant CLI flags nix.conf options ?

Are there specific examples?

Another example: In CI, I want to make --no-write-lock-file (in addition to --no-link) the default for all nix commands (nix build, nix flake check, nix develop), so as to handle the scenario where a developer forgot to commit the changes to the flake.lock file. See juspay/jenkins-nix-ci#15

If I can enable --no-write-lock-file in nix.conf of the build agent, all projects would automatically benefit from this check. And they do not have to individually check for lock file consistency (an error prone process because any of the Nix commands may overlook passing this option).

srid added a commit to juspay/jenkins-nix-ci that referenced this issue Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flakes UX The way in which users interact with Nix. Higher level than UI.
Projects
Status: Backlog
UX
Backlog
Development

No branches or pull requests

6 participants