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-collect-garbage
|
||||
|
||||
nix-collect-garbage_DIR := $(d)
|
||||
|
||||
nix-collect-garbage_SOURCES := $(d)/nix-collect-garbage.cc
|
||||
|
||||
nix-collect-garbage_LIBS = libmain libstore libutil libformat
|
|
@ -2,6 +2,7 @@
|
|||
#include "profiles.hh"
|
||||
#include "shared.hh"
|
||||
#include "globals.hh"
|
||||
#include "legacy.hh"
|
||||
|
||||
#include <iostream>
|
||||
#include <cerrno>
|
||||
|
@ -48,12 +49,10 @@ void removeOldGenerations(std::string dir)
|
|||
}
|
||||
}
|
||||
|
||||
int main(int argc, char * * argv)
|
||||
static int _main(int argc, char * * argv)
|
||||
{
|
||||
bool removeOld = false;
|
||||
|
||||
return handleExceptions(argv[0], [&]() {
|
||||
initNix();
|
||||
{
|
||||
bool removeOld = false;
|
||||
|
||||
GCOptions options;
|
||||
|
||||
|
@ -90,5 +89,9 @@ int main(int argc, char * * argv)
|
|||
PrintFreed freed(true, results);
|
||||
store->collectGarbage(options, results);
|
||||
}
|
||||
});
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static RegisterLegacyCommand s1("nix-collect-garbage", _main);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue