mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-30 17:46:15 +02:00
Merge remote-tracking branch 'origin/master' into flakes
This commit is contained in:
commit
2c1e05ae93
4 changed files with 19 additions and 17 deletions
|
@ -178,19 +178,6 @@ Strings argvToStrings(int argc, char * * argv)
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
Strings editorFor(Pos pos)
|
|
||||||
{
|
|
||||||
auto editor = getEnv("EDITOR", "cat");
|
|
||||||
auto args = tokenizeString<Strings>(editor);
|
|
||||||
if (pos.line > 0 && (
|
|
||||||
editor.find("emacs") != std::string::npos ||
|
|
||||||
editor.find("nano") != std::string::npos ||
|
|
||||||
editor.find("vim") != std::string::npos))
|
|
||||||
args.push_back(fmt("+%d", pos.line));
|
|
||||||
args.push_back(pos.file);
|
|
||||||
return args;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string renderLabels(const Strings & labels)
|
std::string renderLabels(const Strings & labels)
|
||||||
{
|
{
|
||||||
std::string res;
|
std::string res;
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "util.hh"
|
#include "util.hh"
|
||||||
#include "nixexpr.hh"
|
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
|
@ -242,9 +241,6 @@ public:
|
||||||
|
|
||||||
Strings argvToStrings(int argc, char * * argv);
|
Strings argvToStrings(int argc, char * * argv);
|
||||||
|
|
||||||
/* Helper function to generate args that invoke $EDITOR on filename:lineno */
|
|
||||||
Strings editorFor(Pos pos);
|
|
||||||
|
|
||||||
/* Helper function for rendering argument labels. */
|
/* Helper function for rendering argument labels. */
|
||||||
std::string renderLabels(const Strings & labels);
|
std::string renderLabels(const Strings & labels);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "command.hh"
|
#include "command.hh"
|
||||||
#include "store-api.hh"
|
#include "store-api.hh"
|
||||||
#include "derivations.hh"
|
#include "derivations.hh"
|
||||||
|
#include "nixexpr.hh"
|
||||||
#include "profiles.hh"
|
#include "profiles.hh"
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
@ -82,6 +83,19 @@ void StorePathCommand::run(ref<Store> store)
|
||||||
run(store, *storePaths.begin());
|
run(store, *storePaths.begin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Strings editorFor(const Pos & pos)
|
||||||
|
{
|
||||||
|
auto editor = getEnv("EDITOR", "cat");
|
||||||
|
auto args = tokenizeString<Strings>(editor);
|
||||||
|
if (pos.line > 0 && (
|
||||||
|
editor.find("emacs") != std::string::npos ||
|
||||||
|
editor.find("nano") != std::string::npos ||
|
||||||
|
editor.find("vim") != std::string::npos))
|
||||||
|
args.push_back(fmt("+%d", pos.line));
|
||||||
|
args.push_back(pos.file);
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
MixProfile::MixProfile()
|
MixProfile::MixProfile()
|
||||||
{
|
{
|
||||||
mkFlag()
|
mkFlag()
|
||||||
|
|
|
@ -11,6 +11,7 @@ namespace nix {
|
||||||
extern std::string programPath;
|
extern std::string programPath;
|
||||||
|
|
||||||
class EvalState;
|
class EvalState;
|
||||||
|
struct Pos;
|
||||||
class Store;
|
class Store;
|
||||||
|
|
||||||
namespace flake {
|
namespace flake {
|
||||||
|
@ -175,6 +176,10 @@ PathSet toDerivations(ref<Store> store,
|
||||||
std::vector<std::shared_ptr<Installable>> installables,
|
std::vector<std::shared_ptr<Installable>> installables,
|
||||||
bool useDeriver = false);
|
bool useDeriver = false);
|
||||||
|
|
||||||
|
/* Helper function to generate args that invoke $EDITOR on
|
||||||
|
filename:lineno. */
|
||||||
|
Strings editorFor(const Pos & pos);
|
||||||
|
|
||||||
struct MixProfile : virtual Args, virtual StoreCommand
|
struct MixProfile : virtual Args, virtual StoreCommand
|
||||||
{
|
{
|
||||||
std::optional<Path> profile;
|
std::optional<Path> profile;
|
||||||
|
|
Loading…
Reference in a new issue