1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

Merge pull request #33 from DeterminateSystems/push-qvlnukytmqwu

Hide the "dirty" notice when running nix develop
This commit is contained in:
Graham Christensen 2025-04-24 14:43:43 +00:00 committed by GitHub
commit ad7100fd6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 0 deletions

View file

@ -214,6 +214,8 @@ struct InstallableCommand : virtual Args, SourceExprCommand
{
InstallableCommand();
virtual void preRun(ref<Store> store);
virtual void run(ref<Store> store, ref<Installable> installable) = 0;
void run(ref<Store> store) override;

View file

@ -903,8 +903,13 @@ InstallableCommand::InstallableCommand()
});
}
void InstallableCommand::preRun(ref<Store> store)
{
}
void InstallableCommand::run(ref<Store> store)
{
preRun(store);
auto installable = parseInstallable(store, _installable);
run(store, std::move(installable));
}

View file

@ -1,5 +1,6 @@
#include "nix/util/config-global.hh"
#include "nix/expr/eval.hh"
#include "nix/fetchers/fetch-settings.hh"
#include "nix/cmd/installable-flake.hh"
#include "nix/cmd/command-installable-value.hh"
#include "nix/main/common-args.hh"
@ -583,6 +584,11 @@ struct CmdDevelop : Common, MixEnvironment
;
}
void preRun(ref<Store> store) override
{
fetchSettings.warnDirty = false;
}
void run(ref<Store> store, ref<Installable> installable) override
{
auto [buildEnvironment, gcroot] = getBuildEnvironment(store, installable);