Files
lix/lix/libstore/platform/linux.hh
T
Raito Bezarius 1783d5b348 libstore/build: drop cgroups experimental feature
We drop it to re-introduce it via the concept of build context which
will control in which cgroup a certain build should be spawned.

Change-Id: I4b4705d768129a6d7c0f061dc2163ba116088b18
Signed-off-by: Raito Bezarius <raito@lix.systems>
2025-06-10 16:00:51 +00:00

67 lines
1.4 KiB
C++

#pragma once
///@file
#include "lix/libstore/build/local-derivation-goal.hh"
#include "lix/libstore/gc-store.hh"
#include "lix/libstore/local-store.hh"
namespace nix {
/**
* Linux-specific implementation of LocalStore
*/
class LinuxLocalStore : public LocalStore
{
public:
LinuxLocalStore(LocalStoreConfig config) : Store(config), LocalStore(config) {}
LinuxLocalStore(const std::string scheme, std::string path, LocalStoreConfig config)
: LinuxLocalStore(config)
{
throw UnimplementedError("LinuxLocalStore");
}
private:
void findPlatformRoots(UncheckedRoots & unchecked) override;
};
/**
* Linux-specific implementation of LocalDerivationGoal
*/
class LinuxLocalDerivationGoal : public LocalDerivationGoal
{
public:
using LocalDerivationGoal::LocalDerivationGoal;
private:
/**
* Create and populate chroot
*/
void prepareSandbox() override;
/**
* Start child process in new namespaces,
* create /etc/passwd and /etc/group based on discovered uid/gid
*/
Pid startChild(std::function<void()> openSlave) override;
/**
* Kill all processes by build user.
*/
void killSandbox(bool getStatus) override;
/**
* Set up system call filtering using seccomp, unless disabled at build time.
* This also sets the NO_NEW_PRIVS flag.
*/
void setupSyscallFilter() override;
bool supportsUidRange() override
{
return true;
}
};
}