mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Merge all nix-* binaries into nix
These are all symlinks to 'nix' now, reducing the installed size by about ~1.7 MiB.
This commit is contained in:
parent
c47e14ee45
commit
f6a3dfe4e0
24 changed files with 105 additions and 165 deletions
|
@ -1,7 +0,0 @@
|
|||
programs += nix-channel
|
||||
|
||||
nix-channel_DIR := $(d)
|
||||
|
||||
nix-channel_LIBS = libmain libformat libstore libutil
|
||||
|
||||
nix-channel_SOURCES := $(d)/nix-channel.cc
|
|
@ -1,9 +1,11 @@
|
|||
#include "shared.hh"
|
||||
#include "globals.hh"
|
||||
#include "download.hh"
|
||||
#include "store-api.hh"
|
||||
#include "legacy.hh"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <regex>
|
||||
#include "store-api.hh"
|
||||
#include <pwd.h>
|
||||
|
||||
using namespace nix;
|
||||
|
@ -157,11 +159,9 @@ static void update(const StringSet & channelNames)
|
|||
replaceSymlink(profile, channelLink);
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
static int _main(int argc, char ** argv)
|
||||
{
|
||||
return handleExceptions(argv[0], [&]() {
|
||||
initNix();
|
||||
|
||||
{
|
||||
// Figure out the name of the `.nix-channels' file to use
|
||||
auto home = getHome();
|
||||
channelsList = home + "/.nix-channels";
|
||||
|
@ -255,5 +255,9 @@ int main(int argc, char ** argv)
|
|||
runProgram(settings.nixBinDir + "/nix-env", false, envArgs);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static RegisterLegacyCommand s1("nix-channel", _main);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue